@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aesophia_cli +0 -0
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +1792 -1525
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +11 -12
- package/es/AeSdkMethods.mjs +6 -8
- package/es/AeSdkMethods.mjs.map +1 -1
- package/es/AeSdkWallet.mjs +1 -1
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +5 -1
- package/es/Node.mjs +11 -5
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +11 -6
- package/es/account/Base.mjs +0 -17
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.mjs +11 -24
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.mjs.map +1 -1
- package/es/account/LedgerFactory.mjs.map +1 -1
- package/es/account/Memory.d.ts +2 -1
- package/es/account/Memory.mjs +9 -21
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +12 -14
- package/es/aens.mjs +17 -31
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.d.ts +1 -1
- package/es/apis/compiler/compiler.mjs +4 -20
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +3 -2
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +1 -1
- package/es/apis/compiler/models/mappers.mjs +19 -2
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +15 -15
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.d.ts +1 -1
- package/es/apis/node/models/mappers.mjs +2 -1
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/parameters.d.ts +2 -2
- package/es/apis/node/models/parameters.mjs +2 -2
- package/es/apis/node/models/parameters.mjs.map +1 -1
- package/es/apis/node/node.mjs +3 -19
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +8 -8
- package/es/chain.mjs +19 -22
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +25 -12
- package/es/channel/Base.mjs +23 -26
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/Contract.mjs +8 -21
- package/es/channel/Contract.mjs.map +1 -1
- package/es/channel/Spend.d.ts +4 -2
- package/es/channel/Spend.mjs +0 -16
- package/es/channel/Spend.mjs.map +1 -1
- package/es/channel/handlers.mjs +6 -18
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +19 -2
- package/es/channel/internal.mjs +19 -19
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +30 -85
- package/es/contract/Contract.mjs +174 -211
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +7 -14
- package/es/contract/compiler/Base.mjs.map +1 -1
- package/es/contract/compiler/Cli.mjs +5 -11
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/contract/compiler/Http.mjs +6 -30
- package/es/contract/compiler/Http.mjs.map +1 -1
- package/es/contract/compiler/HttpNode.mjs.map +1 -1
- package/es/contract/compiler/getFileSystem.mjs.map +1 -1
- package/es/contract/delegation-signature.d.ts +43 -0
- package/es/contract/delegation-signature.mjs +45 -0
- package/es/contract/delegation-signature.mjs.map +1 -0
- package/es/contract/ga.d.ts +23 -7
- package/es/contract/ga.mjs +52 -27
- package/es/contract/ga.mjs.map +1 -1
- package/es/index-browser.d.ts +4 -3
- package/es/index-browser.mjs +6 -20
- package/es/index-browser.mjs.map +1 -1
- package/es/oracle.d.ts +12 -17
- package/es/oracle.mjs +28 -48
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +19 -27
- package/es/spend.mjs +20 -43
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/SchemaTypes.d.ts +37 -0
- package/es/tx/builder/SchemaTypes.mjs +2 -0
- package/es/tx/builder/SchemaTypes.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +4 -2
- package/es/tx/builder/constants.mjs +2 -0
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/abi-version.d.ts +11 -2
- package/es/tx/builder/field-types/abi-version.mjs +24 -4
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
- package/es/tx/builder/field-types/address.mjs.map +1 -1
- package/es/tx/builder/field-types/array.d.ts +1 -1
- package/es/tx/builder/field-types/array.mjs.map +1 -1
- package/es/tx/builder/field-types/boolean.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/es/tx/builder/field-types/coin-amount.mjs +4 -5
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +22 -3
- package/es/tx/builder/field-types/ct-version.mjs +32 -4
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
- package/es/tx/builder/field-types/deposit.d.ts +2 -1
- package/es/tx/builder/field-types/deposit.mjs +3 -2
- package/es/tx/builder/field-types/deposit.mjs.map +1 -1
- package/es/tx/builder/field-types/encoded.d.ts +1 -1
- package/es/tx/builder/field-types/encoded.mjs.map +1 -1
- package/es/tx/builder/field-types/entry.mjs +3 -0
- package/es/tx/builder/field-types/entry.mjs.map +1 -1
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +3 -1
- package/es/tx/builder/field-types/fee.mjs +5 -1
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/field.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/es/tx/builder/field-types/gas-limit.mjs +4 -2
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +3 -1
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +52 -13
- package/es/tx/builder/field-types/index.mjs +10 -2
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/map.d.ts +13 -0
- package/es/tx/builder/field-types/map.mjs +49 -0
- package/es/tx/builder/field-types/map.mjs.map +1 -0
- package/es/tx/builder/field-types/mptree.d.ts +7 -2
- package/es/tx/builder/field-types/mptree.mjs +5 -7
- package/es/tx/builder/field-types/mptree.mjs.map +1 -1
- package/es/tx/builder/field-types/name-fee.d.ts +1 -1
- package/es/tx/builder/field-types/name-fee.mjs +2 -2
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/name-id.mjs.map +1 -1
- package/es/tx/builder/field-types/name.mjs.map +1 -1
- package/es/tx/builder/field-types/nonce.d.ts +14 -0
- package/es/tx/builder/field-types/nonce.mjs +29 -0
- package/es/tx/builder/field-types/nonce.mjs.map +1 -0
- package/es/tx/builder/field-types/pointers.mjs.map +1 -1
- package/es/tx/builder/field-types/raw.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/string.mjs.map +1 -1
- package/es/tx/builder/field-types/ttl.d.ts +11 -0
- package/es/tx/builder/field-types/ttl.mjs +21 -0
- package/es/tx/builder/field-types/ttl.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/wrapped.d.ts +14 -0
- package/es/tx/builder/field-types/wrapped.mjs +22 -0
- package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +20 -20
- package/es/tx/builder/index.mjs +54 -64
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +2735 -2865
- package/es/tx/builder/schema.generated.d.ts +2011 -0
- package/es/tx/builder/schema.generated.mjs +2 -0
- package/es/tx/builder/schema.generated.mjs.map +1 -0
- package/es/tx/builder/schema.mjs +459 -155
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/execution-cost.d.ts +35 -0
- package/es/tx/execution-cost.mjs +123 -0
- package/es/tx/execution-cost.mjs.map +1 -0
- package/es/tx/transaction-signer.d.ts +6 -0
- package/es/tx/transaction-signer.mjs +27 -0
- package/es/tx/transaction-signer.mjs.map +1 -0
- package/es/tx/validator.mjs +60 -109
- package/es/tx/validator.mjs.map +1 -1
- package/es/utils/amount-formatter.mjs +0 -16
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +3 -2
- package/es/utils/autorest.mjs +43 -11
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bytes.mjs +0 -16
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.mjs +0 -16
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +14 -31
- package/es/utils/errors.mjs +2 -32
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/other.d.ts +1 -1
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.mjs +0 -17
- package/es/utils/string.mjs.map +1 -1
- package/package.json +34 -30
- package/src/AeSdkMethods.ts +11 -16
- package/src/AeSdkWallet.ts +1 -1
- package/src/Node.ts +17 -6
- package/src/account/Base.ts +11 -22
- package/src/account/Generalized.ts +8 -23
- package/src/account/Memory.ts +14 -21
- package/src/aens.ts +31 -47
- package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
- package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
- package/src/aepp-wallet-communication/rpc/types.ts +6 -2
- package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
- package/src/apis/compiler/compiler.ts +3 -27
- package/src/apis/compiler/models/index.ts +3 -2
- package/src/apis/compiler/models/mappers.ts +15 -2
- package/src/apis/node/models/index.ts +16 -15
- package/src/apis/node/models/mappers.ts +2 -1
- package/src/apis/node/models/parameters.ts +2 -2
- package/src/apis/node/node.ts +3 -27
- package/src/chain.ts +28 -27
- package/src/channel/Base.ts +33 -33
- package/src/channel/Contract.ts +8 -23
- package/src/channel/Spend.ts +2 -17
- package/src/channel/handlers.ts +5 -18
- package/src/channel/internal.ts +40 -22
- package/src/contract/Contract.ts +133 -163
- package/src/contract/compiler/Base.ts +7 -14
- package/src/contract/compiler/Cli.ts +5 -11
- package/src/contract/compiler/Http.ts +6 -25
- package/src/contract/delegation-signature.ts +56 -0
- package/src/contract/ga.ts +53 -32
- package/src/index-browser.ts +12 -20
- package/src/oracle.ts +46 -56
- package/src/spend.ts +33 -67
- package/src/tx/builder/SchemaTypes.ts +79 -0
- package/src/tx/builder/constants.ts +2 -0
- package/src/tx/builder/field-types/abi-version.ts +29 -6
- package/src/tx/builder/field-types/array.ts +1 -1
- package/src/tx/builder/field-types/coin-amount.ts +6 -4
- package/src/tx/builder/field-types/ct-version.ts +37 -4
- package/src/tx/builder/field-types/deposit.ts +3 -1
- package/src/tx/builder/field-types/encoded.ts +1 -1
- package/src/tx/builder/field-types/entry.ts +8 -3
- package/src/tx/builder/field-types/fee.ts +6 -4
- package/src/tx/builder/field-types/gas-limit.ts +2 -2
- package/src/tx/builder/field-types/index.ts +15 -1
- package/src/tx/builder/field-types/map.ts +45 -0
- package/src/tx/builder/field-types/mptree.ts +4 -3
- package/src/tx/builder/field-types/name-fee.ts +2 -1
- package/src/tx/builder/field-types/nonce.ts +40 -0
- package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
- package/src/tx/builder/field-types/ttl.ts +24 -0
- package/src/tx/builder/field-types/wrapped.ts +32 -0
- package/src/tx/builder/index.ts +57 -71
- package/src/tx/builder/schema.generated.ts +2013 -0
- package/src/tx/builder/schema.ts +544 -624
- package/src/tx/execution-cost.ts +146 -0
- package/src/tx/transaction-signer.ts +27 -0
- package/src/tx/validator.ts +60 -91
- package/src/utils/amount-formatter.ts +0 -16
- package/src/utils/autorest.ts +52 -11
- package/src/utils/bytes.ts +0 -16
- package/src/utils/crypto.ts +0 -16
- package/src/utils/errors.ts +15 -44
- package/src/utils/string.ts +0 -17
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.2/Node.d.ts +5 -1
- package/types-legacy/ts4.2/account/Base.d.ts +11 -6
- package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.2/aens.d.ts +12 -14
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.2/chain.d.ts +8 -8
- package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +7 -14
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.2/index-browser.d.ts +4 -3
- package/types-legacy/ts4.2/oracle.d.ts +12 -17
- package/types-legacy/ts4.2/spend.d.ts +19 -27
- package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.2/utils/other.d.ts +1 -1
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.5/Node.d.ts +5 -1
- package/types-legacy/ts4.5/account/Base.d.ts +11 -6
- package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.5/aens.d.ts +12 -14
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.5/chain.d.ts +8 -8
- package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +7 -14
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.5/index-browser.d.ts +4 -3
- package/types-legacy/ts4.5/oracle.d.ts +12 -17
- package/types-legacy/ts4.5/spend.d.ts +19 -27
- package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.5/utils/other.d.ts +1 -1
- package/es/tx/index.d.ts +0 -19
- package/es/tx/index.mjs +0 -115
- package/es/tx/index.mjs.map +0 -1
- package/src/apis/compiler/code-model-v4.yaml +0 -2442
- package/src/apis/node/code-model-v4.yaml +0 -10080
- package/src/tx/index.ts +0 -129
- package/types-legacy/ts4.2/tx/index.d.ts +0 -19
- package/types-legacy/ts4.5/tx/index.d.ts +0 -19
package/dist/aepp-sdk.browser.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see aepp-sdk.browser.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@azure/core-rest-pipeline"),require("buffer"),require("bignumber.js"),require("@azure/core-client"),require("rlp"),require("bs58"),require("tweetnacl"),require("varuint-bitcoin"),require("@aeternity/uuid"),require("@aeternity/argon2"),require("tweetnacl-auth"),require("bip32-path"),require("aes-js"),require("@aeternity/aepp-calldata"),require("json-bigint"),require("events"),require("websocket")):"function"==typeof define&&define.amd?define(["@azure/core-rest-pipeline","buffer","bignumber.js","@azure/core-client","rlp","bs58","tweetnacl","varuint-bitcoin","@aeternity/uuid","@aeternity/argon2","tweetnacl-auth","bip32-path","aes-js","@aeternity/aepp-calldata","json-bigint","events","websocket"],t):"object"==typeof exports?exports.Aeternity=t(require("@azure/core-rest-pipeline"),require("buffer"),require("bignumber.js"),require("@azure/core-client"),require("rlp"),require("bs58"),require("tweetnacl"),require("varuint-bitcoin"),require("@aeternity/uuid"),require("@aeternity/argon2"),require("tweetnacl-auth"),require("bip32-path"),require("aes-js"),require("@aeternity/aepp-calldata"),require("json-bigint"),require("events"),require("websocket")):e.Aeternity=t(e["@azure/core-rest-pipeline"],e.buffer,e["bignumber.js"],e["@azure/core-client"],e.rlp,e.bs58,e.tweetnacl,e["varuint-bitcoin"],e["@aeternity/uuid"],e["@aeternity/argon2"],e["tweetnacl-auth"],e["bip32-path"],e["aes-js"],e["@aeternity/aepp-calldata"],e["json-bigint"],e.events,e.websocket)}(self,(function(e,t,n,r,a,i,o,s,c,u,l,d,p,m,h,f,y){return function(){var g={8442:function(e,t,n){const r=n(9488);function a(e,t,n){const r=e[t]+e[n];let a=e[t+1]+e[n+1];r>=4294967296&&a++,e[t]=r,e[t+1]=a}function i(e,t,n,r){let a=e[t]+n;n<0&&(a+=4294967296);let i=e[t+1]+r;a>=4294967296&&i++,e[t]=a,e[t+1]=i}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,n,r,o,s){const c=d[o],u=d[o+1],p=d[s],m=d[s+1];a(l,e,t),i(l,e,c,u);let h=l[r]^l[e],f=l[r+1]^l[e+1];l[r]=f,l[r+1]=h,a(l,n,r),h=l[t]^l[n],f=l[t+1]^l[n+1],l[t]=h>>>24^f<<8,l[t+1]=f>>>24^h<<8,a(l,e,t),i(l,e,p,m),h=l[r]^l[e],f=l[r+1]^l[e+1],l[r]=h>>>16^f<<16,l[r+1]=f>>>16^h<<16,a(l,n,r),h=l[t]^l[n],f=l[t+1]^l[n+1],l[t]=f>>>31^h<<1,l[t+1]=h>>>31^f<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),d=new Uint32Array(32);function p(e,t){let n=0;for(n=0;n<16;n++)l[n]=e.h[n],l[n+16]=c[n];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),n=0;n<32;n++)d[n]=o(e.b,4*n);for(n=0;n<12;n++)s(0,8,16,24,u[16*n+0],u[16*n+1]),s(2,10,18,26,u[16*n+2],u[16*n+3]),s(4,12,20,28,u[16*n+4],u[16*n+5]),s(6,14,22,30,u[16*n+6],u[16*n+7]),s(0,10,20,30,u[16*n+8],u[16*n+9]),s(2,12,22,24,u[16*n+10],u[16*n+11]),s(4,14,16,26,u[16*n+12],u[16*n+13]),s(6,8,18,28,u[16*n+14],u[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^l[n]^l[n+16]}const m=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(e,t,n,r){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&16!==n.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(r&&16!==r.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const a={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};m.fill(0),m[0]=e,t&&(m[1]=t.length),m[2]=1,m[3]=1,n&&m.set(n,32),r&&m.set(r,48);for(let e=0;e<16;e++)a.h[e]=c[e]^o(m,4*e);return t&&(f(a,t),a.c=128),a}function f(e,t){for(let n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,p(e,!1),e.c=0),e.b[e.c++]=t[n]}function y(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;p(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n);return t}function g(e,t,n,a,i){n=n||64,e=r.normalizeInput(e),a&&(a=r.normalizeInput(a)),i&&(i=r.normalizeInput(i));const o=h(n,t,a,i);return f(o,e),y(o)}e.exports={blake2b:g,blake2bHex:function(e,t,n,a,i){const o=g(e,t,n,a,i);return r.toHex(o)},blake2bInit:h,blake2bUpdate:f,blake2bFinal:y}},9488:function(e){function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,n,r){let a="\n"+e+" = ";for(let i=0;i<n.length;i+=2){if(32===r)a+=t(n[i]).toUpperCase(),a+=" ",a+=t(n[i+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);a+=t(n[i+1]).toUpperCase(),a+=t(n[i]).toUpperCase()}i%6==4?a+="\n"+new Array(e.length+4).join(" "):i<n.length-2&&(a+=" ")}console.log(a)},testSpeed:function(e,t,n){let r=(new Date).getTime();const a=new Uint8Array(t);for(let e=0;e<t;e++)a[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-r)+"ms"),r=i;for(let i=0;i<n;i++){const n=e(a),i=(new Date).getTime(),o=i-r;r=i,console.log("Hashed in "+o+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},3536:function(e,t,n){var r=n(1910);e.exports=r},281:function(e,t,n){var r=n(2547);n(3975),e.exports=r},31:function(e,t,n){var r=n(6509);e.exports=r},7487:function(e,t,n){var r=n(5774);e.exports=r},8171:function(e,t,n){n(6450);var r=n(4058).Object,a=e.exports=function(e,t,n){return r.defineProperty(e,t,n)};r.defineProperty.sham&&(a.sham=!0)},7473:function(e,t,n){n(5906),n(5967),n(5824),n(8555),n(2615),n(1732),n(5903),n(1825),n(8394),n(5915),n(1766),n(2737),n(9911),n(4315),n(3131),n(4714),n(659),n(9120),n(5327),n(1502);var r=n(4058);e.exports=r.Symbol},4227:function(e,t,n){n(6274),n(5967),n(7971),n(1825);var r=n(1477);e.exports=r.f("iterator")},2978:function(e,t,n){n(8084),n(3131);var r=n(1477);e.exports=r.f("toPrimitive")},3685:function(e,t,n){e.exports=n(621)},6600:function(e,t,n){e.exports=n(2201)},9759:function(e,t,n){e.exports=n(7398)},1384:function(e,t,n){e.exports=n(6189)},621:function(e,t,n){var r=n(3536);e.exports=r},2201:function(e,t,n){var r=n(281);n(8783),n(5799),n(1943),n(6774),n(5414),n(620),n(6172),e.exports=r},7398:function(e,t,n){var r=n(31);e.exports=r},6189:function(e,t,n){var r=n(7487);e.exports=r},4883:function(e,t,n){var r=n(7475),a=n(9826),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not a function")}},1851:function(e,t,n){var r=n(7475),a=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+a(e)+" as a prototype")}},8479:function(e){e.exports=function(){}},6059:function(e,t,n){var r=n(941),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not an object")}},1692:function(e,t,n){var r=n(4529),a=n(9413),i=n(623),o=function(e){return function(t,n,o){var s,c=r(t),u=i(c),l=a(o,u);if(e&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},3610:function(e,t,n){var r=n(6843),a=n(5329),i=n(7026),o=n(9678),s=n(623),c=n(4692),u=a([].push),l=function(e){var t=1==e,n=2==e,a=3==e,l=4==e,d=6==e,p=7==e,m=5==e||d;return function(h,f,y,g){for(var N,w,v=o(h),C=i(v),S=r(f,y),b=s(C),x=0,T=g||c,_=t?T(h,b):n||p?T(h,0):void 0;b>x;x++)if((m||x in C)&&(w=S(N=C[x],x,v),e))if(t)_[x]=w;else if(w)switch(e){case 3:return!0;case 5:return N;case 6:return x;case 2:u(_,N)}else switch(e){case 4:return!1;case 7:u(_,N)}return d?-1:a||l?l:_}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},568:function(e,t,n){var r=n(5981),a=n(9813),i=n(3385),o=a("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},5790:function(e,t,n){var r=n(9413),a=n(623),i=n(5449),o=Array,s=Math.max;e.exports=function(e,t,n){for(var c=a(e),u=r(t,c),l=r(void 0===n?c:n,c),d=o(s(l-u,0)),p=0;u<l;u++,p++)i(d,p,e[u]);return d.length=p,d}},3765:function(e,t,n){var r=n(5329);e.exports=r([].slice)},5693:function(e,t,n){var r=n(1052),a=n(4284),i=n(941),o=n(9813)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(a(t)&&(t===s||r(t.prototype))||i(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},4692:function(e,t,n){var r=n(5693);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},2532:function(e,t,n){var r=n(5329),a=r({}.toString),i=r("".slice);e.exports=function(e){return i(a(e),8,-1)}},9697:function(e,t,n){var r=n(2885),a=n(7475),i=n(2532),o=n(9813)("toStringTag"),s=Object,c="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:c?i(t):"Object"==(r=i(t))&&a(t.callee)?"Arguments":r}},4160:function(e,t,n){var r=n(5981);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},3538:function(e){e.exports=function(e,t){return{value:e,done:t}}},2029:function(e,t,n){var r=n(5746),a=n(5988),i=n(1887);e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},1887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5449:function(e,t,n){"use strict";var r=n(3894),a=n(5988),i=n(1887);e.exports=function(e,t,n){var o=r(t);o in e?a.f(e,o,i(0,n)):e[o]=n}},5929:function(e,t,n){var r=n(2029);e.exports=function(e,t,n,a){return a&&a.enumerable?e[t]=n:r(e,t,n),e}},5609:function(e,t,n){var r=n(1899),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},5746:function(e,t,n){var r=n(5981);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},6616:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},1333:function(e,t,n){var r=n(1899),a=n(941),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},6796:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},3281:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2861:function(e,t,n){var r=n(626);e.exports=r("navigator","userAgent")||""},3385:function(e,t,n){var r,a,i=n(1899),o=n(2861),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(a=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},6759:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6887:function(e,t,n){"use strict";var r=n(1899),a=n(9730),i=n(7484),o=n(7475),s=n(9677).f,c=n(7252),u=n(4058),l=n(6843),d=n(2029),p=n(953),m=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return a(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,a,h,f,y,g,N,w,v,C=e.target,S=e.global,b=e.stat,x=e.proto,T=S?r:b?r[C]:(r[C]||{}).prototype,_=S?u:u[C]||d(u,C,{})[C],z=_.prototype;for(f in t)a=!(n=c(S?f:C+(b?".":"#")+f,e.forced))&&T&&p(T,f),g=_[f],a&&(N=e.dontCallGetSet?(v=s(T,f))&&v.value:T[f]),y=a&&N?N:t[f],a&&typeof g==typeof y||(w=e.bind&&a?l(y,r):e.wrap&&a?m(y):x&&o(y)?i(y):y,(e.sham||y&&y.sham||g&&g.sham)&&d(w,"sham",!0),d(_,f,w),x&&(p(u,h=C+"Prototype")||d(u,h,{}),d(u[h],f,y),e.real&&z&&(n||!z[f])&&d(z,f,y)))}},5981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:function(e,t,n){var r=n(8285),a=Function.prototype,i=a.apply,o=a.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(i):function(){return o.apply(i,arguments)})},6843:function(e,t,n){var r=n(7484),a=n(4883),i=n(8285),o=r(r.bind);e.exports=function(e,t){return a(e),void 0===t?e:i?o(e,t):function(){return e.apply(t,arguments)}}},8285:function(e,t,n){var r=n(5981);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:function(e,t,n){var r=n(8285),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},9417:function(e,t,n){var r=n(5746),a=n(953),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=a(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!r||r&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},7484:function(e,t,n){var r=n(2532),a=n(5329);e.exports=function(e){if("Function"===r(e))return a(e)}},5329:function(e,t,n){var r=n(8285),a=Function.prototype,i=a.call,o=r&&a.bind.bind(i,i);e.exports=r?o:function(e){return function(){return i.apply(e,arguments)}}},626:function(e,t,n){var r=n(4058),a=n(1899),i=n(7475),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(a[e]):r[e]&&r[e][t]||a[e]&&a[e][t]}},4229:function(e,t,n){var r=n(4883),a=n(2119);e.exports=function(e,t){var n=e[t];return a(n)?void 0:r(n)}},1899:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},953:function(e,t,n){var r=n(5329),a=n(9678),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(a(e),t)}},7748:function(e){e.exports={}},5463:function(e,t,n){var r=n(626);e.exports=r("document","documentElement")},2840:function(e,t,n){var r=n(5746),a=n(5981),i=n(1333);e.exports=!r&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7026:function(e,t,n){var r=n(5329),a=n(5981),i=n(2532),o=Object,s=r("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):o(e)}:o},1302:function(e,t,n){var r=n(5329),a=n(7475),i=n(3030),o=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},5402:function(e,t,n){var r,a,i,o=n(7093),s=n(1899),c=n(941),u=n(2029),l=n(953),d=n(3030),p=n(4262),m=n(7748),h="Object already initialized",f=s.TypeError,y=s.WeakMap;if(o||d.state){var g=d.state||(d.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,r=function(e,t){if(g.has(e))throw f(h);return t.facade=e,g.set(e,t),t},a=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var N=p("state");m[N]=!0,r=function(e,t){if(l(e,N))throw f(h);return t.facade=e,u(e,N,t),t},a=function(e){return l(e,N)?e[N]:{}},i=function(e){return l(e,N)}}e.exports={set:r,get:a,has:i,enforce:function(e){return i(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=a(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return n}}}},1052:function(e,t,n){var r=n(2532);e.exports=Array.isArray||function(e){return"Array"==r(e)}},7475:function(e,t,n){var r=n(6616),a=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===a}:function(e){return"function"==typeof e}},4284:function(e,t,n){var r=n(5329),a=n(5981),i=n(7475),o=n(9697),s=n(626),c=n(1302),u=function(){},l=[],d=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,m=r(p.exec),h=!p.exec(u),f=function(e){if(!i(e))return!1;try{return d(u,l,e),!0}catch(e){return!1}},y=function(e){if(!i(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!m(p,c(e))}catch(e){return!0}};y.sham=!0,e.exports=!d||a((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?y:f},7252:function(e,t,n){var r=n(5981),a=n(7475),i=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n==l||n!=u&&(a(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},2119:function(e){e.exports=function(e){return null==e}},941:function(e,t,n){var r=n(7475),a=n(6616),i=a.all;e.exports=a.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},2529:function(e){e.exports=!0},6664:function(e,t,n){var r=n(626),a=n(7475),i=n(7046),o=n(2302),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&i(t.prototype,s(e))}},3847:function(e,t,n){"use strict";var r=n(5143).IteratorPrototype,a=n(9290),i=n(1887),o=n(904),s=n(2077),c=function(){return this};e.exports=function(e,t,n,u){var l=t+" Iterator";return e.prototype=a(r,{next:i(+!u,n)}),o(e,l,!1,!0),s[l]=c,e}},5105:function(e,t,n){"use strict";var r=n(6887),a=n(8834),i=n(2529),o=n(9417),s=n(7475),c=n(3847),u=n(249),l=n(8929),d=n(904),p=n(2029),m=n(5929),h=n(9813),f=n(2077),y=n(5143),g=o.PROPER,N=o.CONFIGURABLE,w=y.IteratorPrototype,v=y.BUGGY_SAFARI_ITERATORS,C=h("iterator"),S="keys",b="values",x="entries",T=function(){return this};e.exports=function(e,t,n,o,h,y,_){c(n,t,o);var z,A,q,P=function(e){if(e===h&&M)return M;if(!v&&e in k)return k[e];switch(e){case S:case b:case x:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",I=!1,k=e.prototype,O=k[C]||k["@@iterator"]||h&&k[h],M=!v&&O||P(h),R="Array"==t&&k.entries||O;if(R&&(z=u(R.call(new e)))!==Object.prototype&&z.next&&(i||u(z)===w||(l?l(z,w):s(z[C])||m(z,C,T)),d(z,E,!0,!0),i&&(f[E]=T)),g&&h==b&&O&&O.name!==b&&(!i&&N?p(k,"name",b):(I=!0,M=function(){return a(O,this)})),h)if(A={values:P(b),keys:y?M:P(S),entries:P(x)},_)for(q in A)(v||I||!(q in k))&&m(k,q,A[q]);else r({target:t,proto:!0,forced:v||I},A);return i&&!_||k[C]===M||m(k,C,M,{name:h}),f[t]=M,A}},5143:function(e,t,n){"use strict";var r,a,i,o=n(5981),s=n(7475),c=n(941),u=n(9290),l=n(249),d=n(5929),p=n(9813),m=n(2529),h=p("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(a=l(l(i)))!==Object.prototype&&(r=a):f=!0),!c(r)||o((function(){var e={};return r[h].call(e)!==e}))?r={}:m&&(r=u(r)),s(r[h])||d(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},2077:function(e){e.exports={}},623:function(e,t,n){var r=n(3057);e.exports=function(e){return r(e.length)}},5331:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},9290:function(e,t,n){var r,a=n(6059),i=n(9938),o=n(6759),s=n(7748),c=n(5463),u=n(1333),l=n(4262),d="prototype",p="script",m=l("IE_PROTO"),h=function(){},f=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;g="undefined"!=typeof document?document.domain&&r?y(r):(t=u("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):y(r);for(var a=o.length;a--;)delete g[d][o[a]];return g()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=a(e),n=new h,h[d]=null,n[m]=e):n=g(),void 0===t?n:i.f(n,t)}},9938:function(e,t,n){var r=n(5746),a=n(3937),i=n(5988),o=n(6059),s=n(4529),c=n(4771);t.f=r&&!a?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),a=c(t),u=a.length,l=0;u>l;)i.f(e,n=a[l++],r[n]);return e}},5988:function(e,t,n){var r=n(5746),a=n(2840),i=n(3937),o=n(6059),s=n(3894),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",m="writable";t.f=r?i?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&m in n&&!n[m]){var r=l(e,t);r&&r[m]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return u(e,t,n)}:u:function(e,t,n){if(o(e),t=s(t),o(n),a)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},9677:function(e,t,n){var r=n(5746),a=n(8834),i=n(6760),o=n(1887),s=n(4529),c=n(3894),u=n(953),l=n(2840),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return o(!a(i.f,e,t),e[t])}},684:function(e,t,n){var r=n(2532),a=n(4529),i=n(946).f,o=n(5790),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==r(e)?function(e){try{return i(e)}catch(e){return o(s)}}(e):i(a(e))}},946:function(e,t,n){var r=n(5629),a=n(6759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},7857:function(e,t){t.f=Object.getOwnPropertySymbols},249:function(e,t,n){var r=n(953),a=n(7475),i=n(9678),o=n(4262),s=n(4160),c=o("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(r(t,c))return t[c];var n=t.constructor;return a(n)&&t instanceof n?n.prototype:t instanceof u?l:null}},7046:function(e,t,n){var r=n(5329);e.exports=r({}.isPrototypeOf)},5629:function(e,t,n){var r=n(5329),a=n(953),i=n(4529),o=n(1692).indexOf,s=n(7748),c=r([].push);e.exports=function(e,t){var n,r=i(e),u=0,l=[];for(n in r)!a(s,n)&&a(r,n)&&c(l,n);for(;t.length>u;)a(r,n=t[u++])&&(~o(l,n)||c(l,n));return l}},4771:function(e,t,n){var r=n(5629),a=n(6759);e.exports=Object.keys||function(e){return r(e,a)}},6760:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!n.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},8929:function(e,t,n){var r=n(5329),a=n(6059),i=n(1851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return a(n),i(r),t?e(n,r):n.__proto__=r,n}}():void 0)},5623:function(e,t,n){"use strict";var r=n(2885),a=n(9697);e.exports=r?{}.toString:function(){return"[object "+a(this)+"]"}},9811:function(e,t,n){var r=n(8834),a=n(7475),i=n(941),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&a(n=e.toString)&&!i(s=r(n,e)))return s;if(a(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&a(n=e.toString)&&!i(s=r(n,e)))return s;throw o("Can't convert object to primitive value")}},4058:function(e){e.exports={}},8219:function(e,t,n){var r=n(2119),a=TypeError;e.exports=function(e){if(r(e))throw a("Can't call method on "+e);return e}},904:function(e,t,n){var r=n(2885),a=n(5988).f,i=n(2029),o=n(953),s=n(5623),c=n(9813)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;o(l,c)||a(l,c,{configurable:!0,value:t}),u&&!r&&i(l,"toString",s)}}},4262:function(e,t,n){var r=n(8726),a=n(9418),i=r("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},3030:function(e,t,n){var r=n(1899),a=n(5609),i="__core-js_shared__",o=r[i]||a(i,{});e.exports=o},8726:function(e,t,n){var r=n(2529),a=n(3030);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.27.0",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4620:function(e,t,n){var r=n(5329),a=n(2435),i=n(5803),o=n(8219),s=r("".charAt),c=r("".charCodeAt),u=r("".slice),l=function(e){return function(t,n){var r,l,d=i(o(t)),p=a(n),m=d.length;return p<0||p>=m?e?"":void 0:(r=c(d,p))<55296||r>56319||p+1===m||(l=c(d,p+1))<56320||l>57343?e?s(d,p):r:e?u(d,p,p+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3405:function(e,t,n){var r=n(3385),a=n(5981);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},9630:function(e,t,n){var r=n(8834),a=n(626),i=n(9813),o=n(5929);e.exports=function(){var e=a("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return r(n,this)}),{arity:1})}},4680:function(e,t,n){var r=n(3405);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},9413:function(e,t,n){var r=n(2435),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},4529:function(e,t,n){var r=n(7026),a=n(8219);e.exports=function(e){return r(a(e))}},2435:function(e,t,n){var r=n(5331);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},3057:function(e,t,n){var r=n(2435),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},9678:function(e,t,n){var r=n(8219),a=Object;e.exports=function(e){return a(r(e))}},6935:function(e,t,n){var r=n(8834),a=n(941),i=n(6664),o=n(4229),s=n(9811),c=n(9813),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!a(e)||i(e))return e;var n,c=o(e,l);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!a(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},3894:function(e,t,n){var r=n(6935),a=n(6664);e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},2885:function(e,t,n){var r={};r[n(9813)("toStringTag")]="z",e.exports="[object z]"===String(r)},5803:function(e,t,n){var r=n(9697),a=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return a(e)}},9826:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9418:function(e,t,n){var r=n(5329),a=0,i=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},2302:function(e,t,n){var r=n(3405);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:function(e,t,n){var r=n(5746),a=n(5981);e.exports=r&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7093:function(e,t,n){var r=n(1899),a=n(7475),i=r.WeakMap;e.exports=a(i)&&/native code/.test(String(i))},3464:function(e,t,n){var r=n(4058),a=n(953),i=n(1477),o=n(5988).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});a(t,e)||o(t,e,{value:i.f(e)})}},1477:function(e,t,n){var r=n(9813);t.f=r},9813:function(e,t,n){var r=n(1899),a=n(8726),i=n(953),o=n(9418),s=n(3405),c=n(2302),u=a("wks"),l=r.Symbol,d=l&&l.for,p=c?l:l&&l.withoutSetter||o;e.exports=function(e){if(!i(u,e)||!s&&"string"!=typeof u[e]){var t="Symbol."+e;s&&i(l,e)?u[e]=l[e]:u[e]=c&&d?d(t):p(t)}return u[e]}},5906:function(e,t,n){"use strict";var r=n(6887),a=n(5981),i=n(1052),o=n(941),s=n(9678),c=n(623),u=n(6796),l=n(5449),d=n(4692),p=n(568),m=n(9813),h=n(3385),f=m("isConcatSpreadable"),y=h>=51||!a((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),g=p("concat"),N=function(e){if(!o(e))return!1;var t=e[f];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,arity:1,forced:!y||!g},{concat:function(e){var t,n,r,a,i,o=s(this),p=d(o,0),m=0;for(t=-1,r=arguments.length;t<r;t++)if(N(i=-1===t?o:arguments[t]))for(a=c(i),u(m+a),n=0;n<a;n++,m++)n in i&&l(p,m,i[n]);else u(m+1),l(p,m++,i);return p.length=m,p}})},6274:function(e,t,n){"use strict";var r=n(4529),a=n(8479),i=n(2077),o=n(5402),s=n(5988).f,c=n(5105),u=n(3538),l=n(2529),d=n(5746),p="Array Iterator",m=o.set,h=o.getterFor(p);e.exports=c(Array,"Array",(function(e,t){m(this,{type:p,target:r(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var f=i.Arguments=i.Array;if(a("keys"),a("values"),a("entries"),!l&&d&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},8084:function(){},2619:function(e,t,n){var r=n(6887),a=n(626),i=n(9730),o=n(8834),s=n(5329),c=n(5981),u=n(1052),l=n(7475),d=n(941),p=n(6664),m=n(3765),h=n(3405),f=a("JSON","stringify"),y=s(/./.exec),g=s("".charAt),N=s("".charCodeAt),w=s("".replace),v=s(1..toString),C=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,x=!h||c((function(){var e=a("Symbol")();return"[null]"!=f([e])||"{}"!=f({a:e})||"{}"!=f(Object(e))})),T=c((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),_=function(e,t){var n=m(arguments),r=t;if((d(t)||void 0!==e)&&!p(e))return u(t)||(t=function(e,t){if(l(r)&&(t=o(r,this,e,t)),!p(t))return t}),n[1]=t,i(f,null,n)},z=function(e,t,n){var r=g(n,t-1),a=g(n,t+1);return y(S,e)&&!y(b,a)||y(b,e)&&!y(S,r)?"\\u"+v(N(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:x||T},{stringify:function(e,t,n){var r=m(arguments),a=i(x?_:f,null,r);return T&&"string"==typeof a?w(a,C,z):a}})},9120:function(e,t,n){var r=n(1899);n(904)(r.JSON,"JSON",!0)},5327:function(){},6450:function(e,t,n){var r=n(6887),a=n(5746),i=n(5988).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!a},{defineProperty:i})},7144:function(e,t,n){var r=n(6887),a=n(3405),i=n(5981),o=n(7857),s=n(9678);r({target:"Object",stat:!0,forced:!a||i((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},5967:function(){},1502:function(){},7971:function(e,t,n){"use strict";var r=n(4620).charAt,a=n(5803),i=n(5402),o=n(5105),s=n(3538),c="String Iterator",u=i.set,l=i.getterFor(c);o(String,"String",(function(e){u(this,{type:c,string:a(e),index:0})}),(function(){var e,t=l(this),n=t.string,a=t.index;return a>=n.length?s(void 0,!0):(e=r(n,a),t.index+=e.length,s(e,!1))}))},8555:function(e,t,n){n(3464)("asyncIterator")},8616:function(e,t,n){"use strict";var r=n(6887),a=n(1899),i=n(8834),o=n(5329),s=n(2529),c=n(5746),u=n(3405),l=n(5981),d=n(953),p=n(7046),m=n(6059),h=n(4529),f=n(3894),y=n(5803),g=n(1887),N=n(9290),w=n(4771),v=n(946),C=n(684),S=n(7857),b=n(9677),x=n(5988),T=n(9938),_=n(6760),z=n(5929),A=n(8726),q=n(4262),P=n(7748),E=n(9418),I=n(9813),k=n(1477),O=n(3464),M=n(9630),R=n(904),B=n(5402),j=n(3610).forEach,D=q("hidden"),F="Symbol",$="prototype",U=B.set,V=B.getterFor(F),H=Object[$],L=a.Symbol,G=L&&L[$],W=a.TypeError,K=a.QObject,Q=b.f,Y=x.f,J=C.f,X=_.f,Z=o([].push),ee=A("symbols"),te=A("op-symbols"),ne=A("wks"),re=!K||!K[$]||!K[$].findChild,ae=c&&l((function(){return 7!=N(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Q(H,t);r&&delete H[t],Y(e,t,n),r&&e!==H&&Y(H,t,r)}:Y,ie=function(e,t){var n=ee[e]=N(G);return U(n,{type:F,tag:e,description:t}),c||(n.description=t),n},oe=function(e,t,n){e===H&&oe(te,t,n),m(e);var r=f(t);return m(n),d(ee,r)?(n.enumerable?(d(e,D)&&e[D][r]&&(e[D][r]=!1),n=N(n,{enumerable:g(0,!1)})):(d(e,D)||Y(e,D,g(1,{})),e[D][r]=!0),ae(e,r,n)):Y(e,r,n)},se=function(e,t){m(e);var n=h(t),r=w(n).concat(de(n));return j(r,(function(t){c&&!i(ce,n,t)||oe(e,t,n[t])})),e},ce=function(e){var t=f(e),n=i(X,this,t);return!(this===H&&d(ee,t)&&!d(te,t))&&(!(n||!d(this,t)||!d(ee,t)||d(this,D)&&this[D][t])||n)},ue=function(e,t){var n=h(e),r=f(t);if(n!==H||!d(ee,r)||d(te,r)){var a=Q(n,r);return!a||!d(ee,r)||d(n,D)&&n[D][r]||(a.enumerable=!0),a}},le=function(e){var t=J(h(e)),n=[];return j(t,(function(e){d(ee,e)||d(P,e)||Z(n,e)})),n},de=function(e){var t=e===H,n=J(t?te:h(e)),r=[];return j(n,(function(e){!d(ee,e)||t&&!d(H,e)||Z(r,ee[e])})),r};u||(L=function(){if(p(G,this))throw W("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?y(arguments[0]):void 0,t=E(e),n=function(e){this===H&&i(n,te,e),d(this,D)&&d(this[D],t)&&(this[D][t]=!1),ae(this,t,g(1,e))};return c&&re&&ae(H,t,{configurable:!0,set:n}),ie(t,e)},z(G=L[$],"toString",(function(){return V(this).tag})),z(L,"withoutSetter",(function(e){return ie(E(e),e)})),_.f=ce,x.f=oe,T.f=se,b.f=ue,v.f=C.f=le,S.f=de,k.f=function(e){return ie(I(e),e)},c&&(Y(G,"description",{configurable:!0,get:function(){return V(this).description}}),s||z(H,"propertyIsEnumerable",ce,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:L}),j(w(ne),(function(e){O(e)})),r({target:F,stat:!0,forced:!u},{useSetter:function(){re=!0},useSimple:function(){re=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?N(e):se(N(e),t)},defineProperty:oe,defineProperties:se,getOwnPropertyDescriptor:ue}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:le}),M(),R(L,F),P[D]=!0},2615:function(){},4523:function(e,t,n){var r=n(6887),a=n(626),i=n(953),o=n(5803),s=n(8726),c=n(4680),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=o(e);if(i(u,t))return u[t];var n=a("Symbol")(t);return u[t]=n,l[n]=t,n}})},1732:function(e,t,n){n(3464)("hasInstance")},5903:function(e,t,n){n(3464)("isConcatSpreadable")},1825:function(e,t,n){n(3464)("iterator")},5824:function(e,t,n){n(8616),n(4523),n(8608),n(2619),n(7144)},8608:function(e,t,n){var r=n(6887),a=n(953),i=n(6664),o=n(9826),s=n(8726),c=n(4680),u=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw TypeError(o(e)+" is not a symbol");if(a(u,e))return u[e]}})},5915:function(e,t,n){n(3464)("matchAll")},8394:function(e,t,n){n(3464)("match")},1766:function(e,t,n){n(3464)("replace")},2737:function(e,t,n){n(3464)("search")},9911:function(e,t,n){n(3464)("species")},4315:function(e,t,n){n(3464)("split")},3131:function(e,t,n){var r=n(3464),a=n(9630);r("toPrimitive"),a()},4714:function(e,t,n){var r=n(626),a=n(3464),i=n(904);a("toStringTag"),i(r("Symbol"),"Symbol")},659:function(e,t,n){n(3464)("unscopables")},8783:function(e,t,n){n(3464)("asyncDispose")},3975:function(e,t,n){n(3464)("dispose")},5799:function(e,t,n){n(3464)("matcher")},1943:function(e,t,n){n(3464)("metadataKey")},5414:function(e,t,n){n(3464)("metadata")},6774:function(e,t,n){n(3464)("observable")},620:function(e,t,n){n(3464)("patternMatch")},6172:function(e,t,n){n(3464)("replaceAll")},7634:function(e,t,n){n(6274);var r=n(3281),a=n(1899),i=n(9697),o=n(2029),s=n(2077),c=n(9813)("toStringTag");for(var u in r){var l=a[u],d=l&&l.prototype;d&&i(d)!==c&&o(d,c,u),s[u]=s.Array}},1910:function(e,t,n){var r=n(8171);e.exports=r},2547:function(e,t,n){var r=n(7473);n(7634),e.exports=r},6509:function(e,t,n){var r=n(4227);n(7634),e.exports=r},5774:function(e,t,n){var r=n(2978);e.exports=r},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},9509:function(e,t,n){var r=n(9408),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},4189:function(e,t,n){var r=n(9509).Buffer;function a(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,a=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var c=o%a,u=Math.min(i-s,a-c),l=0;l<u;l++)n[c+l]=e[s+l];s+=u,(o+=u)%a==0&&this._update(n)}return this._len+=i,this},a.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,a=(n-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},7499:function(e,t,n){var r=n(5717),a=n(4189),i=n(9509).Buffer,o=[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],s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function m(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,a),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,a=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,f=0|this._g,y=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+m(n[g-15])+n[g-16];for(var N=0;N<64;++N){var w=y+p(c)+u(c,h,f)+o[N]+n[N]|0,v=d(r)+l(r,a,i)|0;y=f,f=h,h=c,c=s+w|0,s=i,i=a,a=r,r=w+v|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=f+this._g|0,this._h=y+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},7946:function(e){"use strict";e.exports=m},7417:function(e){"use strict";e.exports=u},3983:function(e){"use strict";e.exports=c},4711:function(e){"use strict";e.exports=r},5039:function(t){"use strict";t.exports=e},8236:function(e){"use strict";e.exports=p},5192:function(e){"use strict";e.exports=n},1986:function(e){"use strict";e.exports=d},3783:function(e){"use strict";e.exports=i},9408:function(e){"use strict";e.exports=t},3735:function(e){"use strict";e.exports=f},2716:function(e){"use strict";e.exports=h},3485:function(e){"use strict";e.exports=a},79:function(e){"use strict";e.exports=o},9882:function(e){"use strict";e.exports=l},7480:function(e){"use strict";e.exports=s},8079:function(e){"use strict";e.exports=y},7445:function(e,t,n){e.exports=n(3685)},2472:function(e,t,n){e.exports=n(6600)},8994:function(e,t,n){e.exports=n(9759)},24:function(e,t,n){e.exports=n(1384)}},N={};function w(e){var t=N[e];if(void 0!==t)return t.exports;var n=N[e]={exports:{}};return g[e](n,n.exports,w),n.exports}w.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return w.d(t,{a:t}),t},w.d=function(e,t){for(var n in t)w.o(t,n)&&!w.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},w.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};return function(){"use strict";w.r(v),w.d(v,{AE_AMOUNT_FORMATS:function(){return Me},AbiVersion:function(){return Lt},AccountBase:function(){return zc},AccountError:function(){return d},AccountGeneralized:function(){return wu},AccountLedger:function(){return Su},AccountLedgerFactory:function(){return xu},AeSdk:function(){return _c},AeSdkAepp:function(){return cu},AeSdkBase:function(){return Tc},AeSdkMethods:function(){return xc},AeSdkWallet:function(){return hu},AensError:function(){return p},AensPointerContextError:function(){return D},AeppError:function(){return m},AlreadyConnectedError:function(){return Ie},AmbiguousEventDefinitionError:function(){return de},ArgumentCountMismatchError:function(){return T},ArgumentError:function(){return b},BaseError:function(){return l},BrowserRuntimeConnection:function(){return sd},BrowserWindowMessageConnection:function(){return ad},BytecodeMismatchError:function(){return ee},CLIENT_TTL:function(){return Mt},CallReturnType:function(){return Ur},Channel:function(){return Jl},ChannelCallError:function(){return W},ChannelConnectionError:function(){return K},ChannelError:function(){return h},ChannelIncomingMessageError:function(){return J},ChannelPingTimedOutError:function(){return Q},CompilerBase:function(){return Tu},CompilerError:function(){return f},CompilerHttp:function(){return vl},ConsensusProtocolVersion:function(){return Vt},Contract:function(){return tc},ContractError:function(){return y},CryptographyError:function(){return g},DRY_RUN_ACCOUNT:function(){return $r},DecodeError:function(){return ve},DerivationError:function(){return qs},DryRunError:function(){return Se},DuplicateContractError:function(){return te},DuplicateNodeError:function(){return Ne},Encoding:function(){return tt},IllegalArgumentError:function(){return x},IllegalBidFeeError:function(){return be},InactiveContractError:function(){return ne},InsufficientBalanceError:function(){return _},InsufficientNameFeeError:function(){return F},InternalError:function(){return R},InvalidAensNameError:function(){return $},InvalidAuthDataError:function(){return Z},InvalidChecksumError:function(){return pe},InvalidMethodInvocationError:function(){return re},InvalidPasswordError:function(){return me},InvalidRpcMessageError:function(){return U},InvalidSignatureError:function(){return xe},InvalidTxError:function(){return Ho},InvalidTxParamsError:function(){return Te},MAX_AUTH_FUN_GAS:function(){return Et},MESSAGE_DIRECTION:function(){return Ac},METHODS:function(){return Ec},MIN_GAS_PRICE:function(){return Rt},MemoryAccount:function(){return gu},MerkleTreeHashMismatchError:function(){return he},MissingCallbackError:function(){return V},MissingContractAddressError:function(){return ae},MissingContractDefError:function(){return ie},MissingEventDefinitionError:function(){return le},MissingFunctionNameError:function(){return oe},MissingNodeInTreeError:function(){return fe},MissingParamError:function(){return z},NAME_BID_MAX_LENGTH:function(){return $t},NAME_BID_RANGES:function(){return Ut},NAME_BID_TIMEOUT_BLOCKS:function(){return Dt},NAME_FEE_BID_INCREMENT:function(){return jt},NAME_FEE_MULTIPLIER:function(){return Bt},NAME_MAX_CLIENT_TTL:function(){return Ot},NAME_MAX_LENGTH_FEE:function(){return Ft},NAME_MAX_TTL:function(){return kt},NAME_TTL:function(){return It},NoSerializerFoundError:function(){return A},NoSuchContractFunctionError:function(){return ce},NoWalletConnectedError:function(){return ke},Node:function(){return Bo},NodeError:function(){return N},NodeInvocationError:function(){return se},NodeNotFoundError:function(){return we},NotImplementedError:function(){return O},NotPayableFunctionError:function(){return ue},ORACLE_TTL:function(){return jr},ORACLE_TTL_TYPES:function(){return Mr},PayloadLengthError:function(){return Ce},PrefixNotFoundError:function(){return _e},QUERY_FEE:function(){return Br},QUERY_TTL:function(){return Dr},RESPONSE_TTL:function(){return Fr},RPC_STATUS:function(){return Ic},RequestTimedOutError:function(){return q},RpcBroadcastError:function(){return Rc},RpcConnectionDenyError:function(){return Dc},RpcConnectionError:function(){return Oe},RpcError:function(){return Oc},RpcInternalError:function(){return Uc},RpcInvalidTransactionError:function(){return Mc},RpcMethodNotFoundError:function(){return Vc},RpcNotAuthorizeError:function(){return Fc},RpcPermissionDenyError:function(){return $c},RpcRejectedByUserError:function(){return Bc},RpcUnsupportedProtocolError:function(){return jc},SUBSCRIPTION_TYPES:function(){return Pc},SchemaNotFoundError:function(){return ze},TX_SCHEMA:function(){return Vr},TX_TTL:function(){return Rr},Tag:function(){return Gt},TagNotFoundError:function(){return Ae},TransactionError:function(){return C},TxNotInChainError:function(){return qe},TxTimedOutError:function(){return P},TypeError:function(){return E},UnAuthorizedAccountError:function(){return H},UnavailableAccountError:function(){return j},UnexpectedChannelMessageError:function(){return Y},UnexpectedTsError:function(){return B},UnknownChannelStateError:function(){return X},UnknownNodeLengthError:function(){return ye},UnknownPathNibbleError:function(){return ge},UnknownRpcClientError:function(){return L},UnsubscribedAccountError:function(){return G},UnsupportedABIversionError:function(){return Pe},UnsupportedPlatformError:function(){return I},UnsupportedProtocolError:function(){return k},UnsupportedVMversionError:function(){return Ee},UnsupportedVersionError:function(){return M},VmVersion:function(){return Ht},WALLET_TYPE:function(){return qc},WalletError:function(){return S},_buildTx:function(){return vs},_getPollInterval:function(){return Vo},aensBid:function(){return Js},aensClaim:function(){return Qs},aensPreclaim:function(){return Ys},aensQuery:function(){return Ks},aensRevoke:function(){return Ls},aensTransfer:function(){return Ws},aensUpdate:function(){return Gs},awaitHeight:function(){return Wo},buildAuthTxHash:function(){return pc},buildContractId:function(){return un},buildContractIdByContractTx:function(){return Wr},buildTx:function(){return Hr},buildTxHash:function(){return Gr},commitmentHash:function(){return pn},computeAuctionEndBlock:function(){return vn},computeBidFee:function(){return wn},connectionProxy:function(){return Xl},createGeneralizedAccount:function(){return dc},decode:function(){return ht},deriveChild:function(){return Is},derivePathFromKey:function(){return ks},derivePathFromSeed:function(){return Ms},dump:function(){return ws},encode:function(){return ft},encodeContractAddress:function(){return St},encodeUnsigned:function(){return vt},extendOracleTtl:function(){return oc},formatAmount:function(){return Be},genSalt:function(){return wt},generateKeyPair:function(){return xt},generateKeyPairFromSecret:function(){return bt},generateSaveHDWalletFromSeed:function(){return js},getAccount:function(){return Yo},getAddressFromPriv:function(){return gt},getBalance:function(){return Jo},getContract:function(){return ss},getContractByteCode:function(){return os},getCurrentGeneration:function(){return Xo},getDefaultPointerKey:function(){return gn},getGeneration:function(){return Zo},getHdWalletAccountFromSeed:function(){return Fs},getHeight:function(){return Lo},getKeyBlock:function(){return ts},getKeyPair:function(){return Bs},getMasterKeyFromSeed:function(){return Os},getMicroBlockHeader:function(){return ns},getMicroBlockTransactions:function(){return es},getMinimumNameFee:function(){return Nn},getName:function(){return cs},getOracleObject:function(){return cc},getQueryObject:function(){return ac},getSaveHDWalletAccounts:function(){return Ds},hash:function(){return Ct},isAddressValid:function(){return Nt},isAuctionName:function(){return Cn},isNameValid:function(){return fn},isValidKeypair:function(){return Pt},messageToHash:function(){return zt},oracleQueryId:function(){return ln},payForTransaction:function(){return Hs},poll:function(){return Go},pollForQueries:function(){return nc},pollForQueryResponse:function(){return rc},postQueryToOracle:function(){return ic},produceNameId:function(){return dn},readInt:function(){return mn},recover:function(){return Ns},registerOracle:function(){return uc},resolveName:function(){return us},respondToQuery:function(){return sc},send:function(){return $s},sendTransaction:function(){return Qo},sign:function(){return Tt},signMessage:function(){return At},spend:function(){return Us},toAe:function(){return je},toAettos:function(){return De},toBytes:function(){return tn},transferFunds:function(){return Vs},txDryRun:function(){return is},unpackTx:function(){return Lr},verify:function(){return _t},verifyMessage:function(){return qt},verifyTransaction:function(){return Uo},waitForTxConfirm:function(){return Ko},walletDetector:function(){return id}});var e={};w.r(e),w.d(e,{Account:function(){return ya},ByteCode:function(){return Ia},Channel:function(){return ja},ChannelCloseMutualTx:function(){return ii},ChannelCloseSoloTx:function(){return oi},ChannelCreateTx:function(){return ti},ChannelDepositTx:function(){return ni},ChannelForceProgressTx:function(){return ai},ChannelSetDelegatesTx:function(){return li},ChannelSettleTx:function(){return ci},ChannelSlashTx:function(){return si},ChannelSnapshotSoloTx:function(){return ui},ChannelWithdrawTx:function(){return ri},CheckTxInPoolResponse:function(){return xi},CommitmentId:function(){return Za},ContractCallObject:function(){return Ta},ContractCallTx:function(){return Ni},ContractCreateTx:function(){return gi},ContractObject:function(){return Ea},CountResponse:function(){return ha},CreateContractUnsignedTx:function(){return Pi},Delegates:function(){return ua},DryRunAccount:function(){return wa},DryRunCallContext:function(){return Sa},DryRunCallReq:function(){return Ca},DryRunInput:function(){return Na},DryRunInputItem:function(){return va},DryRunResult:function(){return xa},DryRunResults:function(){return ba},EncodedTx:function(){return qa},ErrorModel:function(){return ta},Event:function(){return _a},GAAttachTx:function(){return Ci},GAMetaTx:function(){return Si},GAObject:function(){return Aa},Generation:function(){return fa},HashResponse:function(){return ra},Header:function(){return ea},HeightResponse:function(){return aa},KeyBlock:function(){return na},MicroBlockHeader:function(){return ia},NameClaimTx:function(){return Qa},NameEntry:function(){return Ba},NameHash:function(){return ei},NamePointer:function(){return ma},NamePreclaimTx:function(){return Ka},NameRevokeTx:function(){return Xa},NameTransferTx:function(){return Ja},NameUpdateTx:function(){return Ya},NextNonceResponse:function(){return ga},OffChainCallContract:function(){return qi},OffChainDeposit:function(){return zi},OffChainNewContract:function(){return Ai},OffChainTransfer:function(){return Ti},OffChainUpdate:function(){return la},OffChainWithdrawal:function(){return _i},OracleExtendTx:function(){return La},OracleQueries:function(){return Ma},OracleQuery:function(){return Ra},OracleQueryTx:function(){return Ga},OracleRegisterTx:function(){return Ha},OracleRespondTx:function(){return Wa},PayingForTx:function(){return bi},PeerConnections:function(){return Ua},PeerCount:function(){return hi},PeerCountAvailable:function(){return yi},PeerCountConnected:function(){return fi},PeerDetails:function(){return pi},PeerPubKey:function(){return Da},Peers:function(){return mi},PoI:function(){return ka},PostTxResponse:function(){return Pa},Protocol:function(){return $a},PubKey:function(){return di},RegisteredOracle:function(){return Oa},RelativeTTL:function(){return da},SignedTx:function(){return sa},SignedTxs:function(){return oa},SpendTx:function(){return Va},Status:function(){return Fa},TokenSupply:function(){return vi},Ttl:function(){return pa},Tx:function(){return ca},TxInfoObject:function(){return za},UnsignedTx:function(){return wi},discriminators:function(){return Ei}});var t={};w.r(t),w.d(t,{InvalidTxError:function(){return Ho},_getPollInterval:function(){return Vo},awaitHeight:function(){return Wo},getAccount:function(){return Yo},getBalance:function(){return Jo},getContract:function(){return ss},getContractByteCode:function(){return os},getCurrentGeneration:function(){return Xo},getGeneration:function(){return Zo},getHeight:function(){return Lo},getKeyBlock:function(){return ts},getMicroBlockHeader:function(){return ns},getMicroBlockTransactions:function(){return es},getName:function(){return cs},poll:function(){return Go},resolveName:function(){return us},sendTransaction:function(){return Qo},txDryRun:function(){return is},waitForTxConfirm:function(){return Ko}});var n={};w.r(n),w.d(n,{payForTransaction:function(){return Hs},send:function(){return $s},spend:function(){return Us},transferFunds:function(){return Vs}});var r={};w.r(r),w.d(r,{aensBid:function(){return Js},aensClaim:function(){return Qs},aensPreclaim:function(){return Ys},aensQuery:function(){return Ks},aensRevoke:function(){return Ls},aensTransfer:function(){return Ws},aensUpdate:function(){return Gs}});var a={};w.r(a),w.d(a,{extendOracleTtl:function(){return oc},getOracleObject:function(){return cc},getQueryObject:function(){return ac},pollForQueries:function(){return nc},pollForQueryResponse:function(){return rc},postQueryToOracle:function(){return ic},registerOracle:function(){return uc},respondToQuery:function(){return sc}});var i={};w.r(i),w.d(i,{buildAuthTxHash:function(){return pc},createGeneralizedAccount:function(){return dc}});var o={};w.r(o),w.d(o,{Aci:function(){return Au},ApiVersion:function(){return Lu},ByteCode:function(){return Eu},ByteCodeInput:function(){return $u},BytecodeCallResultInput:function(){return ku},Calldata:function(){return Ru},CompileOpts:function(){return zu},CompilerError:function(){return qu},CompilerVersion:function(){return Hu},Contract:function(){return _u},DecodeCalldataBytecode:function(){return Bu},DecodeCalldataSource:function(){return Fu},DecodedCalldata:function(){return ju},DecodedCallresult:function(){return Ou},ErrorModel:function(){return Du},ErrorPos:function(){return Pu},FateAssembler:function(){return Uu},FunctionCallInput:function(){return Mu},SophiaBinaryData:function(){return Gu},SophiaCallResultInput:function(){return Iu},SophiaJsonData:function(){return Wu},ValidateByteCodeInput:function(){return Vu}});var s=w(5192),c=w.n(s);const u=e=>e.integerValue(c().ROUND_CEIL);class l extends Error{constructor(e){super(e),this.name="BaseError"}}class d extends l{constructor(e){super(e),this.name="AccountError"}}class p extends l{constructor(e){super(e),this.name="AensError"}}class m extends l{constructor(e){super(e),this.name="AeppError"}}class h extends l{constructor(e){super(e),this.name="ChannelError"}}class f extends l{constructor(e){super(e),this.name="CompilerError"}}class y extends l{constructor(e){super(e),this.name="ContractError"}}class g extends l{constructor(e){super(e),this.name="CryptographyError"}}class N extends l{constructor(e){super(e),this.name="NodeError"}}class C extends l{constructor(e){super(e),this.name="TransactionError"}}class S extends l{constructor(e){super(e),this.name="WalletError"}}class b extends l{constructor(e,t,n){super(`${e} should be ${t}, got ${n} instead`),this.name="ArgumentError"}}class x extends g{constructor(e){super(e),this.name="IllegalArgumentError"}}class T extends l{constructor(e,t,n){super(`${e} expects ${t} arguments, got ${n} instead`),this.name="ArgumentCountMismatchError"}}class _ extends l{constructor(e){super(e),this.name="InsufficientBalanceError"}}class z extends l{constructor(e){super(e),this.name="MissingParamError"}}class A extends l{constructor(){super("Byte serialization not supported"),this.name="NoSerializerFoundError"}}class q extends l{constructor(e){super(`Giving up at height ${e}`),this.name="RequestTimedOutError"}}class P extends l{constructor(e,t){super([`Giving up after ${e} blocks mined`,`transaction hash: ${t}`].join(", ")),this.name="TxTimedOutError"}}class E extends l{constructor(e){super(e),this.name="TypeError"}}class I extends l{constructor(e){super(e),this.name="UnsupportedPlatformError"}}class k extends l{constructor(e){super(e),this.name="UnsupportedProtocolError"}}class O extends l{constructor(e){super(e),this.name="NotImplementedError"}}class M extends l{constructor(e,t,n,r){super(`Unsupported ${e} version ${t}. Supported: >= ${n} < ${r}`),this.name="UnsupportedVersionError"}}class R extends l{constructor(e){super(e),this.name="InternalError"}}class B extends R{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Expected to not happen, required for TS"),this.name="UnexpectedTsError"}}class j extends d{constructor(e){super(`Account for ${e} not available`),this.name="UnavailableAccountError"}}class D extends p{constructor(e,t){super(`Name ${e} don't have pointers for ${t}`),this.name="AensPointerContextError"}}class F extends p{constructor(e,t){super(`the provided fee ${e.toString()} is not enough to execute the claim, required: ${t.toString()}`),this.name="InsufficientNameFeeError"}}class $ extends p{constructor(e){super(e),this.name="InvalidAensNameError"}}class U extends m{constructor(e){super(`Received invalid message: ${e}`),this.name="InvalidRpcMessageError"}}class V extends m{constructor(e){super(`Can't find callback for this messageId ${e}`),this.name="MissingCallbackError"}}class H extends m{constructor(e){super(`You do not have access to account ${e}`),this.name="UnAuthorizedAccountError"}}class L extends m{constructor(e){super(`RpcClient with id ${e} do not exist`),this.name="UnknownRpcClientError"}}class G extends m{constructor(){super("You are not subscribed for an account."),this.name="UnsubscribedAccountError"}}class W extends h{constructor(e){super(e),this.name="ChannelCallError"}}class K extends h{constructor(e){super(e),this.name="ChannelConnectionError"}}class Q extends h{constructor(){super("Server pong timed out"),this.name="ChannelPingTimedOutError"}}class Y extends h{constructor(e){super(e),this.name="UnexpectedChannelMessageError"}}class J extends h{constructor(e,t){super(e.message),this.handlerError=e,this.incomingMessage=t,this.name="ChannelIncomingMessageError"}}class X extends h{constructor(){super("State Channels FSM entered unknown state"),this.name="UnknownChannelStateError"}}class Z extends f{constructor(e){super(e),this.name="InvalidAuthDataError"}}class ee extends y{constructor(e){super(`Contract ${e} do not correspond to the bytecode deployed on the chain`),this.name="BytecodeMismatchError"}}class te extends y{constructor(){super("Contract already deployed"),this.name="DuplicateContractError"}}class ne extends y{constructor(e){super(`Contract with address ${e} not active`),this.name="InactiveContractError"}}class re extends y{constructor(e){super(e),this.name="InvalidMethodInvocationError"}}class ae extends y{constructor(e){super(e),this.name="MissingContractAddressError"}}class ie extends y{constructor(){super("Either ACI or source code is required"),this.name="MissingContractDefError"}}class oe extends y{constructor(){super("Function name is required"),this.name="MissingFunctionNameError"}}class se extends y{constructor(e,t){super("Invocation failed"+(null==e?"":`: "${e}"`)),this.name="NodeInvocationError",this.transaction=t}}class ce extends y{constructor(e){super(`Function ${e} doesn't exist in contract`),this.name="NoSuchContractFunctionError"}}class ue extends y{constructor(e,t){super(`You try to pay "${e}" to function "${t}" which is not payable. Only payable function can accept coins`),this.name="NotPayableFunctionError"}}class le extends y{constructor(e,t){super(`Can't find definition of ${e} event emitted by ${t} (use omitUnknown option to ignore events like this)`),this.name="MissingEventDefinitionError"}}class de extends y{constructor(e,t){super(`Found multiple definitions of "${t[0][1]}" event with different types emitted by ${e} in ${t.map((e=>{let[t]=e;return`"${t}"`})).join(", ")} contracts (use contractAddressToName option to specify contract name corresponding to address)`),this.name="AmbiguousEventDefinitionError"}}class pe extends g{constructor(){super("Invalid checksum"),this.name="InvalidChecksumError"}}class me extends g{constructor(){super("Invalid password or nonce"),this.name="InvalidPasswordError"}}class he extends g{constructor(){super("Node hash is not equal to provided one"),this.name="MerkleTreeHashMismatchError"}}class fe extends g{constructor(e){super(e),this.name="MissingNodeInTreeError"}}class ye extends g{constructor(e){super(`Unknown node length: ${e}`),this.name="UnknownNodeLengthError"}}class ge extends g{constructor(e){super(`Unknown path nibble: ${e}`),this.name="UnknownPathNibbleError"}}class Ne extends N{constructor(e){super(`Node with name ${e} already exist`),this.name="DuplicateNodeError"}}class we extends N{constructor(e){super(e),this.name="NodeNotFoundError"}}class ve extends C{constructor(e){super(e),this.name="DecodeError"}}class Ce extends C{constructor(e){super(e),this.name="PayloadLengthError"}}class Se extends C{constructor(e){super(e),this.name="DryRunError"}}class be extends C{constructor(e){super(e),this.name="IllegalBidFeeError"}}class xe extends C{constructor(e){super(e),this.name="InvalidSignatureError"}}class Te extends C{constructor(e){super(e),this.name="InvalidTxParamsError"}}class _e extends C{constructor(e){super(`Prefix for id-tag ${e} not found.`),this.name="PrefixNotFoundError"}}class ze extends C{constructor(e,t,n){super(`Transaction ${e} not implemented for ${t} version ${n}`),this.name="SchemaNotFoundError"}}class Ae extends C{constructor(e){super(`Id tag for prefix ${e} not found.`),this.name="DecodeError"}}class qe extends C{constructor(e){super(`Transaction ${e} is removed from chain`),this.name="TxNotInChainError"}}class Pe extends C{constructor(e){super(e),this.name="UnsupportedABIversionError"}}class Ee extends C{constructor(e){super(e),this.name="UnsupportedVMversionError"}}class Ie extends S{constructor(e){super(e),this.name="AlreadyConnectedError"}}class ke extends S{constructor(e){super(e),this.name="NoWalletConnectedError"}}class Oe extends S{constructor(e){super(e),this.name="RpcConnectionError"}}let Me;!function(e){e.AE="ae",e.MILI_AE="miliAE",e.MICRO_AE="microAE",e.NANO_AE="nanoAE",e.PICO_AE="picoAE",e.FEMTO_AE="femtoAE",e.AETTOS="aettos"}(Me||(Me={}));const Re={[Me.AE]:0,[Me.MILI_AE]:-3,[Me.MICRO_AE]:-6,[Me.NANO_AE]:-9,[Me.PICO_AE]:-12,[Me.FEMTO_AE]:-15,[Me.AETTOS]:-18},Be=(e,t)=>{let{denomination:n=Me.AETTOS,targetDenomination:r=Me.AETTOS}=t;if("bigint"!=typeof(a=e)&&(!["number","object","string"].includes(typeof a)||isNaN(a)&&!Number.isInteger(a)&&!c().isBigNumber(a)))throw new b("value","a number",e);var a;return new(c())("bigint"==typeof e?e.toString():e).shiftedBy(Re[n]-Re[r]).toFixed()},je=function(e){let{denomination:t=Me.AETTOS}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be(e,{denomination:t,targetDenomination:Me.AE})},De=function(e){let{denomination:t=Me.AE}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be(e,{denomination:t})};var Fe=w(79),$e=w.n(Fe),Ue=w(8442),Ve=w(7480),He=w(5039),Le=w(9408).Buffer;const Ge=async e=>new Promise((t=>{setTimeout(t,e)})),We=(e,t)=>Object.fromEntries(Object.entries(e).map(t)),Ke=(()=>{try{return Le.concat([Uint8Array.from([])]),!1}catch(e){return!0}})()?(e,t)=>Le.concat(e.map((e=>Le.from(e))),t):Le.concat;function Qe(e,t){return e in t}function Ye(e,t){return t.includes(e)}function Je(e){return e instanceof He.RestError&&404===e.statusCode&&e.message.includes("Account not found")}var Xe=w(3783),Ze=w(7499),et=w.n(Ze);let tt;!function(e){e.KeyBlockHash="kh",e.MicroBlockHash="mh",e.BlockPofHash="bf",e.BlockTxHash="bx",e.BlockStateHash="bs",e.Channel="ch",e.ContractAddress="ct",e.ContractBytearray="cb",e.ContractStoreKey="ck",e.ContractStoreValue="cv",e.Transaction="tx",e.TxHash="th",e.OracleAddress="ok",e.OracleQuery="ov",e.OracleQueryId="oq",e.OracleResponse="or",e.AccountAddress="ak",e.Signature="sg",e.Commitment="cm",e.PeerPubkey="pp",e.Name="nm",e.State="st",e.Poi="pi",e.StateTrees="ss",e.CallStateTree="cs",e.Bytearray="ba"}(tt||(tt={}));var nt=w(9408).Buffer;function rt(e){return(new(et())).update(e).digest()}const at=[tt.ContractBytearray,tt.ContractStoreKey,tt.ContractStoreValue,tt.Transaction,tt.OracleQuery,tt.OracleResponse,tt.State,tt.Poi,tt.StateTrees,tt.CallStateTree,tt.Bytearray],it=[tt.KeyBlockHash,tt.MicroBlockHash,tt.BlockPofHash,tt.BlockTxHash,tt.BlockStateHash,tt.Channel,tt.ContractAddress,tt.TxHash,tt.OracleAddress,tt.OracleQueryId,tt.AccountAddress,tt.Signature,tt.Commitment,tt.PeerPubkey,tt.Name],ot={[tt.KeyBlockHash]:32,[tt.MicroBlockHash]:32,[tt.BlockPofHash]:32,[tt.BlockTxHash]:32,[tt.BlockStateHash]:32,[tt.Channel]:32,[tt.ContractAddress]:32,[tt.TxHash]:32,[tt.OracleAddress]:32,[tt.OracleQueryId]:32,[tt.AccountAddress]:32,[tt.Signature]:64,[tt.Commitment]:32,[tt.PeerPubkey]:32,[tt.State]:32};function st(e,t){if(!Qe(t,ot))return;const n=ot[t];if(null!=n&&e.length!==n)throw new Ce(`Payload should be ${n} bytes, got ${e.length} instead`)}const ct=e=>rt(rt(e)).slice(0,4),ut=e=>Ke([e,ct(e)]);function lt(e){const t=e.slice(0,-4);if(!ct(t).equals(e.slice(-4)))throw new pe;return t}const dt={encode:e=>ut(e).toString("base64"),decode:e=>lt(nt.from(e,"base64"))},pt={encode:e=>(0,Xe.encode)(ut(e)),decode:e=>lt(nt.from((0,Xe.decode)(e)))},mt=e=>{const t=at.find((t=>t===e));if(null!=t)return[t,dt];const n=it.find((t=>t===e));if(null!=n)return[n,pt];throw new b("prefix",`one of ${[...it,...at].join(", ")}`,e)};function ht(e){const[t,n,r]=e.split("_");if(null==n)throw new ve(`Encoded string missing payload: ${e}`);if(null!=r)throw new ve(`Encoded string have extra parts: ${e}`);const[a,i]=mt(t),o=i.decode(n);return st(o,a),o}function ft(e,t){const[,n]=mt(t);return st(e,t),`${t}_${n.encode(e)}`}var yt=w(9408).Buffer;function gt(e){const t="string"==typeof e?yt.from(e,"hex"):e;return ft($e().sign.keyPair.fromSecretKey(t).publicKey,tt.AccountAddress)}function Nt(e){arguments.length>1&&void 0!==arguments[1]||tt.AccountAddress;try{return ht(e),!0}catch(e){return!1}}function wt(){const[e]=new BigUint64Array($e().randomBytes(8).buffer);return Number(e%BigInt(Number.MAX_SAFE_INTEGER))}function vt(e){const t=yt.allocUnsafe(4);return t.writeUInt32BE(e),t.slice(t.findIndex((e=>0!==e)))}function Ct(e){return yt.from((0,Ue.blake2b)(e,void 0,32))}function St(e,t){const n=ht(e);return ft(Ct(Ke([n,vt(t)])),tt.ContractAddress)}function bt(e){return $e().sign.keyPair.fromSecretKey(e)}function xt(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=$e().sign.keyPair(),n=yt.from(t.publicKey),r=yt.from(t.secretKey);return e?{publicKey:n,secretKey:r}:{publicKey:ft(n,tt.AccountAddress),secretKey:r.toString("hex")}}function Tt(e,t){return $e().sign.detached(yt.from(e),yt.from(t))}function _t(e,t,n){return $e().sign.detached.verify(e,t,ht(n))}function zt(e){const t=yt.from("aeternity Signed Message:\n","utf8"),n=yt.from(e,"utf8");return Ct(Ke([(0,Ve.encode)(t.length),t,(0,Ve.encode)(n.length),n]))}function At(e,t){return Tt(zt(e),t)}function qt(e,t,n){return _t(zt(e),t,n)}function Pt(e,t){const n=yt.from("TheMessage");return _t(n,Tt(n,e),ft("string"==typeof t?yt.from(t,"hex"):t,tt.AccountAddress))}const Et=5e4,It=18e4,kt=36e3,Ot=84600,Mt=Ot,Rt=1e9,Bt=1e14,jt=.05,Dt=480,Ft=31,$t=12,Ut=We({31:3,30:5,29:8,28:13,27:21,26:34,25:55,24:89,23:144,22:233,21:377,20:610,19:987,18:1597,17:2584,16:4181,15:6765,14:10946,13:17711,12:28657,11:46368,10:75025,9:121393,8:196418,7:317811,6:514229,5:832040,4:1346269,3:2178309,2:3524578,1:5702887},(e=>{let[t,n]=e;return[t,new(c())(n).times(Bt)]}));let Vt,Ht,Lt,Gt;!function(e){e[e.Iris=5]="Iris"}(Vt||(Vt={})),function(e){e[e.NoVm=0]="NoVm",e[e.Sophia=1]="Sophia",e[e.SophiaImprovementsMinerva=3]="SophiaImprovementsMinerva",e[e.SophiaImprovementsFortuna=4]="SophiaImprovementsFortuna",e[e.Fate=5]="Fate",e[e.SophiaImprovementsLima=6]="SophiaImprovementsLima",e[e.Fate2=7]="Fate2"}(Ht||(Ht={})),function(e){e[e.NoAbi=0]="NoAbi",e[e.Sophia=1]="Sophia",e[e.Fate=3]="Fate"}(Lt||(Lt={})),function(e){e[e.Account=10]="Account",e[e.SignedTx=11]="SignedTx",e[e.SpendTx=12]="SpendTx",e[e.Oracle=20]="Oracle",e[e.OracleRegisterTx=22]="OracleRegisterTx",e[e.OracleQueryTx=23]="OracleQueryTx",e[e.OracleResponseTx=24]="OracleResponseTx",e[e.OracleExtendTx=25]="OracleExtendTx",e[e.Name=30]="Name",e[e.NameClaimTx=32]="NameClaimTx",e[e.NamePreclaimTx=33]="NamePreclaimTx",e[e.NameUpdateTx=34]="NameUpdateTx",e[e.NameRevokeTx=35]="NameRevokeTx",e[e.NameTransferTx=36]="NameTransferTx",e[e.Contract=40]="Contract",e[e.ContractCall=41]="ContractCall",e[e.ContractCreateTx=42]="ContractCreateTx",e[e.ContractCallTx=43]="ContractCallTx",e[e.ChannelCreateTx=50]="ChannelCreateTx",e[e.ChannelDepositTx=51]="ChannelDepositTx",e[e.ChannelWithdrawTx=52]="ChannelWithdrawTx",e[e.ChannelForceProgressTx=521]="ChannelForceProgressTx",e[e.ChannelCloseMutualTx=53]="ChannelCloseMutualTx",e[e.ChannelCloseSoloTx=54]="ChannelCloseSoloTx",e[e.ChannelSlashTx=55]="ChannelSlashTx",e[e.ChannelSettleTx=56]="ChannelSettleTx",e[e.ChannelOffChainTx=57]="ChannelOffChainTx",e[e.ChannelOffChainUpdateTransfer=570]="ChannelOffChainUpdateTransfer",e[e.ChannelOffChainUpdateDeposit=571]="ChannelOffChainUpdateDeposit",e[e.ChannelOffChainUpdateWithdraw=572]="ChannelOffChainUpdateWithdraw",e[e.ChannelOffChainUpdateCreateContract=573]="ChannelOffChainUpdateCreateContract",e[e.ChannelOffChainUpdateCallContract=574]="ChannelOffChainUpdateCallContract",e[e.ChannelClientReconnectTx=575]="ChannelClientReconnectTx",e[e.Channel=58]="Channel",e[e.ChannelSnapshotSoloTx=59]="ChannelSnapshotSoloTx",e[e.TreesPoi=60]="TreesPoi",e[e.StateTrees=62]="StateTrees",e[e.Mtree=63]="Mtree",e[e.MtreeValue=64]="MtreeValue",e[e.ContractsMtree=621]="ContractsMtree",e[e.CallsMtree=622]="CallsMtree",e[e.ChannelsMtree=623]="ChannelsMtree",e[e.NameserviceMtree=624]="NameserviceMtree",e[e.OraclesMtree=625]="OraclesMtree",e[e.AccountsMtree=626]="AccountsMtree",e[e.GaAttachTx=80]="GaAttachTx",e[e.GaMetaTx=81]="GaMetaTx",e[e.PayingForTx=82]="PayingForTx"}(Gt||(Gt={}));var Wt=w(9408).Buffer;const Kt={[Vt.Iris]:{"contract-create":{vmVersion:[Ht.Fate2],abiVersion:[Lt.Fate]},"contract-call":{vmVersion:[],abiVersion:[Lt.Fate,Lt.Sophia]},"oracle-call":{vmVersion:[],abiVersion:[Lt.NoAbi,Lt.Sophia]}}};function Qt(e,t){var n;const r=Kt[e][t];return{vmVersion:null!==(n=r.vmVersion[0])&&void 0!==n?n:Ht.Fate2,abiVersion:r.abiVersion[0]}}var Yt={serialize(e,t){var n;let{consensusProtocolVersion:r=Vt.Iris}=t;return null!==(n=e)&&void 0!==n||(e=Qt(r,"contract-create")),Wt.from([e.vmVersion,0,e.abiVersion])},deserialize(e){const[t,,n]=e;return{vmVersion:+t,abiVersion:+n}}},Jt=w(3485),Xt=w(9408).Buffer,Zt={serialize(e,t){let{tag:n,consensusProtocolVersion:r=Vt.Iris}=t;const a=null!=e?e:Qt(r,Gt.ContractCallTx===n||Gt.GaMetaTx===n?"contract-call":"oracle-call").abiVersion;return Xt.from([a])},deserialize(e){return e[0]}},en=w(9408).Buffer;function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e)return en.from([]);if(Number.isInteger(e)||c().isBigNumber(e)||t){if(c().isBigNumber(e)||(e=new(c())(e)),!e.isInteger())throw new E(`Unexpected not integer value: ${e.toFixed()}`);let t=e.toString(16);return t.length%2==1&&(t=`0${t}`),en.from(t,"hex")}if("string"==typeof e)return en.from(e);throw new A}var nn=w(9408).Buffer;const rn=[tt.AccountAddress,tt.Name,tt.Commitment,tt.OracleAddress,tt.ContractAddress,tt.Channel];function an(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{serialize(e){const n=e.slice(0,2);if(!Ye(n,rn))throw new Ae(n);if(!Ye(n,t))throw new b("Address encoding",t.join(", "),n);const r=rn.indexOf(n)+1;return nn.from([...tn(r),...ht(e)])},deserialize(e){const n=nn.from(e).readUIntBE(0,1),r=rn[n-1];if(null==r)throw new _e(n);if(!Ye(r,t))throw new b("Address encoding",t.join(", "),r);return ft(e.subarray(1),r)}}}var on=w(9408).Buffer,sn={serialize(e){return on.from([e?1:0])},deserialize(e){return 1===e[0]}},cn=w(9408).Buffer;function un(e,t){return ft(Ct(cn.from([...ht(e),...tn(t)])),tt.ContractAddress)}function ln(e,t,n){return ft(Ct(cn.from([...ht(e),...function(e){const t=tn(e,!0);return Ke([cn.alloc(32-t.length),t])}(t),...ht(n)])),tt.OracleQueryId)}function dn(e){return ft(Ct(e.toLowerCase()),tt.Name)}function pn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wt();return ft(Ct(Ke([cn.from(e.toLowerCase()),cn.from(t.toString(16).padStart(64,"0"),"hex")])),tt.Commitment)}function mn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cn.from([]);return new(c())(cn.from(e).toString("hex"),16).toString(10)}const hn=".chain";function fn(e){return e.endsWith(hn)}const yn=[[tt.AccountAddress,"account_pubkey"],[tt.OracleAddress,"oracle_pubkey"],[tt.ContractAddress,"contract_pubkey"],[tt.Channel,"channel"]];function gn(e){ht(e);const t=e.substring(0,2),n=yn.find((e=>{let[n]=e;return n===t}))?.[1];if(null!=n)return n;throw new b("identifier",`prefixed with one of ${yn.map((e=>{let[t]=e;return`${t}_`})).join(", ")}`,e)}function Nn(e){const t=e.length-hn.length;return Ut[Math.min(t,Ft)]}function wn(e){let{startFee:t,increment:n=jt}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number(n)!==n||n%1==0)throw new be(`Increment must be float. Current increment ${n}`);if(n<jt)throw new be(`minimum increment percentage is ${jt}`);return u(new(c())(null!=t?t:Nn(e)).times(new(c())(jt).plus(1)))}function vn(e,t){var n,r,a;const i=e.length-hn.length;return(null!==(n=null!==(r=null!==(a=i<=4?62*Dt:null)&&void 0!==a?a:i<=8?31*Dt:null)&&void 0!==r?r:i<=12?Dt:null)&&void 0!==n?n:0)+t}function Cn(e){return e.length<13+hn.length}var Sn={serialize(e){if(e<0)throw new b("value","greater or equal to 0",e);return tn(e,!0)},deserialize(e){return mn(e)}},bn={...Sn,serializeAettos(e){return null!=e?e:"0"},serialize(e,t){let{denomination:n,...r}=t;return Sn.serialize(this.serializeAettos(null!=e?Be(e,{denomination:n}):e,r))}},xn={...bn,serialize(e,t){var n;if(null!==(n=e)&&void 0!==n||(e=0),0!=+e)throw new x(`Contract deposit is not refundable, so it should be equal 0, got ${e.toString()} instead`);return bn.serialize(e,t)}},Tn=w(9408).Buffer,_n=w(9408).Buffer,zn=w(9408).Buffer;function An(e){const t={[Gt.OracleRegisterTx]:"oracleTtlValue",[Gt.OracleExtendTx]:"oracleTtlValue",[Gt.OracleQueryTx]:"queryTtlValue",[Gt.OracleResponseTx]:"responseTtlValue"},{tag:n}=e;return Qe(n,t)?e[t[n]]:1}function qn(e,t,n){const{length:r}=ht(e),a=t(e);return(e=>{var t;const n=null!==(t={[Gt.ChannelForceProgressTx]:30,[Gt.ChannelOffChainTx]:0,[Gt.ChannelOffChainUpdateCallContract]:0,[Gt.ChannelOffChainUpdateCreateContract]:0,[Gt.ChannelOffChainUpdateDeposit]:0,[Gt.ChannelOffChainUpdateWithdraw]:0,[Gt.ChannelOffChainUpdateTransfer]:0,[Gt.ContractCreateTx]:5,[Gt.ContractCallTx]:12,[Gt.GaAttachTx]:5,[Gt.GaMetaTx]:5,[Gt.PayingForTx]:.2}[e])&&void 0!==t?t:1;return new(c())(15e3*n)})(a.tag).plus(((e,t,n)=>{let{relativeTtl:r,innerTxSize:a}=n;switch(e){case Gt.OracleRegisterTx:case Gt.OracleExtendTx:case Gt.OracleQueryTx:case Gt.OracleResponseTx:return new(c())(t).times(20).plus(Math.ceil(32e3*r/Math.floor(175200)));case Gt.GaMetaTx:case Gt.PayingForTx:return new(c())(t).minus(a).times(20);default:return new(c())(t).times(20)}})(a.tag,r,{relativeTtl:An(a),innerTxSize:a.tag===Gt.GaMetaTx||a.tag===Gt.PayingForTx?ht(n(a.tx.encodedTx)).length:0})).times(Rt)}var Pn={...bn,serializeAettos(e,t){let{rebuildTx:n,unpackTx:r,buildTx:a,_computingMinFee:i,_pickBiggerFee:o}=t;if(null!=i)return i.toFixed();const s=function(e,t,n){let r,a=new(c())(0);do{r=a,a=qn(e(a),t,n)}while(!a.eq(r));return a}((e=>n({_computingMinFee:e})),r,a),u=new(c())(null!=e?e:s);if(s.gt(u)){if(!0===o)return s.toFixed();throw new x(`Fee ${u.toString()} must be bigger then ${s}`)}return u.toFixed()}},En={serialize(e){return Sn.serialize(e)},deserialize(e){return+Sn.deserialize(e)}},In={...En,serialize(e,t){let{tag:n,rebuildTx:r,unpackTx:a,buildTx:i,gasMax:o=6e6,_computingGasLimit:s}=t;if(null!=s)return En.serialize(s);const c=n===Gt.GaMetaTx?Et:function(e,t,n,r){return e-+qn(t(e),n,r).dividedBy(Rt)}(o,(e=>r({_computingGasLimit:e,_pickBiggerFee:!0})),a,i),u=null!=e?e:c;if(u>c)throw new x(`Gas limit ${u} must be less or equal to ${c}`);return En.serialize(u)}},kn={...bn,serializeAettos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt.toString();if(+e<Rt)throw new x(`Gas price ${e.toString()} must be bigger then ${Rt}`);return e}};function On(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Mn(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,On(e,t,"set"),n),n}function Rn(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,On(e,t,"get"))}var Bn,jn=w(9408).Buffer;function Dn(e,t){$n(e,t),t.add(e)}function Fn(e,t,n){$n(e,t),t.set(e,n)}function $n(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Un(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Vn(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}!function(e){e[e.Branch=0]="Branch",e[e.Extension=1]="Extension",e[e.Leaf=2]="Leaf"}(Bn||(Bn={}));var Hn=new WeakMap,Ln=new WeakMap,Gn=new WeakMap,Wn=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,Yn=new WeakSet,Jn=new WeakSet;class Xn{get isComplete(){return Rn(this,Ln)}constructor(e,t,n,r){if(Dn(this,Jn),Dn(this,Yn),Fn(this,Hn,{writable:!0,value:void 0}),Fn(this,Ln,{writable:!0,value:!0}),Fn(this,Gn,{writable:!0,value:void 0}),Fn(this,Wn,{writable:!0,value:void 0}),Fn(this,Kn,{writable:!0,value:void 0}),Fn(this,Qn,{writable:!0,value:void 0}),Mn(this,Wn,t),Mn(this,Kn,n),Mn(this,Qn,r),Mn(this,Hn,e[0].toString("hex")),Mn(this,Gn,Object.fromEntries(e[1].map((e=>[e[0].toString("hex"),e[1]])))),null!=Rn(this,Gn)[Rn(this,Hn)])Object.entries(Rn(this,Gn)).forEach((e=>{let[t,n]=e;if(Vn(Xn,Xn,Zn).call(Xn,n)!==t)throw new he;const{type:r}=Vn(Xn,Xn,er).call(Xn,n);switch(r){case Bn.Branch:n.slice(0,16).filter((e=>e.length)).forEach((e=>{null==Rn(this,Gn)[e.toString("hex")]&&Mn(this,Ln,!1)}));break;case Bn.Extension:if(null==Rn(this,Gn)[n[1].toString("hex")])throw new fe("Can't find a node by hash in extension node");break;case Bn.Leaf:break;default:throw new R(`Unknown MPTree node type: ${r}`)}}));else{if(0!==Object.keys(Rn(this,Gn)).length)throw new fe("Can't find a node by root hash");Mn(this,Ln,!1)}}isEqual(e){return Rn(this,Hn)===Rn(e,Hn)}serialize(){return[jn.from(Rn(this,Hn),"hex"),Object.entries(Rn(this,Gn)).map((e=>{let[t,n]=e;return[jn.from(t,"hex"),n]}))]}get(e){const t=Un(this,Yn,tr).call(this,ht(e).toString("hex"));return null==t?t:Rn(this,Qn).call(this,ft(t,tt.Transaction),Rn(this,Kn))}toObject(){return Object.fromEntries(Un(this,Jn,nr).call(this).filter((e=>{let[t]=e;return Rn(this,Wn)!==tt.ContractAddress||66!==t.length})).map((e=>{let[t,n]=e;return[ft(jn.from(t,"hex"),Rn(this,Wn)),Rn(this,Qn).call(this,ft(n,tt.Transaction),Rn(this,Kn))]})))}}function Zn(e){return jn.from(Ct((0,Jt.encode)(e))).toString("hex")}function er(e){switch(e.length){case 17:return{type:Bn.Branch,...0!==e[16].length&&{value:e[16]}};case 2:{const t=e[0][0]>>4;if(t>3)throw new ge(t);const n=t<=1?Bn.Extension:Bn.Leaf,r=[0,2].includes(t)?2:1;return{type:n,...n===Bn.Leaf&&{value:e[1]},path:e[0].toString("hex").slice(r)}}default:throw new ye(e.length)}}function tr(e){let t=Rn(this,Hn),n=e;for(;;){const e=Rn(this,Gn)[t];if(null==e){if(!this.isComplete)return;throw new R("Can't find node in complete tree")}const{type:r,value:a,path:i}=Vn(Xn,Xn,er).call(Xn,e);switch(r){case Bn.Branch:if(0===n.length)return a;t=e[+`0x${n[0]}`].toString("hex"),n=n.substring(1);break;case Bn.Extension:if(n.substring(0,i?.length)!==i)return;t=e[1].toString("hex"),n=n.substring(i.length);break;case Bn.Leaf:if(i!==n)return;return a;default:throw new R(`Unknown MPTree node type: ${r}`)}}}function nr(){const e=[],t=(n,r)=>{const a=Rn(this,Gn)[n];if(null==a){if(!this.isComplete)return;throw new R("Can't find node in complete tree")}const{type:i,value:o,path:s}=Vn(Xn,Xn,er).call(Xn,a);switch(i){case Bn.Branch:a.slice(0,16).map(((e,t)=>[e,t])).filter((e=>{let[t]=e;return t.length})).forEach((e=>{let[n,a]=e;return t(n.toString("hex"),r+a.toString(16))})),null!=o&&e.push([r,o]);break;case Bn.Extension:t(a[1].toString("hex"),r+s);break;case Bn.Leaf:if(null==o)throw new B;e.push([r+s,o]);break;default:throw new R(`Unknown MPTree node type: ${i}`)}};return t(Rn(this,Hn),""),e}var rr=w(9408).Buffer,ar={serialize(e){return rr.from(e)},deserialize(e){return e.toString()}},ir={serialize(e){return ar.serialize(e)},deserialize(e){return ar.deserialize(e)}},or={...bn,serializeAettos(e,t){const n=Nn(t.name),r=new(c())(null!=e?e:n);if(n.gt(r))throw new F(r,n);return r.toFixed()},serialize(e,t){return bn.serialize.call(this,e,t)}};const sr=an(tt.Name);var cr={...sr,serialize(e){return sr.serialize(fn(e)?dn(e):e)}};const ur=an(...rn);var lr={serialize(e){if(e.length>32)throw new x(`Expected 32 pointers or less, got ${e.length} instead`);return e.map((e=>[tn(e.key),ur.serialize(e.id)]))},deserialize(e){return e.map((e=>{let[t,n]=e;return{key:t.toString(),id:ur.deserialize(n)}}))}},dr=w(9408).Buffer;const pr=Zt,mr=an,hr=function(e){return{serialize(t,n){return t.map((t=>e.serialize(t,n)))},deserialize(t,n){return t.map((t=>e.deserialize(t,n)))}}},fr=sn,yr=bn,gr=Yt,Nr=xn,wr=function(e,t){return{serialize(e){if(null==e){if(!0===t)return Tn.from([]);throw new b("Encoded data","provided",e)}return ht(e)},deserialize(t){return ft(t,e)}}},vr=function(e){return{serialize(t,n){let{buildTx:r}=n;return ArrayBuffer.isView(t)?_n.from(t):ht(r({...t,...null!=e&&{tag:e}}))},deserialize(t,n){let{unpackTx:r}=n;const a=r(ft(t,tt.Transaction));if(null!=e&&a.tag!==e)throw new b("Tag",e,a.tag);return a}}},Cr=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return{serialize(e){if("number"!=typeof e)throw new b("value","to be a number",e);if(e>255)throw new b("value","to be less than 256",e);if(!Ye(e,t))throw new b("value","to be a value of Enum",e);return zn.from([e])},deserialize(e){if(1!==e.length)throw new b("buffer","to have single element",e.length);const n=e[0];if(!Ye(n,t))throw new b("value","to be a value of Enum",n);return n}}},Sr=Pn,br=In,xr=kn,Tr=function(e,t){return{serialize(e){return e.serialize()},deserialize(n,r){let{unpackTx:a}=r;return new Xn(n,e,t,a)}}},_r=ir,zr=or,Ar=cr,qr=lr,Pr={serialize(e){return dr.from(e)},deserialize(e){return e}},Er=En,Ir=function(e){return{serialize(t){if(null!=t&&t!==e)throw new b("ShortUIntConst",e,t);return En.serialize(e)},deserialize(t){const n=En.deserialize(t);if(n!==e)throw new b("ShortUIntConst",e,n);return e}}},kr={serialize(e){return tn(e)},deserialize(e){return e.toString()}},Or=Sn;let Mr;!function(e){e[e.delta=0]="delta",e[e.block=1]="block"}(Mr||(Mr={}));const Rr=0,Br=3e4,jr={type:Mr.delta,value:500},Dr={type:Mr.delta,value:10},Fr={type:Mr.delta,value:10},$r={pub:"ak_11111111111111111111111111111111273Yts",amount:100000000000000000000000000000000000n};let Ur;!function(e){e[e.Ok=0]="Ok",e[e.Error=1]="Error",e[e.Revert=2]="Revert"}(Ur||(Ur={}));const Vr={[Gt.Account]:{1:[["tag",Ir(Gt.Account)],["version",Ir(1)],["nonce",Er],["balance",Or]],2:[["tag",Ir(Gt.Account)],["version",Ir(2)],["flags",Or],["nonce",Er],["balance",Or],["gaContract",mr(tt.ContractAddress,tt.Name)],["gaAuthFun",wr(tt.ContractBytearray)]]},[Gt.SignedTx]:{1:[["tag",Ir(Gt.SignedTx)],["version",Ir(1)],["signatures",hr(Pr)],["encodedTx",vr()]]},[Gt.SpendTx]:{1:[["tag",Ir(Gt.SpendTx)],["version",Ir(1)],["senderId",mr(tt.AccountAddress)],["recipientId",mr(tt.AccountAddress,tt.Name)],["amount",yr],["fee",Sr],["ttl",Er],["nonce",Er],["payload",wr(tt.Bytearray,!0)]]},[Gt.Name]:{1:[["tag",Ir(Gt.Name)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nameTtl",Er],["status",Pr],["clientTtl",Er],["pointers",qr]]},[Gt.NamePreclaimTx]:{1:[["tag",Ir(Gt.NamePreclaimTx)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["commitmentId",mr(tt.Commitment)],["fee",Sr],["ttl",Er]]},[Gt.NameClaimTx]:{2:[["tag",Ir(Gt.NameClaimTx)],["version",Ir(2)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["name",_r],["nameSalt",Or],["nameFee",zr],["fee",Sr],["ttl",Er]]},[Gt.NameUpdateTx]:{1:[["tag",Ir(Gt.NameUpdateTx)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["nameId",Ar],["nameTtl",Er],["pointers",qr],["clientTtl",Er],["fee",Sr],["ttl",Er]]},[Gt.NameTransferTx]:{1:[["tag",Ir(Gt.NameTransferTx)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["nameId",Ar],["recipientId",mr(tt.AccountAddress,tt.Name)],["fee",Sr],["ttl",Er]]},[Gt.NameRevokeTx]:{1:[["tag",Ir(Gt.NameRevokeTx)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["nameId",Ar],["fee",Sr],["ttl",Er]]},[Gt.Contract]:{1:[["tag",Ir(Gt.Contract)],["version",Ir(1)],["owner",mr(tt.AccountAddress)],["ctVersion",gr],["code",wr(tt.ContractBytearray)],["log",wr(tt.ContractBytearray)],["active",fr],["referers",hr(mr(tt.AccountAddress))],["deposit",Nr]]},[Gt.ContractCreateTx]:{1:[["tag",Ir(Gt.ContractCreateTx)],["version",Ir(1)],["ownerId",mr(tt.AccountAddress)],["nonce",Er],["code",wr(tt.ContractBytearray)],["ctVersion",gr],["fee",Sr],["ttl",Er],["deposit",Nr],["amount",yr],["gasLimit",br],["gasPrice",xr],["callData",wr(tt.ContractBytearray)]]},[Gt.ContractCallTx]:{1:[["tag",Ir(Gt.ContractCallTx)],["version",Ir(1)],["callerId",mr(tt.AccountAddress)],["nonce",Er],["contractId",mr(tt.ContractAddress,tt.Name)],["abiVersion",pr],["fee",Sr],["ttl",Er],["amount",yr],["gasLimit",br],["gasPrice",xr],["callData",wr(tt.ContractBytearray)]]},[Gt.ContractCall]:{1:[["tag",Ir(Gt.ContractCall)],["version",Ir(1)],["callerId",mr(tt.AccountAddress)],["callerNonce",Er],["height",Er],["contractId",mr(tt.ContractAddress)],["gasPrice",xr],["gasUsed",Er],["returnValue",wr(tt.ContractBytearray)],["returnType",Cr(Ur)],["log",Pr]]},[Gt.Oracle]:{1:[["tag",Ir(Gt.Oracle)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["queryFormat",kr],["responseFormat",kr],["queryFee",yr],["oracleTtlValue",Er],["abiVersion",pr]]},[Gt.OracleRegisterTx]:{1:[["tag",Ir(Gt.OracleRegisterTx)],["version",Ir(1)],["accountId",mr(tt.AccountAddress)],["nonce",Er],["queryFormat",kr],["responseFormat",kr],["queryFee",yr],["oracleTtlType",Cr(Mr)],["oracleTtlValue",Er],["fee",Sr],["ttl",Er],["abiVersion",pr]]},[Gt.OracleExtendTx]:{1:[["tag",Ir(Gt.OracleExtendTx)],["version",Ir(1)],["oracleId",mr(tt.OracleAddress,tt.Name)],["nonce",Er],["oracleTtlType",Cr(Mr)],["oracleTtlValue",Er],["fee",Sr],["ttl",Er]]},[Gt.OracleQueryTx]:{1:[["tag",Ir(Gt.OracleQueryTx)],["version",Ir(1)],["senderId",mr(tt.AccountAddress)],["nonce",Er],["oracleId",mr(tt.OracleAddress,tt.Name)],["query",kr],["queryFee",yr],["queryTtlType",Cr(Mr)],["queryTtlValue",Er],["responseTtlType",Cr(Mr)],["responseTtlValue",Er],["fee",Sr],["ttl",Er]]},[Gt.OracleResponseTx]:{1:[["tag",Ir(Gt.OracleResponseTx)],["version",Ir(1)],["oracleId",mr(tt.OracleAddress)],["nonce",Er],["queryId",wr(tt.OracleQueryId)],["response",kr],["responseTtlType",Cr(Mr)],["responseTtlValue",Er],["fee",Sr],["ttl",Er]]},[Gt.ChannelCreateTx]:{2:[["tag",Ir(Gt.ChannelCreateTx)],["version",Ir(2)],["initiator",mr(tt.AccountAddress)],["initiatorAmount",Or],["responder",mr(tt.AccountAddress)],["responderAmount",Or],["channelReserve",Or],["lockPeriod",Or],["ttl",Er],["fee",Sr],["initiatorDelegateIds",hr(mr(...rn))],["responderDelegateIds",hr(mr(...rn))],["stateHash",wr(tt.State)],["nonce",Er]]},[Gt.ChannelCloseMutualTx]:{1:[["tag",Ir(Gt.ChannelCloseMutualTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["initiatorAmountFinal",Or],["responderAmountFinal",Or],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelCloseSoloTx]:{1:[["tag",Ir(Gt.ChannelCloseSoloTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["payload",wr(tt.Transaction)],["poi",vr(Gt.TreesPoi)],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelSlashTx]:{1:[["tag",Ir(Gt.ChannelSlashTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["payload",wr(tt.Transaction)],["poi",vr(Gt.TreesPoi)],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelDepositTx]:{1:[["tag",Ir(Gt.ChannelDepositTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["amount",Or],["ttl",Er],["fee",Sr],["stateHash",wr(tt.State)],["round",Er],["nonce",Er]]},[Gt.ChannelWithdrawTx]:{1:[["tag",Ir(Gt.ChannelWithdrawTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["toId",mr(tt.AccountAddress)],["amount",Or],["ttl",Er],["fee",Sr],["stateHash",wr(tt.State)],["round",Er],["nonce",Er]]},[Gt.ChannelSettleTx]:{1:[["tag",Ir(Gt.ChannelSettleTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["initiatorAmountFinal",Or],["responderAmountFinal",Or],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelForceProgressTx]:{1:[["tag",Ir(Gt.ChannelForceProgressTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["payload",wr(tt.Transaction)],["round",Er],["update",wr(tt.ContractBytearray)],["stateHash",wr(tt.State)],["offChainTrees",wr(tt.StateTrees)],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelOffChainTx]:{2:[["tag",Ir(Gt.ChannelOffChainTx)],["version",Ir(2)],["channelId",mr(tt.Channel)],["round",Er],["stateHash",wr(tt.State)]]},[Gt.Channel]:{3:[["tag",Ir(Gt.Channel)],["version",Ir(3)],["initiator",mr(tt.AccountAddress)],["responder",mr(tt.AccountAddress)],["channelAmount",Or],["initiatorAmount",Or],["responderAmount",Or],["channelReserve",Or],["initiatorDelegateIds",hr(mr(...rn))],["responderDelegateIds",hr(mr(...rn))],["stateHash",wr(tt.State)],["round",Er],["soloRound",Or],["lockPeriod",Or],["lockedUntil",Or],["initiatorAuth",wr(tt.ContractBytearray)],["responderAuth",wr(tt.ContractBytearray)]]},[Gt.ChannelSnapshotSoloTx]:{1:[["tag",Ir(Gt.ChannelSnapshotSoloTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["fromId",mr(tt.AccountAddress)],["payload",wr(tt.Transaction)],["ttl",Er],["fee",Sr],["nonce",Er]]},[Gt.ChannelOffChainUpdateTransfer]:{1:[["tag",Ir(Gt.ChannelOffChainUpdateTransfer)],["version",Ir(1)],["from",mr(tt.AccountAddress)],["to",mr(tt.AccountAddress)],["amount",Or]]},[Gt.ChannelOffChainUpdateDeposit]:{1:[["tag",Ir(Gt.ChannelOffChainUpdateDeposit)],["version",Ir(1)],["from",mr(tt.AccountAddress)],["amount",Or]]},[Gt.ChannelOffChainUpdateWithdraw]:{1:[["tag",Ir(Gt.ChannelOffChainUpdateWithdraw)],["version",Ir(1)],["from",mr(tt.AccountAddress)],["amount",Or]]},[Gt.ChannelOffChainUpdateCreateContract]:{1:[["tag",Ir(Gt.ChannelOffChainUpdateCreateContract)],["version",Ir(1)],["owner",mr(tt.AccountAddress)],["ctVersion",gr],["code",wr(tt.ContractBytearray)],["deposit",Or],["callData",wr(tt.ContractBytearray)]]},[Gt.ChannelOffChainUpdateCallContract]:{1:[["tag",Ir(Gt.ChannelOffChainUpdateCallContract)],["version",Ir(1)],["caller",mr(tt.AccountAddress)],["contract",mr(tt.ContractAddress)],["abiVersion",pr],["amount",Or],["callData",wr(tt.ContractBytearray)],["callStack",Pr],["gasPrice",xr],["gasLimit",br]]},[Gt.ChannelClientReconnectTx]:{1:[["tag",Ir(Gt.ChannelClientReconnectTx)],["version",Ir(1)],["channelId",mr(tt.Channel)],["round",Er],["role",kr],["pubkey",mr(tt.AccountAddress)]]},[Gt.TreesPoi]:{1:[["tag",Ir(Gt.TreesPoi)],["version",Ir(1)],["accounts",hr(Tr(tt.AccountAddress,Gt.Account))],["calls",hr(Tr(tt.Bytearray,Gt.ContractCall))],["channels",hr(Tr(tt.Channel,Gt.Channel))],["contracts",hr(Tr(tt.ContractAddress,Gt.Contract))],["ns",hr(Tr(tt.Name,Gt.Name))],["oracles",hr(Tr(tt.OracleAddress,Gt.Oracle))]]},[Gt.StateTrees]:{1:[["tag",Ir(Gt.StateTrees)],["version",Ir(1)],["contracts",vr()],["calls",vr()],["channels",vr()],["ns",vr()],["oracles",vr()],["accounts",vr()]]},[Gt.Mtree]:{1:[["tag",Ir(Gt.Mtree)],["version",Ir(1)],["values",hr(vr())]]},[Gt.MtreeValue]:{1:[["tag",Ir(Gt.MtreeValue)],["version",Ir(1)],["key",Pr],["value",Pr]]},[Gt.ContractsMtree]:{1:[["tag",Ir(Gt.ContractsMtree)],["version",Ir(1)],["contracts",vr()]]},[Gt.CallsMtree]:{1:[["tag",Ir(Gt.CallsMtree)],["version",Ir(1)],["calls",vr()]]},[Gt.ChannelsMtree]:{1:[["tag",Ir(Gt.ChannelsMtree)],["version",Ir(1)],["channels",vr()]]},[Gt.NameserviceMtree]:{1:[["tag",Ir(Gt.NameserviceMtree)],["version",Ir(1)],["mtree",vr()]]},[Gt.OraclesMtree]:{1:[["tag",Ir(Gt.OraclesMtree)],["version",Ir(1)],["otree",vr()]]},[Gt.AccountsMtree]:{1:[["tag",Ir(Gt.AccountsMtree)],["version",Ir(1)],["accounts",vr()]]},[Gt.GaAttachTx]:{1:[["tag",Ir(Gt.GaAttachTx)],["version",Ir(1)],["ownerId",mr(tt.AccountAddress)],["nonce",Er],["code",wr(tt.ContractBytearray)],["authFun",Pr],["ctVersion",gr],["fee",Sr],["ttl",Er],["gasLimit",br],["gasPrice",xr],["callData",wr(tt.ContractBytearray)]]},[Gt.GaMetaTx]:{2:[["tag",Ir(Gt.GaMetaTx)],["version",Ir(2)],["gaId",mr(tt.AccountAddress)],["authData",wr(tt.ContractBytearray)],["abiVersion",pr],["fee",Sr],["gasLimit",br],["gasPrice",xr],["tx",vr()]]},[Gt.PayingForTx]:{1:[["tag",Ir(Gt.PayingForTx)],["version",Ir(1)],["payerId",mr(tt.AccountAddress)],["nonce",Er],["fee",Sr],["tx",vr()]]}};function Hr(e){var t;let{prefix:n,denomination:r=Me.AETTOS}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=Vr[e.tag];if(null!==(t=e.version)&&void 0!==t||(e.version=Math.max(...Object.keys(a).map((e=>+e)))),!Qe(e.version,a))throw new ze("serialization",Gt[e.tag],e.version);const i=a[e.version],o=i.map((t=>{let[n,a]=t;return a.serialize(e[n],{...e,unpackTx:Lr,buildTx:Hr,denomination:r,rebuildTx:t=>Hr({...e,...t},{denomination:r})})}));return ft((0,Jt.encode)(o),null!=n?n:tt.Transaction)}function Lr(e,t){const n=(0,Jt.decode)(ht(e)),r=+mn(n[0]);if(!Qe(r,Vr))throw new ve(`Unknown transaction tag: ${r}`);if(null!=t&&t!==r)throw new ve(`Expected transaction to have ${Gt[t]} tag, got ${Gt[r]} instead`);const a=+mn(n[1]);if(!Qe(a,Vr[r]))throw new ze("deserialization",`tag ${r}`,a);return function(e,t){if(e.length!==t.length)throw new b("Transaction RLP length",t.length,e.length);return t.reduce(((t,n,r)=>{let[a,i]=n;return{...t,[a]:i.deserialize(e[r],{unpackTx:Lr})}}),{})}(n,Vr[r][a])}function Gr(e){return ft(Ct("string"==typeof e&&e.startsWith("tx_")?ht(e):e),tt.TxHash)}function Wr(e){const{tag:t,ownerId:n,nonce:r}=Lr(e);if(![Gt.ContractCreateTx,Gt.GaAttachTx].includes(t))throw new b("contractCreateTx","a contractCreateTx or gaAttach",t);return un(n,+r)}function Kr(e,t,n){const r=e=>e.split(/[-+]/)[0].split(".").map((e=>+e)),a=r(e),i=r(t),o=r(n),s=Math.max(...a,...i,...o)+1,c=e=>e.reverse().reduce(((e,t,n)=>e+t*s**n),0),u=c(a),l=c(i),d=c(o);return u>=l&&u<d}const Qr=()=>{const e=new Map;return{policy:{name:"request-queues",async sendRequest(t,n){var r;const a=t.headers.get("__queue");t.headers.delete("__queue");const i=async()=>n(t);if(null==a)return i();const o=(null!==(r=e.get(a))&&void 0!==r?r:Promise.resolve()).then(i,i);return e.set(a,o.then((async()=>Ge(750)))),o}},position:"perCall"}},Yr=()=>{const e=new Map;return{policy:{name:"combine-get-requests",async sendRequest(t,n){var r;if("GET"!==t.method)return n(t);const a=JSON.stringify([t.url,t.body]),i=null!==(r=e.get(a))&&void 0!==r?r:n(t);e.set(a,i);try{return await i}finally{e.delete(a)}}},position:"perCall"}},Jr=e=>({policy:{name:"error-formatter",async sendRequest(t,n){try{return await n(t)}catch(t){if(!(t instanceof He.RestError)||null==t.request)throw t;if(null==t.response?.bodyAsText)throw t;let n;try{n=JSON.parse(t.response.bodyAsText)}catch(e){throw t}t.message=`${new URL(t.request.url).pathname.slice(1)} error`;const r=e(n);throw""!==r&&(t.message+=`:${r}`),t}}},position:"perCall"}),Xr=(e,t,n,r,a)=>({name:"version-check",async sendRequest(i,o){if(new URL(i.url).pathname===t)return o(i);const s=[await n,r,a];if(!Kr(...s))throw new M(e,...s);return o(i)}});var Zr=w(4711);const ea={type:{name:"Composite",className:"Header",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",type:{name:"String"}},beneficiary:{serializedName:"beneficiary",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",type:{name:"String"}},pofHash:{serializedName:"pof_hash",type:{name:"String"}},txsHash:{serializedName:"txs_hash",type:{name:"String"}},signature:{serializedName:"signature",type:{name:"String"}}}}},ta={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},na={type:{name:"Composite",className:"KeyBlock",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",required:!0,type:{name:"String"}},beneficiary:{serializedName:"beneficiary",required:!0,type:{name:"String"}},target:{serializedName:"target",required:!0,type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",required:!0,type:{name:"String"}}}}},ra={type:{name:"Composite",className:"HashResponse",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}}}}},aa={type:{name:"Composite",className:"HeightResponse",modelProperties:{height:{serializedName:"height",required:!0,type:{name:"String"}}}}},ia={type:{name:"Composite",className:"MicroBlockHeader",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},pofHash:{serializedName:"pof_hash",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},txsHash:{serializedName:"txs_hash",required:!0,type:{name:"String"}},signature:{serializedName:"signature",required:!0,type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}}}}},oa={type:{name:"Composite",className:"SignedTxs",modelProperties:{transactions:{serializedName:"transactions",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedTx"}}}}}}},sa={type:{name:"Composite",className:"SignedTx",modelProperties:{tx:{serializedName:"tx",type:{name:"Composite",className:"Tx"}},blockHeight:{serializedName:"block_height",required:!0,type:{name:"String"}},blockHash:{serializedName:"block_hash",required:!0,type:{name:"String"}},hash:{serializedName:"hash",required:!0,type:{name:"String"}},signatures:{serializedName:"signatures",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ca={type:{name:"Composite",className:"Tx",uberParent:"Tx",polymorphicDiscriminator:{serializedName:"type",clientName:"type"},modelProperties:{recipientId:{serializedName:"recipient_id",type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",type:{name:"String"}},initiatorId:{serializedName:"initiator_id",type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",type:{name:"String"}},responderId:{serializedName:"responder_id",type:{name:"String"}},responderAmount:{serializedName:"responder_amount",type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",type:{name:"String"}},lockPeriod:{serializedName:"lock_period",type:{name:"String"}},stateHash:{serializedName:"state_hash",type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},channelId:{serializedName:"channel_id",type:{name:"String"}},fromId:{serializedName:"from_id",type:{name:"String"}},round:{serializedName:"round",type:{name:"String"}},toId:{serializedName:"to_id",type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",type:{name:"String"}},poi:{serializedName:"poi",type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},queryFormat:{serializedName:"query_format",type:{name:"String"}},responseFormat:{serializedName:"response_format",type:{name:"String"}},queryFee:{serializedName:"query_fee",type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},accountId:{serializedName:"account_id",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},oracleId:{serializedName:"oracle_id",type:{name:"String"}},query:{serializedName:"query",type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},queryId:{serializedName:"query_id",type:{name:"String"}},response:{serializedName:"response",type:{name:"String"}},commitmentId:{serializedName:"commitment_id",type:{name:"String"}},name:{serializedName:"name",type:{name:"String"}},nameSalt:{serializedName:"name_salt",type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},nameId:{serializedName:"name_id",type:{name:"String"}},nameTtl:{serializedName:"name_ttl",type:{name:"String"}},pointers:{serializedName:"pointers",type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",type:{name:"String"}},ownerId:{serializedName:"owner_id",type:{name:"String"}},code:{serializedName:"code",type:{name:"String"}},vmVersion:{serializedName:"vm_version",type:{name:"String"}},deposit:{serializedName:"deposit",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},gasPrice:{serializedName:"gas_price",type:{name:"String"}},callData:{serializedName:"call_data",type:{name:"String"}},callerId:{serializedName:"caller_id",type:{name:"String"}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",type:{name:"String"}},gaId:{serializedName:"ga_id",type:{name:"String"}},authData:{serializedName:"auth_data",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}},payerId:{serializedName:"payer_id",type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["SpendTx","ChannelCreateTx","ChannelDepositTx","ChannelWithdrawTx","ChannelForceProgressTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelSettleTx","ChannelSnapshotSoloTx","ChannelSetDelegatesTx","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleRespondTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","ContractCreateTx","ContractCallTx","GAAttachTx","GAMetaTx","PayingForTx"]}}}}},ua={type:{name:"Composite",className:"Delegates",modelProperties:{initiator:{serializedName:"initiator",type:{name:"Sequence",element:{type:{name:"String"}}}},responder:{serializedName:"responder",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},la={type:{name:"Composite",className:"OffChainUpdate",uberParent:"OffChainUpdate",polymorphicDiscriminator:{serializedName:"op",clientName:"op"},modelProperties:{op:{serializedName:"op",required:!0,type:{name:"String"}}}}},da={type:{name:"Composite",className:"RelativeTTL",modelProperties:{type:{defaultValue:"delta",isConstant:!0,serializedName:"type",type:{name:"String"}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},pa={type:{name:"Composite",className:"Ttl",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["delta","block"]}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},ma={type:{name:"Composite",className:"NamePointer",modelProperties:{key:{serializedName:"key",required:!0,type:{name:"String"}},id:{serializedName:"id",required:!0,type:{name:"String"}}}}},ha={type:{name:"Composite",className:"CountResponse",modelProperties:{count:{serializedName:"count",required:!0,type:{name:"String"}}}}},fa={type:{name:"Composite",className:"Generation",modelProperties:{keyBlock:{serializedName:"key_block",type:{name:"Composite",className:"KeyBlock"}},microBlocks:{serializedName:"micro_blocks",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ya={type:{name:"Composite",className:"Account",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},balance:{serializedName:"balance",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},payable:{serializedName:"payable",type:{name:"Boolean"}},kind:{serializedName:"kind",type:{name:"Enum",allowedValues:["basic","generalized"]}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{serializedName:"auth_fun",type:{name:"String"}}}}},ga={type:{name:"Composite",className:"NextNonceResponse",modelProperties:{nextNonce:{serializedName:"next_nonce",required:!0,type:{name:"String"}}}}},Na={type:{name:"Composite",className:"DryRunInput",modelProperties:{top:{serializedName:"top",type:{name:"String"}},accounts:{serializedName:"accounts",type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunAccount"}}}},txs:{serializedName:"txs",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunInputItem"}}}},txEvents:{defaultValue:!1,serializedName:"tx_events",type:{name:"Boolean"}}}}},wa={type:{name:"Composite",className:"DryRunAccount",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},va={type:{name:"Composite",className:"DryRunInputItem",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},callReq:{serializedName:"call_req",type:{name:"Composite",className:"DryRunCallReq"}}}}},Ca={type:{name:"Composite",className:"DryRunCallReq",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},caller:{serializedName:"caller",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},context:{serializedName:"context",type:{name:"Composite",className:"DryRunCallContext"}}}}},Sa={type:{name:"Composite",className:"DryRunCallContext",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},txHash:{serializedName:"tx_hash",type:{name:"String"}},stateful:{serializedName:"stateful",type:{name:"Boolean"}}}}},ba={type:{name:"Composite",className:"DryRunResults",modelProperties:{results:{serializedName:"results",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunResult"}}}},txEvents:{serializedName:"tx_events",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},xa={type:{name:"Composite",className:"DryRunResult",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"String"}},reason:{serializedName:"reason",type:{name:"String"}},callObj:{serializedName:"call_obj",type:{name:"Composite",className:"ContractCallObject"}}}}},Ta={type:{name:"Composite",className:"ContractCallObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},callerNonce:{serializedName:"caller_nonce",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},log:{serializedName:"log",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Event"}}}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error","revert"]}}}}},_a={type:{name:"Composite",className:"Event",modelProperties:{address:{serializedName:"address",required:!0,type:{name:"String"}},topics:{serializedName:"topics",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},za={type:{name:"Composite",className:"TxInfoObject",modelProperties:{callInfo:{serializedName:"call_info",type:{name:"Composite",className:"ContractCallObject"}},gaInfo:{serializedName:"ga_info",type:{name:"Composite",className:"GAObject"}},txInfo:{serializedName:"tx_info",type:{name:"String"}}}}},Aa={type:{name:"Composite",className:"GAObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error"]}},innerObject:{serializedName:"inner_object",type:{name:"Composite",className:"TxInfoObject"}}}}},qa={type:{name:"Composite",className:"EncodedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},Pa={type:{name:"Composite",className:"PostTxResponse",modelProperties:{txHash:{serializedName:"tx_hash",required:!0,type:{name:"String"}}}}},Ea={type:{name:"Composite",className:"ContractObject",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},active:{serializedName:"active",required:!0,type:{name:"Boolean"}},referrerIds:{serializedName:"referrer_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}}}}},Ia={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},ka={type:{name:"Composite",className:"PoI",modelProperties:{poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Oa={type:{name:"Composite",className:"RegisteredOracle",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}}}}},Ma={type:{name:"Composite",className:"OracleQueries",modelProperties:{oracleQueries:{serializedName:"oracle_queries",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"OracleQuery"}}}}}}},Ra={type:{name:"Composite",className:"OracleQuery",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},senderNonce:{serializedName:"sender_nonce",required:!0,type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"Ttl"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}}}}},Ba={type:{name:"Composite",className:"NameEntry",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},owner:{serializedName:"owner",type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}}}}},ja={type:{name:"Composite",className:"Channel",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},channelAmount:{serializedName:"channel_amount",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},soloRound:{serializedName:"solo_round",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},lockedUntil:{serializedName:"locked_until",required:!0,type:{name:"String"}}}}},Da={type:{name:"Composite",className:"PeerPubKey",modelProperties:{pubkey:{serializedName:"pubkey",required:!0,type:{name:"String"}}}}},Fa={type:{name:"Composite",className:"Status",modelProperties:{genesisKeyBlockHash:{serializedName:"genesis_key_block_hash",required:!0,type:{name:"String"}},solutions:{serializedName:"solutions",required:!0,type:{name:"String"}},difficulty:{serializedName:"difficulty",required:!0,type:{name:"String"}},syncing:{serializedName:"syncing",required:!0,type:{name:"Boolean"}},syncProgress:{constraints:{InclusiveMaximum:100,InclusiveMinimum:0},serializedName:"sync_progress",type:{name:"Number"}},listening:{serializedName:"listening",required:!0,type:{name:"Boolean"}},protocols:{serializedName:"protocols",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Protocol"}}}},nodeVersion:{serializedName:"node_version",required:!0,type:{name:"String"}},nodeRevision:{serializedName:"node_revision",required:!0,type:{name:"String"}},peerCount:{serializedName:"peer_count",required:!0,type:{name:"String"}},peerConnections:{serializedName:"peer_connections",type:{name:"Composite",className:"PeerConnections"}},pendingTransactionsCount:{serializedName:"pending_transactions_count",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",required:!0,type:{name:"String"}},peerPubkey:{serializedName:"peer_pubkey",required:!0,type:{name:"String"}},topKeyBlockHash:{serializedName:"top_key_block_hash",required:!0,type:{name:"String"}},topBlockHeight:{serializedName:"top_block_height",required:!0,type:{name:"String"}}}}},$a={type:{name:"Composite",className:"Protocol",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}},effectiveAtHeight:{serializedName:"effective_at_height",required:!0,type:{name:"String"}}}}},Ua={type:{name:"Composite",className:"PeerConnections",modelProperties:{inbound:{serializedName:"inbound",required:!0,type:{name:"String"}},outbound:{serializedName:"outbound",required:!0,type:{name:"String"}}}}},Va={type:{name:"Composite",className:"SpendTx",modelProperties:{recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}}}}},Ha={type:{name:"Composite",className:"OracleRegisterTx",modelProperties:{queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"Ttl"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}}}}},La={type:{name:"Composite",className:"OracleExtendTx",modelProperties:{fee:{serializedName:"fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}}}}},Ga={type:{name:"Composite",className:"OracleQueryTx",modelProperties:{oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Wa={type:{name:"Composite",className:"OracleRespondTx",modelProperties:{queryId:{serializedName:"query_id",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ka={type:{name:"Composite",className:"NamePreclaimTx",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Qa={type:{name:"Composite",className:"NameClaimTx",modelProperties:{name:{serializedName:"name",required:!0,type:{name:"String"}},nameSalt:{serializedName:"name_salt",required:!0,type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ya={type:{name:"Composite",className:"NameUpdateTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},nameTtl:{serializedName:"name_ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ja={type:{name:"Composite",className:"NameTransferTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Xa={type:{name:"Composite",className:"NameRevokeTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Za={type:{name:"Composite",className:"CommitmentId",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}}}}},ei={type:{name:"Composite",className:"NameHash",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}}}}},ti={type:{name:"Composite",className:"ChannelCreateTx",modelProperties:{initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}}}}},ni={type:{name:"Composite",className:"ChannelDepositTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},ri={type:{name:"Composite",className:"ChannelWithdrawTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},toId:{serializedName:"to_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},ai={type:{name:"Composite",className:"ChannelForceProgressTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}}}}},ii={type:{name:"Composite",className:"ChannelCloseMutualTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},oi={type:{name:"Composite",className:"ChannelCloseSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},si={type:{name:"Composite",className:"ChannelSlashTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},ci={type:{name:"Composite",className:"ChannelSettleTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},ui={type:{name:"Composite",className:"ChannelSnapshotSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},li={type:{name:"Composite",className:"ChannelSetDelegatesTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},di={type:{name:"Composite",className:"PubKey",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}}}}},pi={type:{name:"Composite",className:"PeerDetails",modelProperties:{host:{serializedName:"host",required:!0,type:{name:"String"}},port:{serializedName:"port",required:!0,type:{name:"String"}},firstSeen:{serializedName:"first_seen",required:!0,type:{name:"String"}},lastSeen:{serializedName:"last_seen",required:!0,type:{name:"String"}},genesisHash:{serializedName:"genesis_hash",required:!0,type:{name:"String"}},topHash:{serializedName:"top_hash",required:!0,type:{name:"String"}},topDifficulty:{serializedName:"top_difficulty",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",type:{name:"String"}},nodeVersion:{serializedName:"node_version",type:{name:"String"}},nodeRevision:{serializedName:"node_revision",type:{name:"String"}},nodeVendor:{serializedName:"node_vendor",type:{name:"String"}},nodeOs:{serializedName:"node_os",type:{name:"String"}}}}},mi={type:{name:"Composite",className:"Peers",modelProperties:{peers:{serializedName:"peers",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},blocked:{serializedName:"blocked",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},hi={type:{name:"Composite",className:"PeerCount",modelProperties:{connected:{serializedName:"connected",type:{name:"Composite",className:"PeerCountConnected"}},available:{serializedName:"available",type:{name:"Composite",className:"PeerCountAvailable"}},blocked:{serializedName:"blocked",required:!0,type:{name:"String"}}}}},fi={type:{name:"Composite",className:"PeerCountConnected",modelProperties:{inbound:{serializedName:"inbound",type:{name:"String"}},outbound:{serializedName:"outbound",type:{name:"String"}}}}},yi={type:{name:"Composite",className:"PeerCountAvailable",modelProperties:{verified:{serializedName:"verified",type:{name:"String"}},unverified:{serializedName:"unverified",type:{name:"String"}}}}},gi={type:{name:"Composite",className:"ContractCreateTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Ni={type:{name:"Composite",className:"ContractCallTx",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},wi={type:{name:"Composite",className:"UnsignedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},vi={type:{name:"Composite",className:"TokenSupply",modelProperties:{accounts:{serializedName:"accounts",type:{name:"String"}},contracts:{serializedName:"contracts",type:{name:"String"}},contractOracles:{serializedName:"contract_oracles",type:{name:"String"}},locked:{serializedName:"locked",type:{name:"String"}},oracles:{serializedName:"oracles",type:{name:"String"}},oracleQueries:{serializedName:"oracle_queries",type:{name:"String"}},pendingRewards:{serializedName:"pending_rewards",type:{name:"String"}},total:{serializedName:"total",type:{name:"String"}}}}},Ci={type:{name:"Composite",className:"GAAttachTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",required:!0,type:{name:"String"}}}}},Si={type:{name:"Composite",className:"GAMetaTx",modelProperties:{gaId:{serializedName:"ga_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},authData:{serializedName:"auth_data",required:!0,type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},bi={type:{name:"Composite",className:"PayingForTx",modelProperties:{payerId:{serializedName:"payer_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},xi={type:{name:"Composite",className:"CheckTxInPoolResponse",modelProperties:{status:{serializedName:"status",required:!0,type:{name:"String"}}}}},Ti={serializedName:"OffChainTransfer",type:{name:"Composite",className:"OffChainTransfer",uberParent:"OffChainUpdate",polymorphicDiscriminator:la.type.polymorphicDiscriminator,modelProperties:{...la.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},_i={serializedName:"OffChainWithdrawal",type:{name:"Composite",className:"OffChainWithdrawal",uberParent:"OffChainUpdate",polymorphicDiscriminator:la.type.polymorphicDiscriminator,modelProperties:{...la.type.modelProperties,to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},zi={serializedName:"OffChainDeposit",type:{name:"Composite",className:"OffChainDeposit",uberParent:"OffChainUpdate",polymorphicDiscriminator:la.type.polymorphicDiscriminator,modelProperties:{...la.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Ai={serializedName:"OffChainNewContract",type:{name:"Composite",className:"OffChainNewContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:la.type.polymorphicDiscriminator,modelProperties:{...la.type.modelProperties,owner:{serializedName:"owner",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},code:{serializedName:"code",type:{name:"Composite",className:"ByteCode"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},qi={serializedName:"OffChainCallContract",type:{name:"Composite",className:"OffChainCallContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:la.type.polymorphicDiscriminator,modelProperties:{...la.type.modelProperties,caller:{serializedName:"caller",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Pi={type:{name:"Composite",className:"CreateContractUnsignedTx",modelProperties:{...wi.type.modelProperties,contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}}}}};let Ei={"Tx.undefined":ca,OffChainUpdate:la,"OffChainUpdate.OffChainTransfer":Ti,"OffChainUpdate.OffChainWithdrawal":_i,"OffChainUpdate.OffChainDeposit":zi,"OffChainUpdate.OffChainNewContract":Ai,"OffChainUpdate.OffChainCallContract":qi};const Ii={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},ki={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},Oi={parameterPath:"intAsString",mapper:{defaultValue:!1,serializedName:"int-as-string",type:{name:"Boolean"}}},Mi={parameterPath:"hash",mapper:{serializedName:"hash",required:!0,type:{name:"String"}}},Ri={parameterPath:"height",mapper:{constraints:{InclusiveMaximum:0x10000000000000000,InclusiveMinimum:0},serializedName:"height",required:!0,type:{name:"Number"}}},Bi={parameterPath:"pubkey",mapper:{serializedName:"pubkey",required:!0,type:{name:"String"}}},ji={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},Di={parameterPath:"body",mapper:Na},Fi={parameterPath:"body",mapper:qa};class $i extends Zr.ServiceClient{constructor(e,t){var n,r;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-node/1.0.0-beta.1",i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`,o={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:i},baseUri:null!==(n=null!==(r=t.endpoint)&&void 0!==r?r:t.baseUri)&&void 0!==n?n:"{$host}"};super(o),t?.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===He.bearerTokenAuthenticationPolicyName))||(this.pipeline.removePolicy({name:He.bearerTokenAuthenticationPolicyName}),this.pipeline.addPolicy(He.bearerTokenAuthenticationPolicy({scopes:`${o.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Zr.authorizeRequestOnClaimChallenge}})))),this.$host=e}getTopHeader(e){return this.sendOperationRequest({options:e},Vi)}getCurrentKeyBlock(e){return this.sendOperationRequest({options:e},Hi)}getCurrentKeyBlockHash(e){return this.sendOperationRequest({options:e},Li)}getCurrentKeyBlockHeight(e){return this.sendOperationRequest({options:e},Gi)}getPendingKeyBlock(e){return this.sendOperationRequest({options:e},Wi)}getKeyBlockByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Ki)}getKeyBlockByHeight(e,t){return this.sendOperationRequest({height:e,options:t},Qi)}getMicroBlockHeaderByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Yi)}getMicroBlockTransactionsByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Ji)}getMicroBlockTransactionByHashAndIndex(e,t,n){return this.sendOperationRequest({hash:e,index:t,options:n},Xi)}getMicroBlockTransactionsCountByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Zi)}getCurrentGeneration(e){return this.sendOperationRequest({options:e},eo)}getGenerationByHash(e,t){return this.sendOperationRequest({hash:e,options:t},to)}getGenerationByHeight(e,t){return this.sendOperationRequest({height:e,options:t},no)}getAccountByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},ro)}getAccountByPubkeyAndHeight(e,t,n){return this.sendOperationRequest({pubkey:e,height:t,options:n},ao)}getAccountByPubkeyAndHash(e,t,n){return this.sendOperationRequest({pubkey:e,hash:t,options:n},io)}getPendingAccountTransactionsByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},oo)}getAccountNextNonce(e,t){return this.sendOperationRequest({pubkey:e,options:t},so)}protectedDryRunTxs(e,t){return this.sendOperationRequest({body:e,options:t},co)}getTransactionByHash(e,t){return this.sendOperationRequest({hash:e,options:t},uo)}getTransactionInfoByHash(e,t){return this.sendOperationRequest({hash:e,options:t},lo)}postTransaction(e,t){return this.sendOperationRequest({body:e,options:t},po)}getContract(e,t){return this.sendOperationRequest({pubkey:e,options:t},mo)}getContractCode(e,t){return this.sendOperationRequest({pubkey:e,options:t},ho)}getContractPoI(e,t){return this.sendOperationRequest({pubkey:e,options:t},fo)}getOracleByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},yo)}getOracleQueriesByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},go)}getOracleQueryByPubkeyAndQueryId(e,t,n){return this.sendOperationRequest({pubkey:e,queryId:t,options:n},No)}getNameEntryByName(e,t){return this.sendOperationRequest({name:e,options:t},wo)}getChannelByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},vo)}getPeerPubkey(e){return this.sendOperationRequest({options:e},Co)}getStatus(e){return this.sendOperationRequest({options:e},So)}getChainEnds(e){return this.sendOperationRequest({options:e},bo)}}const Ui=Zr.createSerializer(e,!1),Vi={path:"/v3/headers/top",httpMethod:"GET",responses:{200:{bodyMapper:ea},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},Hi={path:"/v3/key-blocks/current",httpMethod:"GET",responses:{200:{bodyMapper:na},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},Li={path:"/v3/key-blocks/current/hash",httpMethod:"GET",responses:{200:{bodyMapper:ra},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},Gi={path:"/v3/key-blocks/current/height",httpMethod:"GET",responses:{200:{bodyMapper:aa},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},Wi={path:"/v3/key-blocks/pending",httpMethod:"GET",responses:{200:{bodyMapper:na},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},Ki={path:"/v3/key-blocks/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:na},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},Qi={path:"/v3/key-blocks/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:na},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Ri],headerParameters:[Ii],serializer:Ui},Yi={path:"/v3/micro-blocks/hash/{hash}/header",httpMethod:"GET",responses:{200:{bodyMapper:ia},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},Ji={path:"/v3/micro-blocks/hash/{hash}/transactions",httpMethod:"GET",responses:{200:{bodyMapper:oa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},Xi={path:"/v3/micro-blocks/hash/{hash}/transactions/index/{index}",httpMethod:"GET",responses:{200:{bodyMapper:sa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi,{parameterPath:"index",mapper:{constraints:{InclusiveMinimum:1},serializedName:"index",required:!0,type:{name:"Number"}}}],headerParameters:[Ii],serializer:Ui},Zi={path:"/v3/micro-blocks/hash/{hash}/transactions/count",httpMethod:"GET",responses:{200:{bodyMapper:ha},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},eo={path:"/v3/generations/current",httpMethod:"GET",responses:{200:{bodyMapper:fa},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},to={path:"/v3/generations/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:fa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},no={path:"/v3/generations/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:fa},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Ri],headerParameters:[Ii],serializer:Ui},ro={path:"/v3/accounts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:ya},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},ao={path:"/v3/accounts/{pubkey}/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:ya},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Ri,Bi],headerParameters:[Ii],serializer:Ui},io={path:"/v3/accounts/{pubkey}/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:ya},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi,Bi],headerParameters:[Ii],serializer:Ui},oo={path:"/v3/accounts/{pubkey}/transactions/pending",httpMethod:"GET",responses:{200:{bodyMapper:oa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},so={path:"/v3/accounts/{pubkey}/next-nonce",httpMethod:"GET",responses:{200:{bodyMapper:ga},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi,{parameterPath:["options","strategy"],mapper:{defaultValue:"max",serializedName:"strategy",type:{name:"Enum",allowedValues:["max","continuity"]}}}],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},co={path:"/v3/dry-run",httpMethod:"POST",responses:{200:{bodyMapper:ba},403:{bodyMapper:ta,isError:!0}},requestBody:Di,queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii,ji],mediaType:"json",serializer:Ui},uo={path:"/v3/transactions/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:sa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},lo={path:"/v3/transactions/{hash}/info",httpMethod:"GET",responses:{200:{bodyMapper:za},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Mi],headerParameters:[Ii],serializer:Ui},po={path:"/v3/transactions",httpMethod:"POST",responses:{200:{bodyMapper:Pa},400:{bodyMapper:ta,isError:!0}},requestBody:Fi,queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii,ji],mediaType:"json",serializer:Ui},mo={path:"/v3/contracts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Ea},400:{bodyMapper:ta,isError:!0},404:{isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},ho={path:"/v3/contracts/{pubkey}/code",httpMethod:"GET",responses:{200:{bodyMapper:Ia},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},fo={path:"/v3/contracts/{pubkey}/poi",httpMethod:"GET",responses:{200:{bodyMapper:ka},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},yo={path:"/v3/oracles/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Oa},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},go={path:"/v3/oracles/{pubkey}/queries",httpMethod:"GET",responses:{200:{bodyMapper:Ma},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi,{parameterPath:["options","from"],mapper:{serializedName:"from",type:{name:"String"}}},{parameterPath:["options","limit"],mapper:{defaultValue:20,constraints:{InclusiveMaximum:1e3,InclusiveMinimum:1},serializedName:"limit",type:{name:"Number"}}},{parameterPath:["options","type"],mapper:{defaultValue:"all",serializedName:"type",type:{name:"Enum",allowedValues:["open","closed","all"]}}}],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},No={path:"/v3/oracles/{pubkey}/queries/{query-id}",httpMethod:"GET",responses:{200:{bodyMapper:Ra},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi,{parameterPath:"queryId",mapper:{serializedName:"query-id",required:!0,type:{name:"String"}}}],headerParameters:[Ii],serializer:Ui},wo={path:"/v3/names/{name}",httpMethod:"GET",responses:{200:{bodyMapper:Ba},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,{parameterPath:"name",mapper:{serializedName:"name",required:!0,type:{name:"String"}}}],headerParameters:[Ii],serializer:Ui},vo={path:"/v3/channels/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:ja},400:{bodyMapper:ta,isError:!0},404:{bodyMapper:ta,isError:!0}},queryParameters:[Oi],urlParameters:[ki,Bi],headerParameters:[Ii],serializer:Ui},Co={path:"/v3/peers/pubkey",httpMethod:"GET",responses:{200:{bodyMapper:Da}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},So={path:"/v3/status",httpMethod:"GET",responses:{200:{bodyMapper:Fa}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui},bo={path:"/v3/status/chain-ends",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"String"}}}}}},queryParameters:[Oi],urlParameters:[ki],headerParameters:[Ii],serializer:Ui};function xo(e,t){To(e,t),t.add(e)}function To(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _o(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}const zo=["balance","queryFee","fee","amount","nameFee","channelAmount","initiatorAmount","responderAmount","channelReserve","initiatorAmountFinal","responderAmountFinal","gasPrice","deposit"],Ao=["time","gas","gasUsed","nameSalt","nonce","nextNonce","height","blockHeight","topBlockHeight","ttl","nameTtl","clientTtl","inbound","outbound","peerCount","pendingTransactionsCount","effectiveAtHeight","version","solutions","round"];var qo=new WeakSet,Po=new WeakSet,Eo=new WeakSet;class Io extends $i{constructor(){super(...arguments),xo(this,Eo),xo(this,Po),xo(this,qo)}async sendOperationRequest(e,t){const n=We(e,(e=>{let[t,n]=e;return[t,_o(this,Po,Oo).call(this,n)]}));return _o(this,Eo,Mo).call(this,await super.sendOperationRequest(n,t))}}function ko(e,t){return Array.isArray(e)?e.map((e=>_o(this,qo,ko).call(this,e,t))):null!=e&&"object"==typeof e?We(e,(e=>{let[n,r]=e;return null==r?[n,r]:zo.some((e=>e===n))?[n,t.bigInt(r)]:Ao.some((e=>e===n))?[n,t.number(r)]:[n,_o(this,qo,ko).call(this,r,t)]})):e}function Oo(e){return _o(this,qo,ko).call(this,e,{bigInt:e=>e instanceof c()?e.toFixed():e.toString(),number:e=>e.toString()})}function Mo(e){return _o(this,qo,ko).call(this,e,{bigInt:e=>BigInt(e),number:e=>+e})}var Ro=new WeakMap;class Bo extends Io{constructor(e){let{ignoreVersion:t=!1,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r,a;if(super(e,{allowInsecureConnection:!0,additionalPolicies:[Qr(),Yr(),Jr((e=>` ${e.reason}`))],...n}),a={writable:!0,value:void 0},To(this,r=Ro),r.set(this,a),!t){const e=this.getStatus(),t=e.then((e=>{let{nodeVersion:t}=e;return t}));Mn(this,Ro,e.then((e=>{let{networkId:t}=e;return t}))),this.pipeline.addPolicy(Xr("node","/v3/status",t,"6.2.0","7.0.0"))}this.intAsString=!0}async getNetworkId(){var e;return null!==(e=Rn(this,Ro))&&void 0!==e||Mn(this,Ro,this.getStatus().then((e=>{let{networkId:t}=e;return t}))),Rn(this,Ro)}async getNodeInfo(){const{nodeVersion:e,networkId:t,protocols:n,topBlockHeight:r}=await this.getStatus(),a=n.filter((e=>{let{effectiveAtHeight:t}=e;return r>=t})).reduce(((e,t)=>t.effectiveAtHeight>e.effectiveAtHeight?t:e),{effectiveAtHeight:-1,version:0}).version;return{url:this.$host,nodeNetworkId:t,version:e,consensusProtocolVersion:a}}}var jo=w(9408).Buffer;const Do=[],Fo=e=>["senderId","accountId","ownerId","callerId","oracleId","fromId","initiator","gaId","payerId"].map((t=>e[t])).filter((e=>e)).map((e=>e?.toString().replace(/^ok_/,"ak_")))[0];async function $o(e,t,n){var r;const a=null!==(r=Fo(e))&&void 0!==r?r:e.tag===Gt.SignedTx?Fo(e.encodedTx):void 0,[i,{height:o},{consensusProtocolVersion:s,nodeNetworkId:c}]=await Promise.all([null==a?void 0:t.getAccountByPubkey(a).catch((e=>{if(!Je(e))throw e;return{id:a,balance:0n,nonce:0}})).then((e=>({...e,id:e.id}))),t.getCurrentKeyBlockHeight(),t.getNodeInfo()]);return(await Promise.all(Do.map((r=>r(e,{node:t,account:i,height:o,consensusProtocolVersion:s,nodeNetworkId:c,parentTxTypes:n}))))).flat()}async function Uo(e,t){const n=new Bo(t.$host,{ignoreVersion:!0});return n.pipeline.addPolicy((()=>{const e=new Map;return{name:"aggressive-cache-get-responses",async sendRequest(t,n){var r;if("GET"!==t.method)return n(t);const a=JSON.stringify([t.url,t.body]),i=null!==(r=e.get(a))&&void 0!==r?r:n(t);return e.set(a,i),i}}})()),$o(Lr(e),n,[])}function Vo(e,t){let{_expectedMineRate:n=18e4,_microBlockCycle:r=3e3,_maxPollInterval:a=5e3}=t;const i={block:n,microblock:r}[e];return Math.min(i/3,a)}Do.push(((e,t)=>{let{encodedTx:n,signatures:r}=e,{account:a,nodeNetworkId:i,parentTxTypes:o}=t;if(null==(null!=n?n:r))return[];if(null==a)return[];if(1!==r.length)return[];const s=jo.from([i,...o.includes(Gt.PayingForTx)?["inner_tx"]:[]].join("-")),c=ht(Hr(n)),u=Ke([s,c]),l=Ke([s,Ct(c)]);return _t(u,r[0],a.id)||_t(l,r[0],a.id)?[]:[{message:"Signature cannot be verified, please ensure that you transaction have the correct prefix and the correct private key for the sender address",key:"InvalidSignature",checkedKeys:["encodedTx","signatures"]}]}),(async(e,t)=>{let{encodedTx:n,tx:r,tag:a}=e,{node:i,parentTxTypes:o}=t;return null==(null!=n?n:r)?[]:$o(null!=n?n:r,i,[...o,a])}),((e,t)=>{let{ttl:n}=e,{height:r}=t;return null==n?[]:(n=+n,0===n||n>=r?[]:[{message:`TTL ${n} is already expired, current height is ${r}`,key:"ExpiredTTL",checkedKeys:["ttl"]}])}),((e,t)=>{var n,r;let{amount:a,fee:i,nameFee:o,tx:s,tag:u}=e,{account:l,parentTxTypes:d}=t;if(null==l)return[];if(null==(null!==(n=null!=a?a:i)&&void 0!==n?n:o))return[];null!==(r=i)&&void 0!==r||(i=0);const p=new(c())(i).plus(null!=o?o:0).plus(null!=a?a:0).plus(u===Gt.PayingForTx?s.encodedTx.fee:0).minus(d.includes(Gt.PayingForTx)?i:0);return p.lte(l.balance.toString())?[]:[{message:`Account balance ${l.balance.toString()} is not enough to execute the transaction that costs ${p.toFixed()}`,key:"InsufficientBalance",checkedKeys:["amount","fee","nameFee"]}]}),((e,t)=>{let n,{signatures:r,tag:a}=e,{account:i}=t;return null==i?[]:(a===Gt.SignedTx&&"generalized"===i.kind&&0!==r.length&&(n="Generalized account can't be used to generate SignedTx with signatures"),a===Gt.GaMetaTx&&"basic"===i.kind&&(n="Basic account can't be used to generate GaMetaTx"),null==n?[]:[{message:n,key:"InvalidAccountType",checkedKeys:["tag"]}])}),((e,t)=>{let{nonce:n}=e,{account:r,parentTxTypes:a}=t;if(null==n||null==r||a.includes(Gt.GaMetaTx))return[];n=+n;const i=r.nonce+1;return n===i?[]:[{...n<i?{message:`Nonce ${n} is already used, valid nonce is ${i}`,key:"NonceAlreadyUsed"}:{message:`Nonce ${n} is too high, valid nonce is ${i}`,key:"NonceHigh"},checkedKeys:["nonce"]}]}),((e,t)=>{var n,r;let{ctVersion:a,abiVersion:i,tag:o}=e,{consensusProtocolVersion:s}=t;const c=Gt.Oracle===o||Gt.OracleRegisterTx===o,u=Gt.ContractCreateTx===o||Gt.GaAttachTx===o,l=Gt.ContractCallTx===o||Gt.GaMetaTx===o,d=null!==(n=null!==(r=c?"oracle-call":null)&&void 0!==r?r:u?"contract-create":null)&&void 0!==n?n:l?"contract-call":null;if(null==d)return[];const p=Kt[s][d];return null==a&&(a={abiVersion:i}),!p.abiVersion.includes(a.abiVersion)||u&&!p.vmVersion.includes(a.vmVersion)?[{message:`ABI/VM version ${JSON.stringify(a)} is wrong, supported is: ${JSON.stringify(p)}`,key:"VmAndAbiVersionMismatch",checkedKeys:["ctVersion","abiVersion"]}]:[]}),(async(e,t)=>{let{contractId:n,tag:r}=e,{node:a}=t;if(Gt.ContractCallTx!==r)return[];try{const{active:e}=await a.getContract(n);return e?[]:[{message:`Contract ${n} is not active`,key:"ContractNotActive",checkedKeys:["contractId"]}]}catch(e){if(null==e.response?.parsedBody?.reason)throw e;return[{message:e.response.parsedBody.reason,key:"ContractNotFound",checkedKeys:["contractId"]}]}}));class Ho extends C{constructor(e,t,n){super(e),this.name="InvalidTxError",this.validation=t,this.transaction=n}}async function Lo(e){let{onNode:t}=e;return(await t.getCurrentKeyBlockHeight()).height}async function Go(e,t){var n;let{blocks:r=10,interval:a,onNode:i,...o}=t;null!==(n=a)&&void 0!==n||(a=Vo("microblock",o));const s=await Lo({onNode:i})+r;do{const t=await i.getTransactionByHash(e);if(-1!==t.blockHeight)return t;await Ge(a)}while(await Lo({onNode:i})<s);throw new P(r,e)}async function Wo(e,t){var n;let r,{interval:a,onNode:i,...o}=t;null!==(n=a)&&void 0!==n||(a=Vo("block",o));do{null!=r&&await Ge(a),r=(await i.getCurrentKeyBlockHeight()).height}while(r<e);return r}async function Ko(e,t){let{confirm:n=3,onNode:r,...a}=t;const{blockHeight:i}=await r.getTransactionByHash(e),o=await Wo(i+n,{onNode:r,...a}),{blockHeight:s}=await r.getTransactionByHash(e);switch(s){case-1:throw new qe(e);case i:return o;default:return Ko(e,{onNode:r,confirm:n,...a})}}async function Qo(e,t){let{onNode:n,onAccount:r,verify:a=!0,waitMined:i=!0,confirm:o,...s}=t;if(a){const t=await Uo(e,n);if(t.length>0){const n=`Transaction verification errors: ${t.map((e=>e.message)).join(", ")}`;throw new Ho(n,t,e)}}try{let t;try{t=null!=r?`tx-${r.address}`:null}catch(e){t=null}const{txHash:a}=await n.postTransaction({tx:e},null!=t?{requestOptions:{customHeaders:{__queue:t}}}:{});if(i){const t=await Go(a,{onNode:n,...s}),r={...t,hash:t.hash,rawTx:e};if(null!=o&&(!0===o||o>0)){const e="boolean"==typeof o?void 0:o;return{...r,confirmationHeight:await Ko(a,{onNode:n,confirm:e,...s})}}return r}return{hash:a,rawTx:e}}catch(t){throw Object.assign(t,{rawTx:e,verifyTx:async()=>Uo(e,n)})}}async function Yo(e,t){let{height:n,hash:r,onNode:a}=t;return null!=n?a.getAccountByPubkeyAndHeight(e,n):null!=r?a.getAccountByPubkeyAndHash(e,r):a.getAccountByPubkey(e)}async function Jo(e,t){let{format:n=Me.AETTOS,...r}=t;const{balance:a}=await Yo(e,r).catch((e=>{if(!Je(e))throw e;return{balance:0n}}));return Be(a,{targetDenomination:n})}async function Xo(e){let{onNode:t}=e;return t.getCurrentGeneration()}async function Zo(e,t){let{onNode:n}=t;return"number"==typeof e?n.getGenerationByHeight(e):n.getGenerationByHash(e)}async function es(e,t){let{onNode:n}=t;return(await n.getMicroBlockTransactionsByHash(e)).transactions}async function ts(e,t){let{onNode:n}=t;return"number"==typeof e?n.getKeyBlockByHeight(e):n.getKeyBlockByHash(e)}async function ns(e,t){let{onNode:n}=t;return n.getMicroBlockHeaderByHash(e)}const rs=new Map;async function as(e,t){const n=rs.get(e);if(rs.delete(e),null==n)throw new R("Can't get dry-run request");let r;try{const e="number"==typeof n[0].top?(await ts(n[0].top,{onNode:t})).hash:n[0].top;r=await t.protectedDryRunTxs({top:e,txEvents:n[0].txEvents,txs:n.map((e=>({tx:e.tx}))),accounts:Array.from(new Set(n.map((e=>e.accountAddress)))).map((e=>({pubKey:e,amount:$r.amount})))})}catch(e){return void n.forEach((t=>{let{reject:n}=t;return n(e)}))}const{results:a,txEvents:i}=r;a.forEach(((e,t)=>{let{result:r,reason:a,...o}=e;const{resolve:s,reject:c,tx:u,accountAddress:l}=n[t];"ok"===r?s({...o,txEvents:i}):c(Object.assign(new Se(a),{tx:u,accountAddress:l}))}))}async function is(e,t,n){var r;let{top:a,txEvents:i,combine:o,onNode:s}=n;const c=!0===o?[a,i].join():"immediate",u=null!==(r=rs.get(c))&&void 0!==r?r:[];return rs.set(c,u),new Promise(((n,r)=>{var l;u.push({tx:e,accountAddress:t,top:a,txEvents:i,resolve:n,reject:r}),!0===o?null!==(l=u.timeout)&&void 0!==l||(u.timeout=setTimeout((()=>{as(c,s)}))):as(c,s)}))}async function os(e,t){let{onNode:n}=t;return n.getContractCode(e)}async function ss(e,t){let{onNode:n}=t;return n.getContract(e)}async function cs(e,t){let{onNode:n}=t;return n.getNameEntryByName(e)}async function us(e,t,n){let{verify:r=!0,resolveByNode:a=!1,onNode:i}=n;if(fn(e)){if(r||a){const n=(await i.getNameEntryByName(e)).pointers.find((e=>e.key===t));if(null==n)throw new D(e,t);if(a)return n.id}return dn(e)}try{return ht(e),e}catch(t){throw new $(`Invalid name or address: ${e}`)}}var ls=w(3983),ds=w(7417),ps=w(9408).Buffer;const ms={async argon2id(e,t,n){const{memlimit_kib:r,opslimit:a}=n;return(0,ds.hash)(e,{hashLength:32,salt:t,timeCost:a,memoryCost:r,type:ds.argon2id})}},hs={"xsalsa20-poly1305":{encrypt:$e().secretbox,decrypt(){const e=$e().secretbox.open(...arguments);if(null==e)throw new me;return e}}},fs={secret_type:"ed25519",symmetric_alg:"xsalsa20-poly1305",kdf:"argon2id",kdf_params:{memlimit_kib:65536,opslimit:3,parallelism:1}};function ys(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fs.symmetric_alg;return hs[r].encrypt(e,n,t)}async function gs(e,t,n,r){return ms[n](e,t,r)}async function Ns(e,t){let{crypto:n}=t;const r=ps.from(n.kdf_params.salt,"hex");return ps.from(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fs.symmetric_alg;return hs[r].decrypt(e,n,t)}(ps.from(n.ciphertext,"hex"),await gs(e,r,n.kdf,n.kdf_params),ps.from(n.cipher_params.nonce,"hex"),n.symmetric_alg)).toString("hex")}async function ws(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$e().randomBytes(24),a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:$e().randomBytes(16),i=arguments.length>5?arguments[5]:void 0;const o={...fs,...i},s=await gs(t,a,o.kdf,o.kdf_params),c="string"==typeof n?ps.from(n,"hex"):n;return{name:e,version:1,public_key:gt(c),id:(0,ls.v4)(),crypto:{secret_type:o.secret_type,symmetric_alg:o.symmetric_alg,ciphertext:ps.from(ys(c,s,r,o.symmetric_alg)).toString("hex"),cipher_params:{nonce:ps.from(r).toString("hex")},kdf:o.kdf,kdf_params:{...o.kdf_params,salt:ps.from(a).toString("hex")}}}}async function vs(e,t){var n,r;let{denomination:a,absoluteTtl:i,strategy:o,onNode:s,...c}=t;const u=c;let l;switch(e){case Gt.SpendTx:case Gt.OracleQueryTx:l="senderId";break;case Gt.NameClaimTx:case Gt.NameUpdateTx:case Gt.NameRevokeTx:case Gt.NameTransferTx:case Gt.NamePreclaimTx:case Gt.OracleRegisterTx:l="accountId";break;case Gt.ContractCreateTx:case Gt.GaAttachTx:l="ownerId";break;case Gt.GaMetaTx:l="gaId";break;case Gt.ContractCallTx:case Gt.OracleExtendTx:case Gt.OracleResponseTx:l="callerId";break;case Gt.ChannelCloseSoloTx:case Gt.ChannelSlashTx:case Gt.ChannelSettleTx:case Gt.ChannelSnapshotSoloTx:l="fromId";break;case Gt.PayingForTx:l="payerId";break;default:throw new b("txType","valid transaction type",e)}if(2!==Object.keys(Vt).length&&((Gt.ContractCreateTx===e||Gt.GaAttachTx===e)&&null==u.ctVersion||(Gt.ContractCallTx===e||Gt.GaMetaTx===e)&&null==u.abiVersion)){const{consensusProtocolVersion:e}=await s.getNodeInfo();u.consensusProtocolVersion=e}e===Gt.PayingForTx&&(u.tx=Lr(u.tx));const d=u[l];if(null==d)throw new Te(`Transaction field ${l} is missed`);if(null!==(n=u.nonce)&&void 0!==n||(u.nonce=(await s.getAccountNextNonce(d,{strategy:o}).catch((e=>{if(!Je(e))throw e;return{nextNonce:1}}))).nextNonce),null!==(r=u.ttl)&&void 0!==r||(u.ttl=Rr),0!==u.ttl){if(u.ttl<0)throw new b("ttl","greater or equal to 0",u.ttl);u.ttl+=!0===i?0:(await s.getCurrentKeyBlock()).height}return Hr({...u,tag:e},{denomination:a})}var Cs=w(9882),Ss=w(1986),bs=w(8236),xs=w.n(bs),Ts=w(9408).Buffer;const _s=xs().ModeOfOperation.ecb;function zs(e,t){const n=rt(e);return new _s(n).encrypt(t)}function As(e,t){const n=Ts.from(t),r=rt(e);return new _s(r).decrypt(n)}class qs extends g{constructor(e){super(e),this.name="DerivationError"}}const Ps=Ts.from("ed25519 seed"),Es=2147483648;function Is(e,t){let{secretKey:n,chainCode:r}=e;if(t<Es)throw new qs(`Segment ${t} is not hardened`);const a=Ts.allocUnsafe(4);a.writeUInt32BE(t,0);const i=Ke([Ts.alloc(1,0),n,a]),o=(0,Cs.full)(i,r);return{secretKey:o.slice(0,32),chainCode:o.slice(32)}}function ks(e,t){const n=""===e?[]:(0,Ss.fromString)(e).toPathArray();return n.forEach(((e,t)=>{if(e<Es)throw new qs(`Segment #${t+1} is not hardened`)})),n.reduce(((e,t)=>Is(e,t)),t)}function Os(e){const t=(0,Cs.full)(e,Ps);return{secretKey:t.slice(0,32),chainCode:t.slice(32)}}function Ms(e,t){if(!["m","m/"].includes(e.slice(0,2)))throw new qs("Root element is required");const n=Os(t);return ks(e.slice(2),n)}function Rs(e){const{secretKey:t,publicKey:n}=e;return{secretKey:Ts.from(t).toString("hex"),publicKey:ft(n,tt.AccountAddress)}}function Bs(e){return $e().sign.keyPair.fromSeed(e)}function js(e,t){const n=Ms("m/44h/457h",e);return{secretKey:Ts.from(zs(t,n.secretKey)).toString("hex"),chainCode:Ts.from(zs(t,n.chainCode)).toString("hex")}}function Ds(e,t,n){const r={secretKey:As(t,Ts.from(e.secretKey,"hex")),chainCode:As(t,Ts.from(e.chainCode,"hex"))};return new Array(n).fill(void 0).map(((e,t)=>Rs(Bs(ks(`${t}h/0h/0h`,r).secretKey))))}const Fs=(e,t)=>({...Rs(Bs(ks(`${t}h/0h/0h`,Ms("m/44h/457h",e)).secretKey)),idx:t});async function $s(e,t){const n=await t.onAccount.signTransaction(e,{...t,networkId:await t.onNode.getNetworkId()});return!0===t.innerTx?{hash:Gr(n),rawTx:n}:Qo(n,t)}async function Us(e,t,n){return $s(await vs(Gt.SpendTx,{...n,senderId:n.onAccount.address,recipientId:await us(t,"account_pubkey",n),amount:e}),n)}async function Vs(e,t,n){if(e<0||e>1)throw new b("fraction","a number between 0 and 1",e);const r=await us(t,"account_pubkey",n),a=n.onAccount.address,i=new(c())(await Jo.bind(n.onAccount)(a,n)),o=i.times(e).integerValue(c().ROUND_HALF_UP),{fee:s}=Lr(await vs(Gt.SpendTx,{...n,senderId:a,recipientId:r,amount:o}),Gt.SpendTx),u=o.plus(s).gt(i)?i.minus(s):o;return $s(await vs(Gt.SpendTx,{...n,senderId:a,recipientId:r,amount:u}),n)}async function Hs(e,t){return $s(await vs(Gt.PayingForTx,{...t,payerId:t.onAccount.address,tx:e}),t)}async function Ls(e,t){return $s(await vs(Gt.NameRevokeTx,{...t,nameId:e,accountId:t.onAccount.address}),t)}async function Gs(e,t,n){let{extendPointers:r,...a}=n;const i={...!0===r&&Object.fromEntries((await cs(e,a)).pointers.map((e=>{let{key:t,id:n}=e;return[t,n]}))),...t};return $s(await vs(Gt.NameUpdateTx,{clientTtl:Mt,nameTtl:It,...a,nameId:e,accountId:a.onAccount.address,pointers:Object.entries(i).map((e=>{let[t,n]=e;return{key:t,id:n}}))}),a)}async function Ws(e,t,n){return $s(await vs(Gt.NameTransferTx,{...n,nameId:e,accountId:n.onAccount.address,recipientId:t}),n)}async function Ks(e,t){const n=await cs(e,t);return Object.freeze({...n,id:n.id,owner:n.owner,async update(n,r){return{...await Gs(e,n,{...t,...r}),...await Ks(e,{...t,...r})}},async transfer(n,r){return{...await Ws(e,n,{...t,...r}),...await Ks(e,{...t,...r})}},async revoke(n){return Ls(e,{...t,...n})},async extendTtl(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:It,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n>It||n<=0)throw new b("nameTtl",`a number between 1 and ${It} blocks`,n);return{...await Gs(e,{},{...t,...r,nameTtl:n,extendPointers:!0}),...await Ks(e,{...t,...r})}}})}async function Qs(e,t,n){const r=await vs(Gt.NameClaimTx,{...n,accountId:n.onAccount.address,nameSalt:t,name:e}),a=await $s(r,n);if(!Cn(e)){const t=null!=a.blockHeight&&a.blockHeight>0?await Ks(e,n):{};return Object.assign(a,t)}return a}async function Ys(e,t){const n=wt(),r=await Lo(t),a=pn(e,n),i=await vs(Gt.NamePreclaimTx,{...t,accountId:t.onAccount.address,commitmentId:a});return Object.freeze({...await $s(i,t),height:r,salt:n,commitmentId:a,async claim(r){const{version:a,...i}=t;return Qs(e,n,{...i,...r})}})}async function Js(e,t,n){return Qs(e,0,{...n,nameFee:t})}var Xs=w(7946),Zs=w(9408).Buffer;const ec=class{async $createDelegationSignature(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const n={...this.$options,...t},r=this.$options.address;if(null==n.onAccount)throw new x("Can't create delegation signature without account");if(null==r)throw new ae("Can't create delegation signature without address");return n.onAccount.sign(Ke([Zs.from(await n.onNode.getNetworkId()),...!0===n.omitAddress?[]:[ht(n.onAccount.address)],...e.map((e=>fn(e)?dn(e):e)).map((e=>ht(e))),ht(r)]),n)}async $compile(){if(null!=this.$options.bytecode)return this.$options.bytecode;if(null==this.$options.sourceCode)throw new x("Can't compile without source code");if(null==this.$options.onCompiler)throw new x("Can't compile without compiler");return this.$options.bytecode=(await this.$options.onCompiler.compileBySourceCode(this.$options.sourceCode,this.$options.fileSystem)).bytecode,this.$options.bytecode}_handleCallError(e,t){let n,{returnType:r,returnValue:a}=e;switch(r){case"ok":return;case"revert":n=this._calldata.decodeFateString(a);break;case"error":n=ht(a).toString();break;default:throw new R(`Unknown return type: ${r}`)}throw new se(n,t)}async _sendAndProcess(e,t){const n=await $s(e,{...this.$options,...t}),r={hash:n.hash,tx:Lr(n.rawTx),txData:n,rawTx:n.rawTx};if(null==n.blockHeight)return r;const{callInfo:a}=await this.$options.onNode.getTransactionInfoByHash(n.hash);return Object.assign(r.txData,a),this._handleCallError(a,e),{...r,result:a}}async _estimateGas(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{result:r}=await this.$call(e,t,{...n,callStatic:!0});if(null==r)throw new B;const{gasUsed:a}=r;return Math.floor(1.25*a)}async $deploy(e,t){var n;const{callStatic:r,...a}={...this.$options,...t};if(null==this.$options.bytecode&&await this.$compile(),!0===r)return this.$call("init",e,{...a,callStatic:r});if(null!=this.$options.address)throw new te;if(null==a.onAccount)throw new x("Can't deploy without account");const i=a.onAccount.address;if(null==this.$options.bytecode)throw new x("Can't deploy without bytecode");const o=await vs(Gt.ContractCreateTx,{...a,gasLimit:null!==(n=a.gasLimit)&&void 0!==n?n:await this._estimateGas("init",e,a),callData:this._calldata.encode(this._name,"init",e),code:this.$options.bytecode,ownerId:i});this.$options.address=Wr(o);const{hash:s,...c}=await this._sendAndProcess(o,{...a,onAccount:a.onAccount});return{...c,...null!=c.result?.log&&{decodedEvents:this.$decodeEvents(c.result.log,a)},owner:i,transaction:s,address:this.$options.address}}_getFunctionACI(e){const t=this._aci.encodedAci.contract.functions.find((t=>t.name===e));if(null!=t)return t;if("init"===e)return{payable:!1};throw new ce(`Function ${e} doesn't exist in contract`)}async $call(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{callStatic:r,top:a,...i}={...this.$options,...n},o=this._getFunctionACI(e),s=this.$options.address,{onNode:c}=i;if(null==e)throw new oe;if("init"===e&&!0!==r)throw new re('"init" can be called only via dryRun');if("init"!==e&&null!=i.amount&&i.amount>0&&!1===o.payable)throw new ue(i.amount,e);let u;try{if(null==i.onAccount)throw new R("Use fallback account");u=i.onAccount.address}catch(e){if(!0!==r||!(e instanceof E&&"Account should be an address (ak-prefixed string), or instance of AccountBase, got undefined instead"===e.message||e instanceof ke))throw e;u=$r.pub}const l=this._calldata.encode(this._name,e,t);let d;if(!0===r){if(null==i.nonce&&null!=a){const e="number"==typeof a?"height":"hash";i.nonce=(await Yo(u,{[e]:a,onNode:c})).nonce+1}const t={...i,onNode:c,callData:l};let n;if("init"===e){if(null==this.$options.bytecode)throw new x('Can\'t dry-run "init" without bytecode');n=await vs(Gt.ContractCreateTx,{...t,code:this.$options.bytecode,ownerId:u})}else{if(null==s)throw new ae("Can't dry-run contract without address");n=await vs(Gt.ContractCallTx,{...t,callerId:u,contractId:s})}const{callObj:r,...o}=await is(n,u,{...i,top:a});if(null==r)throw new B;this._handleCallError({returnType:r.returnType,returnValue:r.returnValue},n),d={...o,tx:Lr(n),result:r}}else{var p;if(null!=a)throw new x("Can't handle `top` option in on-chain contract call");if(null==s)throw new ae("Can't call contract without address");const n=await vs(Gt.ContractCallTx,{...i,gasLimit:null!==(p=i.gasLimit)&&void 0!==p?p:await this._estimateGas(e,t,i),callerId:u,contractId:s,callData:l});if(null==i.onAccount)throw new x("Can't call contract on chain without account");d=await this._sendAndProcess(n,{...i,onAccount:i.onAccount})}return!0!==r&&null==d.txData.blockHeight||(d.decodedResult=null!=o.returns&&"unit"!==o.returns&&"init"!==e&&this._calldata.decode(this._name,e,d.result.returnValue),d.decodedEvents=this.$decodeEvents(d.result.log,i)),d}_getContractNameByEvent(e,t,n){let{contractAddressToName:r}=n;const a={...this.$options.contractAddressToName,...r};if(null!=a[e])return a[e];const i=[this._aci.encodedAci,...this._aci.externalEncodedAci].filter((e=>{let{contract:t}=e;return t?.event})).map((e=>{let{contract:t}=e;return[t.name,t.event.variant]})).map((e=>{let[t,n]=e;return n.map((e=>[t,Object.keys(e)[0],Object.values(e)[0]]))})).flat().filter((e=>{let[,n]=e;return BigInt(`0x${Ct(n).toString("hex")}`)===t})).filter(((e,t,n)=>{let[,,r]=e;return!n.slice(0,t).some((e=>{return t=e[2],n=r,JSON.stringify(t)===JSON.stringify(n);var t,n}))}));switch(i.length){case 0:throw new le(t.toString(),e);case 1:return i[0][0];default:throw new de(e,i)}}$decodeEvents(e){let{omitUnknown:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.map((e=>{const r=e.topics.map((e=>BigInt(e)));let a;try{a=this._getContractNameByEvent(e.address,r[0],n)}catch(e){if(null!=t&&t&&e instanceof le)return null;throw e}const i=this._calldata.decodeEvent(a,e.data,r),[o,s]=Object.entries(i)[0];return{name:o,args:s,contract:{name:a,address:e.address}}})).filter((e=>null!=e))}static async initialize(e){let{onCompiler:t,onNode:n,bytecode:r,aci:a,address:i,sourceCodePath:o,sourceCode:s,fileSystem:c,validateBytecode:u,...l}=e;if(null==a&&null!=t){let e;var d;null!=o&&(e=await t.compile(o)),null!=s&&(e=await t.compileBySourceCode(s,c)),null!=e&&(a=e.aci,null!==(d=r)&&void 0!==d||(r=e.bytecode))}if(null==a)throw new ie;if(null!=i&&(i=await us(i,"contract_pubkey",{resolveByNode:!0,onNode:n})),null==i&&null==s&&null==r)throw new ae("Can't create instance by ACI without address");if(null!=i&&null==(await ss(i,{onNode:n})).active)throw new ne(i);if(!0===u){if(null==i)throw new ae("Can't validate bytecode without contract address");const e=(await os(i,{onNode:n})).bytecode;let a=!1;if(null!=r)a=r===e;else if(null!=s){if(null==t)throw new x("Can't validate bytecode without compiler");a=await t.validateBySourceCode(e,s,c)}if(!a)throw new ee(null!=s?"source code":"bytecode")}return new ec({onCompiler:t,onNode:n,sourceCode:s,bytecode:r,aci:a,address:i,fileSystem:c,...l})}constructor(e){var t=this;let{aci:n,...r}=e;this._aci=n,this._name=n.encodedAci.contract.name,this._calldata=new Xs.Encoder([n.encodedAci,...n.externalEncodedAci]),this.$options=r,Object.assign(this,Object.fromEntries(this._aci.encodedAci.contract.functions.map((e=>{let{name:n,arguments:r,stateful:a}=e;const i="init"!==n&&!a;return[n,async function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];const s=a.length===r.length+1?a.pop():{};if("object"!=typeof s)throw new E(`Options should be an object: ${s}`);return"init"===n?t.$deploy(a,{callStatic:i,...s}):t.$call(n,a,{callStatic:i,...s})}]}))))}};var tc=ec;function nc(e,t,n){var r;let{interval:a,onNode:i,...o}=n;null!==(r=a)&&void 0!==r||(a=Vo("microblock",o));const s=new Set,c=async()=>{var n;const r=(null!==(n=(await i.getOracleQueriesByPubkey(e)).oracleQueries)&&void 0!==n?n:[]).filter((e=>{let{id:t}=e;return!s.has(t)}));r.forEach((e=>{let{id:t}=e;return s.add(t)})),r.length>0&&t(r)};let u=!1;return(async()=>{for(;!u;)await c().catch(console.error),await Ge(a)})(),()=>{u=!0}}async function rc(e,t,n){var r;let a,i,o,{interval:s,onNode:c,...u}=n;null!==(r=s)&&void 0!==r||(s=Vo("microblock",u));do{({response:o,ttl:i}=await c.getOracleQueryByPubkeyAndQueryId(e,t));const n=ht(o);if(n.length>0)return n.toString();await Ge(s),a=await Lo({onNode:c})}while(i>=a);throw new q(a)}async function ac(e,t,n){const r=await n.onNode.getOracleQueryByPubkeyAndQueryId(e,t);return{...r,decodedQuery:ht(r.query).toString(),decodedResponse:ht(r.response).toString(),respond:async(r,a)=>sc(e,t,r,{...n,...a}),pollForResponse:async r=>rc(e,t,{...n,...r})}}async function ic(e,t,n){var r;null!==(r=n.queryFee)&&void 0!==r||(n.queryFee=(await n.onNode.getOracleByPubkey(e)).queryFee.toString());const a=n.onAccount.address,i=await vs(Gt.OracleQueryTx,{queryTtlType:Dr.type,queryTtlValue:Dr.value,responseTtlType:Fr.type,responseTtlValue:Fr.value,...n,oracleId:e,senderId:a,query:t}),{nonce:o}=Lr(i,Gt.OracleQueryTx),s=ln(a,o,e);return{...await $s(i,n),...await ac(e,s,n)}}async function oc(e,t){const n=await vs(Gt.OracleExtendTx,{oracleTtlType:jr.type,oracleTtlValue:jr.value,...t,callerId:t.onAccount.address,oracleId:e});return{...await $s(n,t),...await cc(e,t)}}async function sc(e,t,n,r){const a=await vs(Gt.OracleResponseTx,{responseTtlType:Fr.type,responseTtlValue:Fr.value,...r,callerId:r.onAccount.address,oracleId:e,queryId:t,response:n});return{...await $s(a,r),...await cc(e,r)}}async function cc(e,t){return{...await t.onNode.getOracleByPubkey(e),queries:(await t.onNode.getOracleQueriesByPubkey(e)).oracleQueries,...We({pollQueries:nc,postQuery:ic,respondToQuery:sc,extendOracle:oc,getQuery:ac},(n=>{let[r,a]=n;return[r,function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const o=r[r.length-1];return null!=o&&"object"==typeof o&&o.constructor===Object?Object.assign(o,{...t,...o}):r.push(t),a(e,...r)}]}))}}async function uc(e,t,n){const r=n.onAccount.address,a=await vs(Gt.OracleRegisterTx,{queryFee:Br,oracleTtlValue:jr.value,oracleTtlType:jr.type,...n,accountId:r,queryFormat:e,responseFormat:t});return{...await $s(a,n),...await cc(ft(ht(r),tt.OracleAddress),n)}}var lc=w(9408).Buffer;async function dc(e,t,n){var r;let{onAccount:a,onCompiler:i,onNode:o,bytecode:s,aci:c,sourceCodePath:u,sourceCode:l,fileSystem:d,...p}=n;const m=a.address;if("generalized"===(await Yo(m,{onNode:o})).kind)throw new x(`Account ${m} is already GA`);const h=await tc.initialize({onAccount:a,onCompiler:i,onNode:o,bytecode:s,aci:c,sourceCodePath:u,sourceCode:l,fileSystem:d}),f=await vs(Gt.GaAttachTx,{...p,onNode:o,code:await h.$compile(),gasLimit:null!==(r=p.gasLimit)&&void 0!==r?r:await h._estimateGas("init",t,p),ownerId:m,callData:h._calldata.encode(h._name,"init",t),authFun:Ct(e)}),y=Wr(f),{hash:g,rawTx:N}=await $s(f,{onNode:o,onAccount:a,onCompiler:i,...p});return Object.freeze({owner:m,transaction:g,rawTx:N,gaContractId:y})}async function pc(e,t){let{onNode:n}=t;return new Uint8Array(Ct(Ke([lc.from(await n.getNetworkId()),ht(e)])))}var mc=w(7445),hc=w(2472),fc=w(8994);function yc(e){return yc="function"==typeof hc&&"symbol"==typeof fc?function(e){return typeof e}:function(e){return e&&"function"==typeof hc&&e.constructor===hc&&e!==hc.prototype?"symbol":typeof e},yc(e)}var gc=w(24);function Nc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==yc(e)||null===e)return e;var n=e[gc];if(void 0!==n){var r=n.call(e,"string");if("object"!==yc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yc(t)?t:String(t)}(t))in e?mc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wc(e){return new Proxy({},{...Object.fromEntries(["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"].map((e=>[e,()=>{throw new O(`${e} proxy request`)}]))),get(t,n,r){const a=e(),i=Reflect.get(a,n,r);return"function"==typeof i?i.bind(a):i},has(t,n){return Reflect.has(e(),n)}})}const{InvalidTxError:vc,...Cc}=t,Sc={...Cc,...r,...n,...a,...i};class bc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Nc(this,"_options",{denomination:Me.AETTOS}),Object.assign(this._options,e)}_resolveAccount(e){if("string"==typeof e)throw new O("Address in AccountResolver");if("object"==typeof e)return e;throw new E(`Account should be an address (ak-prefixed string), or instance of AccountBase, got ${String(e)} instead`)}_getOptions(){return{...this._options,onAccount:wc((()=>this._resolveAccount()))}}async buildTx(e,t){return vs(e,{...this._getOptions(),...t})}async initializeContract(e){const{onNode:t,onCompiler:n,...r}=this._getOptions();if(null==n||null==t)throw new b("onCompiler, onNode","provided",null);return tc.initialize({...r,onNode:t,onCompiler:n,...e})}}Object.assign(bc.prototype,We(Sc,(e=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length=n.length;const a=t[t.length-1];return t[t.length-1]={...this._getOptions(),...a,...null!=a?.onAccount&&{onAccount:this._resolveAccount(a.onAccount)}},n(...t)}]})));var xc=bc;class Tc extends xc{constructor(){let{nodes:e=[],...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),Nc(this,"pool",new Map),e.forEach(((e,t)=>{let{name:n,instance:r}=e;return this.addNode(n,r,0===t)}))}get compilerApi(){if(null==this._options.onCompiler)throw new f("You can't use Compiler API. Compiler is not ready!");return this._options.onCompiler}get api(){return this.ensureNodeConnected(),this.pool.get(this.selectedNodeName)}addNode(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.pool.has(e))throw new Ne(e);this.pool.set(e,t),(n||null==this.selectedNodeName)&&this.selectNode(e)}selectNode(e){if(!this.pool.has(e))throw new we(`Node with name ${e} not in pool`);this.selectedNodeName=e}isNodeConnected(){return null!=this.selectedNodeName}ensureNodeConnected(){if(!this.isNodeConnected())throw new we("You can't use Node API. Node is not connected or not defined!")}async getNodeInfo(){return this.ensureNodeConnected(),{name:this.selectedNodeName,...await this.api.getNodeInfo()}}async getNodesInPool(){return Promise.all(Array.from(this.pool.entries()).map((async e=>{let[t,n]=e;return{name:t,...await n.getNodeInfo()}})))}addresses(){return[]}get address(){return this._resolveAccount().address}async sign(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).sign(e,n)}async signTransaction(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null!==this.selectedNodeName?await this.api.getNetworkId():void 0;return this._resolveAccount(t).signTransaction(e,{networkId:r,...n})}async signMessage(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).signMessage(e,n)}_getOptions(){return{...super._getOptions(),onNode:wc((()=>this.api)),onCompiler:wc((()=>this.compilerApi))}}}class _c extends Tc{constructor(){let{accounts:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),Nc(this,"accounts",{}),e?.forEach(((e,t)=>this.addAccount(e,{select:0===t})))}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedAddress;if("string"==typeof e){const t=e;if(ht(t),null==this.accounts[t])throw new j(e);e=this.accounts[t]}return super._resolveAccount(e)}addresses(){return Object.keys(this.accounts)}addAccount(e){let{select:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{address:n}=e;this.accounts[n]=e,!0===t&&this.selectAccount(n)}removeAccount(e){if(null==this.accounts[e])throw new j(e);delete this.accounts[e],this.selectedAddress===e&&delete this.selectedAddress}selectAccount(e){if(ht(e),null==this.accounts[e])throw new j(e);this.selectedAddress=e}}class zc{}let Ac,qc,Pc,Ec,Ic;!function(e){e.to_waellet="to_waellet",e.to_aepp="to_aepp"}(Ac||(Ac={})),function(e){e.window="window",e.extension="extension"}(qc||(qc={})),function(e){e.subscribe="subscribe",e.unsubscribe="unsubscribe"}(Pc||(Pc={})),function(e){e.readyToConnect="connection.announcePresence",e.updateAddress="address.update",e.address="address.get",e.connect="connection.open",e.sign="transaction.sign",e.signMessage="message.sign",e.subscribeAddress="address.subscribe",e.updateNetwork="networkId.update",e.closeConnection="connection.close"}(Ec||(Ec={})),function(e){e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.WAITING_FOR_CONNECTION_REQUEST="WAITING_FOR_CONNECTION_REQUEST"}(Ic||(Ic={}));const kc=[];class Oc extends l{toJSON(){return{code:this.code,message:this.message,data:this.data}}static deserialize(e){const t=kc.find((t=>t.code===e.code));if(null==t)throw new R(`Can't find RpcError with code: ${e.code}`);return new t(e.data)}}class Mc extends Oc{constructor(e){super("Invalid transaction"),Nc(this,"code",2),this.data=e,this.name="RpcInvalidTransactionError"}}Nc(Mc,"code",2),kc.push(Mc);class Rc extends Oc{constructor(e){super("Broadcast failed"),Nc(this,"code",3),this.data=e,this.name="RpcBroadcastError"}}Nc(Rc,"code",3),kc.push(Rc);class Bc extends Oc{constructor(e){super("Operation rejected by user"),Nc(this,"code",4),this.data=e,this.name="RpcRejectedByUserError"}}Nc(Bc,"code",4),kc.push(Bc);class jc extends Oc{constructor(){super("Unsupported Protocol Version"),Nc(this,"code",5),this.name="RpcUnsupportedProtocolError"}}Nc(jc,"code",5),kc.push(jc);class Dc extends Oc{constructor(e){super("Wallet deny your connection request"),Nc(this,"code",9),this.data=e,this.name="RpcConnectionDenyError"}}Nc(Dc,"code",9),kc.push(Dc);class Fc extends Oc{constructor(){super("You are not connected to the wallet"),Nc(this,"code",10),this.name="RpcNotAuthorizeError"}}Nc(Fc,"code",10),kc.push(Fc);class $c extends Oc{constructor(e){super(`You are not subscribed for account ${e}`),Nc(this,"code",11),this.data=e,this.name="RpcPermissionDenyError"}}Nc($c,"code",11),kc.push($c);class Uc extends Oc{constructor(){super("The peer failed to execute your request due to unknown error"),Nc(this,"code",12),this.name="RpcInternalError"}}Nc(Uc,"code",12),kc.push(Uc);class Vc extends Oc{constructor(){super("Method not found"),Nc(this,"code",-32601),this.name="RpcMethodNotFoundError"}}Nc(Vc,"code",-32601),kc.push(Vc);var Hc=w(9408).Buffer;class Lc extends zc{constructor(e,t){super(),this._rpcClient=e,this.address=t}async sign(){throw new O("RAW signing using wallet")}async signTransaction(e){let{innerTx:t,networkId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new O("innerTx option in AccountRpc");if(null==n)throw new b("networkId","provided",n);const r=await this._rpcClient.request(Ec.sign,{onAccount:this.address,tx:e,returnSigned:!0,networkId:n});if(null==r.signedTransaction)throw new k("signedTransaction is missed in wallet response");return r.signedTransaction}async signMessage(e){const{signature:t}=await this._rpcClient.request(Ec.signMessage,{onAccount:this.address,message:e});return Hc.from(t,"hex")}}function Gc(e,t){Kc(e,t),t.add(e)}function Wc(e,t,n){Kc(e,t),t.set(e,n)}function Kc(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qc(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Yc=new WeakMap,Jc=new WeakMap,Xc=new WeakMap,Zc=new WeakSet,eu=new WeakSet,tu=new WeakSet,nu=new WeakSet;class ru{constructor(e,t,n){Gc(this,nu),Gc(this,tu),Gc(this,eu),Gc(this,Zc),Wc(this,Yc,{writable:!0,value:new Map}),Wc(this,Jc,{writable:!0,value:0}),Wc(this,Xc,{writable:!0,value:void 0}),this.connection=e,Mn(this,Xc,n),e.connect(Qc(this,Zc,au).bind(this),t)}async request(e,t){return Qc(this,eu,iu).call(this,Mn(this,Jc,Rn(this,Jc)+1),e,t),new Promise(((e,t)=>{Rn(this,Yc).set(Rn(this,Jc),{resolve:e,reject:t})}))}notify(e,t){Qc(this,eu,iu).call(this,void 0,e,t)}}async function au(e,t){if("2.0"!==e?.jsonrpc)throw new U(JSON.stringify(e));if("result"in e||"error"in e)return void Qc(this,nu,su).call(this,e);const n=e;let r,a;try{if(!(n.method in Rn(this,Xc)))throw new Vc;const e=n.method;r=await Rn(this,Xc)[e](n.params,t)}catch(e){a=e instanceof Oc?e:new Uc}null!=n.id&&Qc(this,tu,ou).call(this,n.id,n.method,r,a)}function iu(e,t,n){this.connection.sendMessage({jsonrpc:"2.0",...null!=e?{id:e}:{},method:t,...null!=n?{params:n}:{}})}function ou(e,t,n,r){this.connection.sendMessage({jsonrpc:"2.0",id:e,method:t,...null!=r?{error:r.toJSON()}:{result:n}})}function su(e){let{id:t,error:n,result:r}=e;const a=Rn(this,Yc).get(t);if(null==a)throw new V(t);null!=n?a.reject(Oc.deserialize(n)):a.resolve(r),Rn(this,Yc).delete(t)}class cu extends Tc{constructor(e){let{name:t,onAddressChange:n=(()=>{}),onDisconnect:r=(()=>{}),onNetworkChange:a=(()=>{}),...i}=e;super(i),this.onAddressChange=n,this.onDisconnect=r,this.onNetworkChange=a,this.name=t}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.addresses()[0];if("string"==typeof e){const t=e;if(ht(t),!this.addresses().includes(t))throw new H(t);this._ensureConnected(),e=new Lc(this.rpcClient,t)}return null==e&&this._ensureAccountAccess(),super._resolveAccount(e)}addresses(){if(null==this._accounts)return[];const e=Object.keys(this._accounts.current)[0];return[...null!=e?[e]:[],...Object.keys(this._accounts.connected)]}async connectToWallet(e){let t,{connectNode:n=!1,name:r="wallet-node",select:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=this.rpcClient)throw new Ie("You are already connected to wallet");const i=new ru(e,(()=>{delete this.rpcClient,delete this._accounts,this.onDisconnect(t)}),{[Ec.updateAddress]:e=>{this._accounts=e,this.onAddressChange(e)},[Ec.updateNetwork]:e=>{const{node:t}=e;null!=t&&this.addNode(t.name,new Bo(t.url),!0),this.onNetworkChange(e)},[Ec.closeConnection]:e=>{t=e,i.connection.disconnect()},[Ec.readyToConnect]:()=>{}}),{node:o,...s}=await i.request(Ec.connect,{name:this.name,version:1,connectNode:n});if(n){if(null==o)throw new Oe("Missing URLs of the Node");this.addNode(r,new Bo(o.url),a)}return this.rpcClient=i,s}disconnectWallet(){this._ensureConnected(),this.rpcClient.notify(Ec.closeConnection,{reason:"bye"}),this.rpcClient.connection.disconnect()}async askAddresses(){return this._ensureAccountAccess(),this.rpcClient.request(Ec.address,void 0)}async subscribeAddress(e,t){this._ensureConnected();const n=await this.rpcClient.request(Ec.subscribeAddress,{type:e,value:t});return this._accounts=n.address,n}_ensureConnected(){if(null==this.rpcClient)throw new ke("You are not connected to Wallet")}_ensureAccountAccess(){if(this._ensureConnected(),0===this.addresses().length)throw new G}}var uu=w(2716);const lu=w.n(uu)()({storeAsString:!0}),du=e=>{if("object"==typeof e&&null!==e&&e.constructor===Object)return We(e,(e=>{let[t,n]=e;return[t,du(n)]}));if(Array.isArray(e))return e.map((e=>du(e)));if("string"==typeof e&&new(c())(e).toString(10)===e){const t=new(c())(e);return t.toJSON=()=>t.toString(10),t}return e};var pu={stringify:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return lu.stringify(du(t[0]),...t.slice(1))},parse:lu.parse},mu=w(9408).Buffer;class hu extends _c{constructor(e){let{name:t,id:n,type:r,onConnection:a,onSubscription:i,onDisconnect:o,onAskAccounts:s,...c}=e;super(c),Nc(this,"_clients",new Map),this.onConnection=a,this.onSubscription=i,this.onDisconnect=o,this.onAskAccounts=s,this.name=t,this.id=n,this._type=r}_pushAccountsToApps(){null!=this._clients&&Array.from(this._clients.keys()).filter((e=>this._isRpcClientSubscribed(e))).map((e=>this._getClient(e).rpc)).forEach((e=>e.notify(Ec.updateAddress,this.getAccounts())))}selectAccount(e){super.selectAccount(e),this._pushAccountsToApps()}addAccount(e,t){super.addAccount(e,t),this._pushAccountsToApps()}_getNode(){return this.ensureNodeConnected(),{node:{url:this.api.$host,name:this.selectedNodeName}}}async selectNode(e){super.selectNode(e);const t=await this.api.getNetworkId();Array.from(this._clients.keys()).filter((e=>this._isRpcClientConnected(e))).map((e=>this._getClient(e))).forEach((e=>{e.rpc.notify(Ec.updateNetwork,{networkId:t,...e.connectNode&&this._getNode()})}))}_getClient(e){const t=this._clients.get(e);if(null==t)throw new L(e);return t}_isRpcClientSubscribed(e){return this._isRpcClientConnected(e)&&0!==this._getClient(e).addressSubscription.size}_isRpcClientConnected(e){return Ic.CONNECTED===this._getClient(e).status&&this._getClient(e).rpc.connection.isConnected()}_disconnectRpcClient(e){const t=this._getClient(e);t.rpc.connection.disconnect(),t.status=Ic.DISCONNECTED,t.addressSubscription=new Set}removeRpcClient(e){this._disconnectRpcClient(e),this._clients.delete(e)}addRpcClient(e){const t=(0,ls.v4)();let n;const r={id:t,status:Ic.WAITING_FOR_CONNECTION_REQUEST,addressSubscription:new Set,connectNode:!1,rpc:new ru(e,(()=>{this._clients.delete(t),this.onDisconnect(t,n)}),{[Ec.closeConnection]:e=>{n=e,this._disconnectRpcClient(t)},[Ec.connect]:async(e,n)=>{let{name:a,version:i,icons:o,connectNode:s}=e;if(1!==i)throw new jc;return await this.onConnection(t,{name:a,icons:o,connectNode:s},n),r.status=Ic.CONNECTED,r.connectNode=s,{...await this.getWalletInfo(),...s&&this._getNode()}},[Ec.subscribeAddress]:async(e,n)=>{let{type:a,value:i}=e;if(!this._isRpcClientConnected(t))throw new Fc;switch(await this.onSubscription(t,{type:a,value:i},n),a){case Pc.subscribe:r.addressSubscription.add(i);break;case Pc.unsubscribe:r.addressSubscription.delete(i);break;default:throw new R(`Unknown subscription type: ${a}`)}return{subscription:Array.from(r.addressSubscription),address:this.getAccounts()}},[Ec.address]:async(e,n)=>{if(!this._isRpcClientSubscribed(t))throw new Fc;return await this.onAskAccounts(t,e,n),this.addresses()},[Ec.sign]:async(e,n)=>{let{tx:r,onAccount:a=this.address,returnSigned:i}=e;if(!this._isRpcClientConnected(t))throw new Fc;if(!this.addresses().includes(a))throw new $c(a);const o={onAccount:a,aeppOrigin:n,aeppRpcClientId:t};if(i)return{signedTransaction:await this.signTransaction(r,o)};try{return pu.parse(pu.stringify({transactionHash:await this.send(r,{...o,verify:!1})}))}catch(e){const t=await Uo(r,this.api);if(t.length>0)throw new Mc(t);throw new Rc(e.message)}},[Ec.signMessage]:async(e,n)=>{let{message:r,onAccount:a=this.address}=e;if(!this._isRpcClientConnected(t))throw new Fc;if(!this.addresses().includes(a))throw new $c(a);const i={onAccount:a,aeppOrigin:n,aeppRpcClientId:t};return{signature:mu.from(await this.signMessage(r,i)).toString("hex")}}})};return this._clients.set(t,r),t}async shareWalletInfo(e){this._getClient(e).rpc.notify(Ec.readyToConnect,await this.getWalletInfo())}async getWalletInfo(){return{id:this.id,name:this.name,networkId:await this.api.getNetworkId(),origin:window.location.origin,type:this._type}}getAccounts(){return{current:null!=this.selectedAddress?{[this.selectedAddress]:{}}:{},connected:this.addresses().filter((e=>e!==this.selectedAddress)).reduce(((e,t)=>({...e,[t]:{}})),{})}}}var fu=w(9408).Buffer;const yu=new WeakMap;class gu extends zc{constructor(e){if(super(),64!==(e="string"==typeof e?fu.from(e,"hex"):e).length)throw new b("secretKey","64 bytes",e.length);yu.set(this,e),this.address=ft(bt(yu.get(this)).publicKey,tt.AccountAddress)}static generate(){return new gu(xt().secretKey)}async sign(e,t){return Tt(e,yu.get(this))}async signTransaction(e){let{innerTx:t,networkId:n,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==n)throw new b("networkId","provided",n);const a=[n];!0===t&&a.push("inner_tx");const i=ht(e),o=Ke([fu.from(a.join("-")),Ct(i)]),s=[await this.sign(o,r)];return Hr({tag:Gt.SignedTx,encodedTx:i,signatures:s})}async signMessage(e,t){return this.sign(zt(e),t)}}var Nu=new WeakMap;class wu extends zc{constructor(e){var t,n,r;super(),r={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t=this,n=Nu),n.set(t,r),ht(e),this.address=e}async sign(){throw new O("Can't sign using generalized account")}async signMessage(){throw new O("Can't sign using generalized account")}async signTransaction(e,t){let{authData:n,onCompiler:r,onNode:a}=t;if(null==n||null==r||null==a)throw new b("authData, onCompiler, onNode","provided",null);const{callData:i,sourceCode:o,args:s,gasLimit:c}=n,u=null!=i?i:await(async()=>{if(null==Rn(this,Nu)){const e=await Yo(this.address,{onNode:a});if("generalized"!==e.kind)throw new b("account kind","generalized",e.kind);Mn(this,Nu,e.authFun)}if(null==Rn(this,Nu))throw new R("Account in generalised, but authFun not provided");if(null==o||null==s)throw new Z("Auth data must contain source code and arguments.");const e=await tc.initialize({onCompiler:r,onNode:a,sourceCode:o});return e._calldata.encode(e._name,Rn(this,Nu),s)})(),l=await vs(Gt.GaMetaTx,{tx:ht(Hr({tag:Gt.SignedTx,encodedTx:ht(e),signatures:[]})),gaId:this.address,authData:u,gasLimit:c,nonce:0,onNode:a});return Hr({tag:Gt.SignedTx,encodedTx:ht(l),signatures:[]})}}var vu=w(9408).Buffer;const Cu=224;class Su extends zc{constructor(e,t,n){super(),this.transport=e,this.index=t,this.address=n,e.decorateAppAPIMethods(this,["signTransaction","signMessage"],"w0w")}async sign(){throw new O("RAW signing using Ledger HW")}async signTransaction(e){let{innerTx:t,networkId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new O("innerTx option in AccountLedger");if(null==n)throw new b("networkId","provided",n);const r=ht(e);let a=0;const i=vu.from(n),o=[];for(;a!==r.length;){const e=0===a?141-i.length:150,t=a+e>r.length?r.length-a:e,n=vu.alloc(0===a?9+i.length+t:t);if(0===a){let e=n.writeUInt32BE(this.index,0);e=n.writeUInt32BE(r.length,e),e=n.writeUInt8(i.length,e),e+=i.copy(n,e,0,i.length),r.copy(n,e,0,150-e)}else r.copy(n,0,a,a+t);o.push(n),a+=t}const s=[(await o.reduce((async(e,t,n)=>(await e,this.transport.send(Cu,4,0===n?0:128,0,t))),Promise.resolve(vu.alloc(0)))).subarray(0,64)];return Hr({tag:Gt.SignedTx,encodedTx:r,signatures:s})}async signMessage(e){let t=0;const n=vu.from(e),r=[];for(;t!==n.length;){const e=0===t?142:150,a=t+e>n.length?n.length-t:e,i=vu.alloc(0===t?8+a:a);0===t?(i.writeUInt32BE(this.index,0),i.writeUInt32BE(n.length,4),n.copy(i,8,t,t+a)):n.copy(i,0,t,t+a),r.push(i),t+=a}return(await r.reduce((async(e,t,n)=>(await e,this.transport.send(Cu,8,0===n?0:128,0,t))),Promise.resolve(vu.alloc(0)))).subarray(0,64)}}var bu=w(9408).Buffer;class xu{constructor(e){this.transport=e,this.versionCheckPromise=this.getAppConfiguration().then((e=>{let{version:t}=e;const n=[t,"0.4.4","0.5.0"];if(!Kr(...n))throw new M("app on ledger",...n)})),e.decorateAppAPIMethods(this,["getAddress","getAppConfiguration"],"w0w")}async getAppConfiguration(){await this.versionCheckPromise;const e=await this.transport.send(Cu,6,0,0);return{version:[e[1],e[2],e[3]].join(".")}}async getAddress(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];await this.versionCheckPromise;const n=bu.alloc(4);n.writeUInt32BE(e,0);const r=await this.transport.send(Cu,2,t?1:0,0,n),a=r[0];return r.subarray(1,1+a).toString("ascii")}async initialize(e){return await this.versionCheckPromise,new Su(this.transport,e,await this.getAddress(e))}async discover(e){let t=0;const n=[];let r;do{null!=r&&n.push(r),r=await this.initialize(t),t+=1}while(await e.getAccountByPubkey(r.address).then((()=>!0),(()=>!1)));return n}}class Tu{}const _u={type:{name:"Composite",className:"Contract",modelProperties:{code:{serializedName:"code",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},zu={type:{name:"Composite",className:"CompileOpts",modelProperties:{fileSystem:{serializedName:"file_system",type:{name:"Dictionary",value:{type:{name:"any"}}}},srcFile:{serializedName:"src_file",type:{name:"String"}}}}},Au={type:{name:"Composite",className:"Aci",modelProperties:{encodedAci:{serializedName:"encoded_aci",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}},externalEncodedAci:{serializedName:"external_encoded_aci",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}},interface:{serializedName:"interface",required:!0,type:{name:"String"}}}}},qu={type:{name:"Composite",className:"CompilerError",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},pos:{serializedName:"pos",type:{name:"Composite",className:"ErrorPos"}},message:{serializedName:"message",required:!0,type:{name:"String"}},context:{serializedName:"context",type:{name:"String"}}}}},Pu={type:{name:"Composite",className:"ErrorPos",modelProperties:{file:{serializedName:"file",type:{name:"String"}},line:{serializedName:"line",required:!0,type:{name:"Number"}},col:{serializedName:"col",required:!0,type:{name:"Number"}}}}},Eu={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Iu={type:{name:"Composite",className:"SophiaCallResultInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},ku={type:{name:"Composite",className:"BytecodeCallResultInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},Ou={type:{name:"Composite",className:"DecodedCallresult",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},Mu={type:{name:"Composite",className:"FunctionCallInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Ru={type:{name:"Composite",className:"Calldata",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}}}}},Bu={type:{name:"Composite",className:"DecodeCalldataBytecode",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},ju={type:{name:"Composite",className:"DecodedCalldata",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},Du={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},Fu={type:{name:"Composite",className:"DecodeCalldataSource",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}}}}},$u={type:{name:"Composite",className:"ByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Uu={type:{name:"Composite",className:"FateAssembler",modelProperties:{fateAssembler:{serializedName:"fate-assembler",required:!0,type:{name:"String"}}}}},Vu={type:{name:"Composite",className:"ValidateByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},Hu={type:{name:"Composite",className:"CompilerVersion",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}}}}},Lu={type:{name:"Composite",className:"ApiVersion",modelProperties:{apiVersion:{serializedName:"api-version",required:!0,type:{name:"String"}}}}},Gu={type:{name:"Composite",className:"SophiaBinaryData",modelProperties:{sophiaType:{serializedName:"sophia-type",required:!0,type:{name:"String"}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},Wu={type:{name:"Composite",className:"SophiaJsonData",modelProperties:{data:{serializedName:"data",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},Ku={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},Qu={parameterPath:"body",mapper:_u},Yu={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Ju={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},Xu={parameterPath:"body",mapper:Iu},Zu={parameterPath:"body",mapper:ku},el={parameterPath:"body",mapper:Mu},tl={parameterPath:"body",mapper:Bu},nl={parameterPath:"body",mapper:Fu},rl={parameterPath:"body",mapper:$u},al={parameterPath:"body",mapper:Vu};class il extends Zr.ServiceClient{constructor(e,t){var n,r;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-compiler/1.0.0-beta.1",i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`,o={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:i},baseUri:null!==(n=null!==(r=t.endpoint)&&void 0!==r?r:t.baseUri)&&void 0!==n?n:"{$host}"};super(o),t?.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===He.bearerTokenAuthenticationPolicyName))||(this.pipeline.removePolicy({name:He.bearerTokenAuthenticationPolicyName}),this.pipeline.addPolicy(He.bearerTokenAuthenticationPolicy({scopes:`${o.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Zr.authorizeRequestOnClaimChallenge}})))),this.$host=e}generateACI(e,t){return this.sendOperationRequest({body:e,options:t},sl)}compileContract(e,t){return this.sendOperationRequest({body:e,options:t},cl)}decodeCallResult(e,t){return this.sendOperationRequest({body:e,options:t},ul)}decodeCallResultBytecode(e,t){return this.sendOperationRequest({body:e,options:t},ll)}encodeCalldata(e,t){return this.sendOperationRequest({body:e,options:t},dl)}decodeCalldataBytecode(e,t){return this.sendOperationRequest({body:e,options:t},pl)}decodeCalldataSource(e,t){return this.sendOperationRequest({body:e,options:t},ml)}getFateAssemblerCode(e,t){return this.sendOperationRequest({body:e,options:t},hl)}validateByteCode(e,t){return this.sendOperationRequest({body:e,options:t},fl)}getCompilerVersion(e,t){return this.sendOperationRequest({body:e,options:t},yl)}version(e){return this.sendOperationRequest({options:e},gl)}apiVersion(e){return this.sendOperationRequest({options:e},Nl)}api(e){return this.sendOperationRequest({options:e},wl)}}const ol=Zr.createSerializer(o,!1),sl={path:"/aci",httpMethod:"POST",responses:{200:{bodyMapper:Au},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Qu,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},cl={path:"/compile",httpMethod:"POST",responses:{200:{bodyMapper:Eu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Qu,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},ul={path:"/decode-call-result",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"any"}}},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Xu,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},ll={path:"/decode-call-result/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:Ou},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Zu,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},dl={path:"/encode-calldata",httpMethod:"POST",responses:{200:{bodyMapper:Ru},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:el,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},pl={path:"/decode-calldata/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:ju},400:{bodyMapper:Du,isError:!0}},requestBody:tl,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},ml={path:"/decode-calldata/source",httpMethod:"POST",responses:{200:{bodyMapper:ju},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:nl,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},hl={path:"/fate-assembler",httpMethod:"POST",responses:{200:{bodyMapper:Uu},400:{bodyMapper:Du,isError:!0}},requestBody:rl,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},fl={path:"/validate-byte-code",httpMethod:"POST",responses:{200:{},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:al,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},yl={path:"/compiler-version",httpMethod:"POST",responses:{200:{bodyMapper:Hu},400:{bodyMapper:Du,isError:!0}},requestBody:rl,urlParameters:[Ju],headerParameters:[Ku,Yu],mediaType:"json",serializer:ol},gl={path:"/version",httpMethod:"GET",responses:{200:{bodyMapper:Hu},500:{bodyMapper:Du,isError:!0}},urlParameters:[Ju],headerParameters:[Yu],serializer:ol},Nl={path:"/api-version",httpMethod:"GET",responses:{200:{bodyMapper:Lu},500:{bodyMapper:Du,isError:!0}},urlParameters:[Ju],headerParameters:[Yu],serializer:ol},wl={path:"/api",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Dictionary",value:{type:{name:"any"}}}}},400:{bodyMapper:Du,isError:!0}},urlParameters:[Ju],headerParameters:[Yu],serializer:ol};class vl extends Tu{constructor(e){let{ignoreVersion:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.api=new il(e,{allowInsecureConnection:!0,additionalPolicies:[Jr((e=>{let t="";return"reason"in e&&(t+=` ${e.reason}${null!=e.parameter?` in ${e.parameter}`:""}${null!=e.info?` (${JSON.stringify(e.info)})`:""}`),Array.isArray(e)&&(t+=`\n${e.map((e=>`${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${null!=e.context?`(${e.context})`:""}`)).join("\n")}`),t}))]}),!0!==t){const e=this.api.apiVersion().then((e=>{let{apiVersion:t}=e;return t}));this.api.pipeline.addPolicy(Xr("compiler","/api-version",e,"7.0.1","8.0.0"))}}async compileBySourceCode(e,t){try{const[n,r]=await Promise.all([this.api.compileContract({code:e,options:{fileSystem:t}}).then((e=>e.bytecode)),this.api.generateACI({code:e,options:{fileSystem:t}})]);return{bytecode:n,aci:r}}catch(e){if(e instanceof He.RestError&&400===e.statusCode)throw new f(e.message.replace(/^aci error:/,"compile error:"));throw e}}async compile(e){throw new O("File system access, use CompilerHttpNode instead")}async validateBySourceCode(e,t,n){try{return await this.api.validateByteCode({bytecode:e,source:t,options:{fileSystem:n}}),!0}catch{return!1}}async validate(e,t){throw new O("File system access, use CompilerHttpNode instead")}async version(){return(await this.api.version()).version}}function Cl(e){return e.replace(/_./g,(e=>e[1].toUpperCase()))}var Sl=w(8079);function bl(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const[a,...i]=n;e._eventEmitter.emit(a,...i)}function xl(e,t){if(null==t)throw new X;e._fsm=t,null!=t?.handler?.enter&&t.handler.enter(e),ql(e)}function Tl(e,t){t!==e._status&&(e._status=t,bl(e,"statusChanged",t))}function _l(e,t){e._state=t,bl(e,"stateChanged",t)}function zl(e,t){e._options.debug&&console.log("Send message: ",t),e._websocket.send(pu.stringify({jsonrpc:"2.0",...t}))}function Al(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};zl(e,{method:t,params:n})}async function ql(e){if(e._isActionQueueLocked)return;const t=e._actionQueue;if(0===t.length)return;const n=t.findIndex((t=>t.guard(e,e._fsm)));if(-1===n)return;e._actionQueue=t.filter(((e,t)=>n!==t)),e._isActionQueueLocked=!0;const r=await t[n].action(e,e._fsm);e._isActionQueueLocked=!1,xl(e,r)}async function Pl(e,t){const{handler:n,state:r}=e._fsm;xl(e,await Promise.resolve(n(e,t,r)))}function El(e){e._websocket.close(),clearTimeout(e._pingTimeoutId)}function Il(e){clearTimeout(e._pingTimeoutId),e._pingTimeoutId=setTimeout((()=>{Al(e,"channels.system",{action:"ping"}),e._pingTimeoutId=setTimeout((()=>{El(e),bl(e,"error",new Q)}),15e3)}),1e4)}async function kl(e,t,n){return new Promise(((r,a)=>{const i=e._nextRpcMessageId;e._nextRpcMessageId+=1,e._rpcCallbacks.set(i,(e=>{if(null!=e.error){var t;const n=null!==(t=e.error.data[0].message)&&void 0!==t?t:"";a(new W(e.error.message+n))}else r(e.result)})),zl(e,{method:t,id:i,params:n})}))}async function Ol(e,t,n,r){var a;let i;if(null!=n.tx)i=await r(n.tx);else{if(null==n.signed_tx)throw new h("Can't find transaction in message");i=await async function(e,t){const{signatures:n,encodedTx:r}=Lr(e,Gt.SignedTx),a=Hr(r),i=await t(a);if("string"==typeof i){const{signatures:e}=Lr(i,Gt.SignedTx);return Hr({tag:Gt.SignedTx,signatures:n.concat(e),encodedTx:ht(a)})}return i}(n.signed_tx,r)}const o="string"!=typeof i,s=null!=n.tx?"tx":"signed_tx";return Al(e,t,o?{error:null!==(a=i)&&void 0!==a?a:1}:{[s]:i}),o}function Ml(e,t,n){return n?.reject?.(Object.assign(new Y(`Unexpected message received:\n\n${JSON.stringify(t)}`),{wsMessage:t})),{handler:Ul}}function Rl(e,t,n,r){if(null!=r&&"channels.update"===t.method)return r(e,t,n);if("channels.conflict"===t.method)return n.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Ul};if("channels.info"===t.method&&"aborted_update"===t.params.data.event)return n.resolve({accepted:!1}),{handler:Ul};if(null!=t.error){const e=t.error.data.map((e=>e.code));return e.includes(1001)?n.reject(new _("Insufficient balance")):e.includes(1002)?n.reject(new x("Amount cannot be negative")):n.reject(new K(t.error.message)),{handler:Ul}}return Ml(0,t,n)}function Bl(e,t){if("channels.info"===t.method){const n=t.params.data.event;let r=null;return"channel_accept"===n&&(r="accepted"),"funding_created"===n&&(r="halfSigned"),null!=r?(Tl(e,r),{handler:Dl}):"channel_reestablished"===t.params.data.event?{handler:$l}:"fsm_up"===t.params.data.event?(e._fsmId=t.params.data.fsm_id,{handler:Bl}):{handler:Bl}}if("channels.error"===t.method)return bl(e,"error",new K(t?.payload?.message)),{handler:Gl}}async function jl(e,t,n){return"channels.info"===t.method&&"fsm_up"===t.params.data.event?(e._fsmId=t.params.data.fsm_id,_l(e,(await e.state()).signedTx),{handler:Ul}):Ml(0,t,n)}async function Dl(e,t){const n="initiator"===e._options.role?"initiator_sign":"responder_sign";if(t.method===`channels.sign.${n}`)return await Ol(e,`channels.${n}`,t.params.data,(async t=>e._options.sign(n,t))),{handler:Fl}}function Fl(e,t){if("channels.on_chain_tx"===t.method){const{info:n}=t.params.data,{role:r}=e._options;if("funding_signed"===n&&"initiator"===r||"funding_created"===n&&"responder"===r)return{handler:function t(n,r){if("channels.info"===r.method)switch(r.params.data.event){case"funding_created":case"own_funding_locked":return{handler:t};case"funding_locked":return{handler:$l}}if("channels.on_chain_tx"===r.method)return bl(e,"onChainTx",r.params.data.tx,{info:r.params.data.info,type:r.params.data.type}),{handler:t}}}}if("channels.info"===t.method&&"funding_signed"===t.params.data.event&&"initiator"===e._options.role)return e._channelId=t.params.channel_id,Tl(e,"signed"),{handler:Fl}}function $l(e,t){if("channels.info"===t.method&&"open"===t.params.data.event)return e._channelId=t.params.channel_id,{handler(t,n){if("channels.update"===n.method)return _l(e,n.params.data.state),{handler:Ul}}}}async function Ul(e,t,n){switch(t.method){case"channels.info":switch(t.params.data.event){case"update":case"withdraw_created":case"deposit_created":return{handler:Vl};case"own_withdraw_locked":case"withdraw_locked":case"own_deposit_locked":case"deposit_locked":case"peer_disconnected":case"channel_reestablished":case"open":return bl(e,t.params.data.event),{handler:Ul};case"fsm_up":return e._fsmId=t.params.data.fsm_id,{handler:Ul};case"timeout":case"close_mutual":case"shutdown":return{handler:Ul};case"closing":return Tl(e,"closing"),{handler:Ul};case"closed_confirmed":return Tl(e,"closed"),{handler:Gl};case"died":return Tl(e,"died"),{handler:Gl}}break;case"channels.on_chain_tx":return bl(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),{handler:Ul};case"channels.leave":return{handler:Ul};case"channels.update":return _l(e,t.params.data.state),{handler:Ul};case"channels.sign.shutdown_sign_ack":return Vl(e,t,n)}}async function Vl(e,t,n){var r;const[,a]=null!==(r=t.method.match(/^channels\.sign\.([^.]+)$/))&&void 0!==r?r:[];return null==a?Ml(0,t,n):await Ol(e,`channels.${a}`,t.params.data,(async n=>e._options.sign(a,n,{updates:t.params.data.updates})))?{handler:function e(t,r){return null!=r.error?{handler:e,state:n}:"channels.conflict"===r.method?{handler:Ul}:Ml(0,r,n)},state:n}:{handler:Ul}}async function Hl(e,t,n){return"channels.sign.shutdown_sign"!==t.method?Ml(0,t,n):(await Ol(e,"channels.shutdown_sign",t.params.data,(async e=>n.sign(e))),{handler(e,t){return"channels.on_chain_tx"!==t.method?Ml(0,t,n):{handler:Gl,state:n}},state:n})}function Ll(e,t,n){return"channels.leave"===t.method?(n.resolve({channelId:t.params.channel_id,signedTx:t.params.data.state}),El(e),{handler:Gl}):"channels.error"===t.method?(n.reject(new K(t.data.message)),{handler:Ul}):Ml(0,t,n)}function Gl(e,t,n){return null==n?{handler:Gl}:"closing"===t.params.data.event?{handler:Gl,state:n}:"channel_closed"===t.params.data.info?(n.closeTx=t.params.data.tx,{handler:Gl,state:n}):"closed_confirmed"===t.params.data.event?(n.resolve(n.closeTx),{handler:Gl}):{handler:Gl,state:n}}Ul.enter=e=>{Tl(e,"open")};var Wl=w(3735);class Kl{constructor(){Nc(this,"_eventEmitter",new Wl.EventEmitter),Nc(this,"_nextRpcMessageId",0),Nc(this,"_rpcCallbacks",new Map),Nc(this,"_messageQueue",[]),Nc(this,"_isMessageQueueLocked",!1),Nc(this,"_actionQueue",[]),Nc(this,"_isActionQueueLocked",!1),Nc(this,"_status","disconnected")}static async initialize(e){return Kl._initialize(new Kl,e)}static async _initialize(e,t){return await async function(e,t,n,r){let{url:a,...i}=r;e._options={url:a,...i},e._fsm={handler:t};const o=new URL(a);Object.entries(i).filter((e=>{let[t]=e;return!["sign","debug"].includes(t)})).forEach((e=>{let[t,n]=e;return o.searchParams.set(t.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),n.toString())})),o.searchParams.set("protocol","json-rpc"),Tl(e,"connecting"),e._websocket=new Sl.w3cwebsocket(o.toString()),await new Promise(((t,r)=>{Object.assign(e._websocket,{onerror:r,onopen:async()=>{if(t(),Tl(e,"connected"),null!=i.reconnectTx){xl(e,{handler:n});const{signedTx:t}=await e.state();_l(e,t)}Il(e)},onclose:()=>{Tl(e,"disconnected"),clearTimeout(e._pingTimeoutId)},onmessage:t=>{let{data:n}=t;return function(e,t){const n=pu.parse(t);if(e._options.debug&&console.log("Receive message: ",n),null==n.id)"channels.message"!==n.method?"channels.system.pong"!==n.method?(e._messageQueue.push(n),async function(e){if(!e._isMessageQueueLocked){for(e._isMessageQueueLocked=!0;e._messageQueue.length>0;){const t=e._messageQueue.shift();if(null==t)throw new B;try{await Pl(e,t)}catch(n){bl(e,"error",new J(n,t))}}e._isMessageQueueLocked=!1}}(e)):n.params.channel_id!==e._channelId&&null!=e._channelId||Il(e):bl(e,"message",n.params.data.message);else{const t=e._rpcCallbacks.get(n.id);if(null==t)return void bl(e,"error",new h(`Can't find callback by id: ${n.id}`));try{t(n)}finally{e._rpcCallbacks.delete(n.id)}}}(e,n)}})}))}(e,null!=t.existingFsmId?jl:Bl,Ul,t),e}on(e,t){this._eventEmitter.on(e,t)}off(e,t){this._eventEmitter.removeListener(e,t)}disconnect(){return El(this)}status(){return this._status}async state(){return e=await kl(this,"channels.get.offchain_state",{}),Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return{...e,[Cl(n)]:r}}),{});var e}round(){if(null==this._state)return null;const{tag:e,round:t}=Lr(this._state,Gt.SignedTx).encodedTx;switch(e){case Gt.ChannelCreateTx:return 1;case Gt.ChannelOffChainTx:case Gt.ChannelWithdrawTx:case Gt.ChannelDepositTx:return t;default:return null}}id(){if(null==this._channelId)throw new h("Channel is not initialized");return this._channelId}fsmId(){if(null==this._fsmId)throw new h("Channel is not initialized");return this._fsmId}async enqueueAction(e){return async function(e,t,n){const r=new Promise(((r,a)=>{e._actionQueue.push({guard:t,action(){const e=n();return{...e,state:{...e.state,resolve:r,reject:a}}}})}));return ql(e),r}(this,((e,t)=>t?.handler===Ul),e)}async leave(){return this.enqueueAction((()=>(Al(this,"channels.leave"),{handler:Ll})))}async shutdown(e){return this.enqueueAction((()=>(Al(this,"channels.shutdown"),{handler:Hl,state:{sign:e}})))}static async reconnect(e,t){const{sign:n}=e;return Kl.initialize({...e,reconnectTx:await n("reconnect",Hr({...t,tag:Gt.ChannelClientReconnectTx}))})}}class Ql extends Kl{async update(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return this.enqueueAction((()=>{Al(this,"channels.update.new",{from:e,to:t,amount:n,meta:a});const i=async(e,t,n)=>"channels.sign.update"===t.method?await Ol(this,"channels.update",t.params.data,(async e=>r(e,{updates:t.params.data.updates})))?{handler:i,state:n}:{handler:(e,t)=>Rl(this,t,n,(()=>(_l(this,t.params.data.state),n.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Ul}))),state:n}:"channels.error"===t.method?(n.reject(new K(t.data.message)),{handler:Ul}):Rl(this,t,n);return{handler:i}}))}async poi(e){let{accounts:t,contracts:n}=e;return Lr((await kl(this,"channels.get.poi",{accounts:t,contracts:n})).poi,Gt.TreesPoi)}async balances(e){return Object.fromEntries((await kl(this,"channels.get.balances",{accounts:e})).map((e=>[e.account,e.balance])))}async awaitingActionTx(e,t,n){if(t.method!==`channels.sign.${e}_tx`)return Ml(0,t,n);const r=(t,a)=>{if("channels.on_chain_tx"===a.method)return n.onOnChainTx?.(a.params.data.tx),{handler:r,state:n};if("channels.info"===a.method&&[`own_${e}_locked`,`${e}_locked`].includes(a.params.data.event)){const t="deposit"===e?"Deposit":"Withdraw",i=a.params.data.event.startsWith("own_");return n[`on${i?"Own":""}${t}Locked`]?.(),{handler:r,state:n}}return Rl(this,a,n,(()=>(_l(this,a.params.data.state),n.resolve({accepted:!0,signedTx:a.params.data.state}),{handler:Ul})))},{sign:a}=n;return await Ol(this,`channels.${e}_tx`,t.params.data,(async e=>a(e,{updates:t.params.data.updates}))),{handler:r,state:n}}async withdraw(e,t){let{onOnChainTx:n,onOwnWithdrawLocked:r,onWithdrawLocked:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(Al(this,"channels.withdraw",{amount:e}),{handler:async(e,t,n)=>this.awaitingActionTx("withdraw",t,n),state:{sign:t,onOnChainTx:n,onOwnWithdrawLocked:r,onWithdrawLocked:a}})))}async deposit(e,t){let{onOnChainTx:n,onOwnDepositLocked:r,onDepositLocked:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(Al(this,"channels.deposit",{amount:e}),{handler:async(e,t,n)=>this.awaitingActionTx("deposit",t,n),state:{sign:t,onOnChainTx:n,onOwnDepositLocked:r,onDepositLocked:a}})))}async sendMessage(e,t){const n="object"==typeof e?JSON.stringify(e):e;"connecting"===this.status()&&(await new Promise((e=>{const t=n=>{"connecting"!==n&&(e(),this.off("statusChanged",t))};this.on("statusChanged",t)})),await Ge(500)),Al(this,"channels.message",{info:n,to:t})}}function Yl(e){return Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return{...e,[Cl(n)]:r}}),{})}class Jl extends Ql{static async initialize(e){return Kl._initialize(new Jl,e)}async createContract(e,t){let{code:n,callData:r,deposit:a,vmVersion:i,abiVersion:o}=e;return this.enqueueAction((()=>(Al(this,"channels.update.new_contract",{code:n,call_data:r,deposit:a,vm_version:i,abi_version:o}),{handler:async(e,t,n)=>"channels.sign.update"!==t.method?Ml(0,t,n):(await Ol(this,"channels.update",t.params.data,(async e=>n.sign(e))),{handler:(e,t,n)=>Rl(this,t,n,(()=>{const{round:e}=Lr(t.params.data.state,Gt.SignedTx).encodedTx,r="initiator"===this._options.role?"initiatorId":"responderId",a=this._options[r];return _l(this,t.params.data.state),n.resolve({accepted:!0,address:St(a,e),signedTx:t.params.data.state}),{handler:Ul}})),state:n}),state:{sign:t}})))}async callContract(e,t){let{amount:n,callData:r,contract:a,abiVersion:i}=e;return this.enqueueAction((()=>(Al(this,"channels.update.call_contract",{amount:n,call_data:r,contract_id:a,abi_version:i}),{handler:async(e,t,n)=>"channels.sign.update"!==t.method?Ml(0,t,n):(await Ol(this,"channels.update",t.params.data,(async e=>n.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,n)=>Rl(this,t,n,(()=>(_l(this,t.params.data.state),n.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Ul}))),state:n}),state:{sign:t}})))}async forceProgress(e,t){let{amount:n,callData:r,contract:a,abiVersion:i,gasLimit:o=1e6,gasPrice:s=Rt}=e,{onOnChainTx:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(Al(this,"channels.force_progress",{amount:n,call_data:r,contract_id:a,abi_version:i,gas_price:s,gas:o}),{handler:async(e,t,n)=>"channels.sign.force_progress_tx"!==t.method?Ml(0,t,n):(await Ol(this,"channels.force_progress_sign",t.params.data,(async e=>n.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,n)=>("channels.on_chain_tx"===t.method&&(n.onOnChainTx?.(t.params.data.tx),bl(this,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),n.resolve({accepted:!0,tx:t.params.data.tx})),Ml(0,t,n)),state:n}),state:{sign:t,onOnChainTx:c}})))}async callContractStatic(e){let{amount:t,callData:n,contract:r,abiVersion:a}=e;return Yl(await kl(this,"channels.dry_run.call_contract",{amount:t,call_data:n,contract_id:r,abi_version:a}))}async getContractCall(e){let{caller:t,contract:n,round:r}=e;return Yl(await kl(this,"channels.get.contract_call",{caller_id:t,contract_id:n,round:r}))}async getContractState(e){const t=await kl(this,"channels.get.contract",{pubkey:e});return Yl({...t,contract:Yl(t.contract)})}async cleanContractCalls(){return this.enqueueAction((()=>(Al(this,"channels.clean_contract_calls"),{handler(e,t,n){return"channels.calls_pruned.reply"===t.method?(n.resolve(),{handler:Ul}):(n.reject(new Y("Unexpected message received")),{handler:Gl})}})))}}var Xl=(e,t)=>(e.connect((e=>t.sendMessage(e)),(()=>t.disconnect())),t.connect((t=>e.sendMessage(t)),(()=>e.disconnect())),()=>{e.disconnect(),t.disconnect()});class Zl{constructor(e){let{debug:t=!1}=e;this.debug=t}connect(e,t){if(this.isConnected())throw new Ie("You already connected")}disconnect(){if(!this.isConnected())throw new ke("You dont have connection. Please connect before")}receiveMessage(e){this.debug&&console.log("Receive message:",e)}sendMessage(e){this.debug&&console.log("Send message:",e)}}function ed(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var td=new WeakMap,nd=new WeakMap,rd=new WeakMap;class ad extends Zl{constructor(){let{target:e,self:t=window,origin:n,sendDirection:r,receiveDirection:a=Ac.to_aepp,...i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(i),ed(this,td,{writable:!0,value:void 0}),ed(this,nd,{writable:!0,value:void 0}),ed(this,rd,{writable:!0,value:void 0}),Mn(this,nd,e),Mn(this,rd,t),this.origin=n,this.sendDirection=r,this.receiveDirection=a}isConnected(){return null!=this.listener}connect(e,t){super.connect(e,t),this.listener=t=>{var n;if("object"!=typeof t.data||"2.0"!==(null!==(n=t.data.jsonrpc)&&void 0!==n?n:t.data.data?.jsonrpc))return;if(null!=this.origin&&this.origin!==t.origin)return;if(null!=Rn(this,nd)&&Rn(this,nd)!==t.source)return;this.receiveMessage(t);let{data:r}=t;if(null!=r.type){if(t.data.type!==this.receiveDirection)return;r=r.data}e(r,t.origin,t.source)},Rn(this,rd).addEventListener("message",this.listener),Mn(this,td,t)}disconnect(){if(super.disconnect(),null==this.listener||null==Rn(this,td))throw new R("Expected to not happen, required for TS");Rn(this,rd).removeEventListener("message",this.listener),delete this.listener,Rn(this,td).call(this),Mn(this,td,void 0)}sendMessage(e){var t;if(null==Rn(this,nd))throw new Oe("Can't send messages without target");const n=null!=this.sendDirection?{type:this.sendDirection,data:e}:e;super.sendMessage(n),Rn(this,nd).postMessage(n,null!==(t=this.origin)&&void 0!==t?t:"*")}}var id=(e,t)=>{if(null==window)throw new I("Window object not found, you can run wallet detector only in browser");const n={};return e.connect(((e,r,a)=>{let{method:i,params:o}=e;if(i!==Ec.readyToConnect||null!=n[o.id])return;const s={info:o,getConnection(){const e="extension"===o.type;return new ad({sendDirection:e?Ac.to_waellet:void 0,receiveDirection:e?Ac.to_aepp:void 0,target:a,origin:e?window.origin:o.origin})}};n[s.info.id]=s,t({wallets:n,newWallet:s})}),(()=>{})),Object.keys(n).length>0&&t({wallets:n}),()=>e.disconnect()};var od=new WeakMap;class sd extends Zl{constructor(e){let{port:t,...n}=e;var r,a,i;super(n),i={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(r=this,a=od),a.set(r,i),this.port=t}disconnect(){if(super.disconnect(),this.port.disconnect(),null==Rn(this,od))throw new B;this.port.onMessage.removeListener(Rn(this,od)[0]),this.port.onDisconnect.removeListener(Rn(this,od)[1]),Mn(this,od,void 0)}connect(e,t){super.connect(e,t),Mn(this,od,[(t,n)=>{var r;this.receiveMessage(t),e(t,null!==(r=n.sender?.url)&&void 0!==r?r:"",n)},t]),this.port.onMessage.addListener(Rn(this,od)[0]),this.port.onDisconnect.addListener(Rn(this,od)[1])}sendMessage(e){super.sendMessage(e),this.port.postMessage(e)}isConnected(){return null!=Rn(this,od)}}}(),v}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@azure/core-rest-pipeline"),require("buffer"),require("rlp"),require("bignumber.js"),require("bs58"),require("tweetnacl"),require("varuint-bitcoin"),require("@azure/core-client"),require("@aeternity/uuid"),require("@aeternity/argon2"),require("tweetnacl-auth"),require("bip32-path"),require("aes-js"),require("@aeternity/aepp-calldata"),require("json-bigint"),require("events"),require("websocket")):"function"==typeof define&&define.amd?define(["@azure/core-rest-pipeline","buffer","rlp","bignumber.js","bs58","tweetnacl","varuint-bitcoin","@azure/core-client","@aeternity/uuid","@aeternity/argon2","tweetnacl-auth","bip32-path","aes-js","@aeternity/aepp-calldata","json-bigint","events","websocket"],t):"object"==typeof exports?exports.Aeternity=t(require("@azure/core-rest-pipeline"),require("buffer"),require("rlp"),require("bignumber.js"),require("bs58"),require("tweetnacl"),require("varuint-bitcoin"),require("@azure/core-client"),require("@aeternity/uuid"),require("@aeternity/argon2"),require("tweetnacl-auth"),require("bip32-path"),require("aes-js"),require("@aeternity/aepp-calldata"),require("json-bigint"),require("events"),require("websocket")):e.Aeternity=t(e["@azure/core-rest-pipeline"],e.buffer,e.rlp,e["bignumber.js"],e.bs58,e.tweetnacl,e["varuint-bitcoin"],e["@azure/core-client"],e["@aeternity/uuid"],e["@aeternity/argon2"],e["tweetnacl-auth"],e["bip32-path"],e["aes-js"],e["@aeternity/aepp-calldata"],e["json-bigint"],e.events,e.websocket)}(self,(function(e,t,n,r,a,i,o,s,c,u,l,d,p,m,h,f,y){return function(){var g={8442:function(e,t,n){const r=n(9488);function a(e,t,n){const r=e[t]+e[n];let a=e[t+1]+e[n+1];r>=4294967296&&a++,e[t]=r,e[t+1]=a}function i(e,t,n,r){let a=e[t]+n;n<0&&(a+=4294967296);let i=e[t+1]+r;a>=4294967296&&i++,e[t]=a,e[t+1]=i}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,n,r,o,s){const c=d[o],u=d[o+1],p=d[s],m=d[s+1];a(l,e,t),i(l,e,c,u);let h=l[r]^l[e],f=l[r+1]^l[e+1];l[r]=f,l[r+1]=h,a(l,n,r),h=l[t]^l[n],f=l[t+1]^l[n+1],l[t]=h>>>24^f<<8,l[t+1]=f>>>24^h<<8,a(l,e,t),i(l,e,p,m),h=l[r]^l[e],f=l[r+1]^l[e+1],l[r]=h>>>16^f<<16,l[r+1]=f>>>16^h<<16,a(l,n,r),h=l[t]^l[n],f=l[t+1]^l[n+1],l[t]=f>>>31^h<<1,l[t+1]=h>>>31^f<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),d=new Uint32Array(32);function p(e,t){let n=0;for(n=0;n<16;n++)l[n]=e.h[n],l[n+16]=c[n];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),n=0;n<32;n++)d[n]=o(e.b,4*n);for(n=0;n<12;n++)s(0,8,16,24,u[16*n+0],u[16*n+1]),s(2,10,18,26,u[16*n+2],u[16*n+3]),s(4,12,20,28,u[16*n+4],u[16*n+5]),s(6,14,22,30,u[16*n+6],u[16*n+7]),s(0,10,20,30,u[16*n+8],u[16*n+9]),s(2,12,22,24,u[16*n+10],u[16*n+11]),s(4,14,16,26,u[16*n+12],u[16*n+13]),s(6,8,18,28,u[16*n+14],u[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^l[n]^l[n+16]}const m=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(e,t,n,r){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&16!==n.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(r&&16!==r.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const a={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};m.fill(0),m[0]=e,t&&(m[1]=t.length),m[2]=1,m[3]=1,n&&m.set(n,32),r&&m.set(r,48);for(let e=0;e<16;e++)a.h[e]=c[e]^o(m,4*e);return t&&(f(a,t),a.c=128),a}function f(e,t){for(let n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,p(e,!1),e.c=0),e.b[e.c++]=t[n]}function y(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;p(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n);return t}function g(e,t,n,a,i){n=n||64,e=r.normalizeInput(e),a&&(a=r.normalizeInput(a)),i&&(i=r.normalizeInput(i));const o=h(n,t,a,i);return f(o,e),y(o)}e.exports={blake2b:g,blake2bHex:function(e,t,n,a,i){const o=g(e,t,n,a,i);return r.toHex(o)},blake2bInit:h,blake2bUpdate:f,blake2bFinal:y}},9488:function(e){function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,n,r){let a="\n"+e+" = ";for(let i=0;i<n.length;i+=2){if(32===r)a+=t(n[i]).toUpperCase(),a+=" ",a+=t(n[i+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);a+=t(n[i+1]).toUpperCase(),a+=t(n[i]).toUpperCase()}i%6==4?a+="\n"+new Array(e.length+4).join(" "):i<n.length-2&&(a+=" ")}console.log(a)},testSpeed:function(e,t,n){let r=(new Date).getTime();const a=new Uint8Array(t);for(let e=0;e<t;e++)a[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-r)+"ms"),r=i;for(let i=0;i<n;i++){const n=e(a),i=(new Date).getTime(),o=i-r;r=i,console.log("Hashed in "+o+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},3536:function(e,t,n){var r=n(1910);e.exports=r},281:function(e,t,n){var r=n(2547);n(3975),e.exports=r},31:function(e,t,n){var r=n(6509);e.exports=r},7487:function(e,t,n){var r=n(5774);e.exports=r},8171:function(e,t,n){n(6450);var r=n(4058).Object,a=e.exports=function(e,t,n){return r.defineProperty(e,t,n)};r.defineProperty.sham&&(a.sham=!0)},7473:function(e,t,n){n(5906),n(5967),n(5824),n(8555),n(2615),n(1732),n(5903),n(1825),n(8394),n(5915),n(1766),n(2737),n(9911),n(4315),n(3131),n(4714),n(659),n(9120),n(5327),n(1502);var r=n(4058);e.exports=r.Symbol},4227:function(e,t,n){n(6274),n(5967),n(7971),n(1825);var r=n(1477);e.exports=r.f("iterator")},2978:function(e,t,n){n(8084),n(3131);var r=n(1477);e.exports=r.f("toPrimitive")},3685:function(e,t,n){e.exports=n(621)},6600:function(e,t,n){e.exports=n(2201)},9759:function(e,t,n){e.exports=n(7398)},1384:function(e,t,n){e.exports=n(6189)},621:function(e,t,n){var r=n(3536);e.exports=r},2201:function(e,t,n){var r=n(281);n(8783),n(2731),n(5605),n(5799),n(1943),n(6774),n(5414),n(620),n(6172),e.exports=r},7398:function(e,t,n){var r=n(31);e.exports=r},6189:function(e,t,n){var r=n(7487);e.exports=r},4883:function(e,t,n){var r=n(7475),a=n(9826),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not a function")}},1851:function(e,t,n){var r=n(7475),a=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+a(e)+" as a prototype")}},8479:function(e){e.exports=function(){}},6059:function(e,t,n){var r=n(941),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not an object")}},1692:function(e,t,n){var r=n(4529),a=n(9413),i=n(623),o=function(e){return function(t,n,o){var s,c=r(t),u=i(c),l=a(o,u);if(e&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},3610:function(e,t,n){var r=n(6843),a=n(5329),i=n(7026),o=n(9678),s=n(623),c=n(4692),u=a([].push),l=function(e){var t=1==e,n=2==e,a=3==e,l=4==e,d=6==e,p=7==e,m=5==e||d;return function(h,f,y,g){for(var w,N,v=o(h),C=i(v),S=r(f,y),b=s(C),x=0,T=g||c,z=t?T(h,b):n||p?T(h,0):void 0;b>x;x++)if((m||x in C)&&(N=S(w=C[x],x,v),e))if(t)z[x]=N;else if(N)switch(e){case 3:return!0;case 5:return w;case 6:return x;case 2:u(z,w)}else switch(e){case 4:return!1;case 7:u(z,w)}return d?-1:a||l?l:z}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},568:function(e,t,n){var r=n(5981),a=n(9813),i=n(3385),o=a("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},5790:function(e,t,n){var r=n(9413),a=n(623),i=n(5449),o=Array,s=Math.max;e.exports=function(e,t,n){for(var c=a(e),u=r(t,c),l=r(void 0===n?c:n,c),d=o(s(l-u,0)),p=0;u<l;u++,p++)i(d,p,e[u]);return d.length=p,d}},3765:function(e,t,n){var r=n(5329);e.exports=r([].slice)},5693:function(e,t,n){var r=n(1052),a=n(4284),i=n(941),o=n(9813)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(a(t)&&(t===s||r(t.prototype))||i(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},4692:function(e,t,n){var r=n(5693);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},2532:function(e,t,n){var r=n(5329),a=r({}.toString),i=r("".slice);e.exports=function(e){return i(a(e),8,-1)}},9697:function(e,t,n){var r=n(2885),a=n(7475),i=n(2532),o=n(9813)("toStringTag"),s=Object,c="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:c?i(t):"Object"==(r=i(t))&&a(t.callee)?"Arguments":r}},4160:function(e,t,n){var r=n(5981);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},3538:function(e){e.exports=function(e,t){return{value:e,done:t}}},2029:function(e,t,n){var r=n(5746),a=n(5988),i=n(1887);e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},1887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5449:function(e,t,n){"use strict";var r=n(3894),a=n(5988),i=n(1887);e.exports=function(e,t,n){var o=r(t);o in e?a.f(e,o,i(0,n)):e[o]=n}},9202:function(e,t,n){var r=n(5988);e.exports=function(e,t,n){return r.f(e,t,n)}},5929:function(e,t,n){var r=n(2029);e.exports=function(e,t,n,a){return a&&a.enumerable?e[t]=n:r(e,t,n),e}},5609:function(e,t,n){var r=n(1899),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},5746:function(e,t,n){var r=n(5981);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},6616:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},1333:function(e,t,n){var r=n(1899),a=n(941),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},6796:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},3281:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2861:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3385:function(e,t,n){var r,a,i=n(1899),o=n(2861),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(a=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},6759:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6887:function(e,t,n){"use strict";var r=n(1899),a=n(9730),i=n(7484),o=n(7475),s=n(9677).f,c=n(7252),u=n(4058),l=n(6843),d=n(2029),p=n(953),m=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return a(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,a,h,f,y,g,w,N,v,C=e.target,S=e.global,b=e.stat,x=e.proto,T=S?r:b?r[C]:(r[C]||{}).prototype,z=S?u:u[C]||d(u,C,{})[C],_=z.prototype;for(f in t)a=!(n=c(S?f:C+(b?".":"#")+f,e.forced))&&T&&p(T,f),g=z[f],a&&(w=e.dontCallGetSet?(v=s(T,f))&&v.value:T[f]),y=a&&w?w:t[f],a&&typeof g==typeof y||(N=e.bind&&a?l(y,r):e.wrap&&a?m(y):x&&o(y)?i(y):y,(e.sham||y&&y.sham||g&&g.sham)&&d(N,"sham",!0),d(z,f,N),x&&(p(u,h=C+"Prototype")||d(u,h,{}),d(u[h],f,y),e.real&&_&&(n||!_[f])&&d(_,f,y)))}},5981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:function(e,t,n){var r=n(8285),a=Function.prototype,i=a.apply,o=a.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(i):function(){return o.apply(i,arguments)})},6843:function(e,t,n){var r=n(7484),a=n(4883),i=n(8285),o=r(r.bind);e.exports=function(e,t){return a(e),void 0===t?e:i?o(e,t):function(){return e.apply(t,arguments)}}},8285:function(e,t,n){var r=n(5981);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:function(e,t,n){var r=n(8285),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},9417:function(e,t,n){var r=n(5746),a=n(953),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=a(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!r||r&&o(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},5526:function(e,t,n){var r=n(5329),a=n(4883);e.exports=function(e,t,n){try{return r(a(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},7484:function(e,t,n){var r=n(2532),a=n(5329);e.exports=function(e){if("Function"===r(e))return a(e)}},5329:function(e,t,n){var r=n(8285),a=Function.prototype,i=a.call,o=r&&a.bind.bind(i,i);e.exports=r?o:function(e){return function(){return i.apply(e,arguments)}}},626:function(e,t,n){var r=n(4058),a=n(1899),i=n(7475),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(a[e]):r[e]&&r[e][t]||a[e]&&a[e][t]}},3323:function(e,t,n){var r=n(5329),a=n(1052),i=n(7475),o=n(2532),s=n(5803),c=r([].push);e.exports=function(e){if(i(e))return e;if(a(e)){for(var t=e.length,n=[],r=0;r<t;r++){var u=e[r];"string"==typeof u?c(n,u):"number"!=typeof u&&"Number"!=o(u)&&"String"!=o(u)||c(n,s(u))}var l=n.length,d=!0;return function(e,t){if(d)return d=!1,t;if(a(this))return t;for(var r=0;r<l;r++)if(n[r]===e)return t}}}},4229:function(e,t,n){var r=n(4883),a=n(2119);e.exports=function(e,t){var n=e[t];return a(n)?void 0:r(n)}},1899:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},953:function(e,t,n){var r=n(5329),a=n(9678),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(a(e),t)}},7748:function(e){e.exports={}},5463:function(e,t,n){var r=n(626);e.exports=r("document","documentElement")},2840:function(e,t,n){var r=n(5746),a=n(5981),i=n(1333);e.exports=!r&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7026:function(e,t,n){var r=n(5329),a=n(5981),i=n(2532),o=Object,s=r("".split);e.exports=a((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?s(e,""):o(e)}:o},1302:function(e,t,n){var r=n(5329),a=n(7475),i=n(3030),o=r(Function.toString);a(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},5402:function(e,t,n){var r,a,i,o=n(7093),s=n(1899),c=n(941),u=n(2029),l=n(953),d=n(3030),p=n(4262),m=n(7748),h="Object already initialized",f=s.TypeError,y=s.WeakMap;if(o||d.state){var g=d.state||(d.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,r=function(e,t){if(g.has(e))throw f(h);return t.facade=e,g.set(e,t),t},a=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var w=p("state");m[w]=!0,r=function(e,t){if(l(e,w))throw f(h);return t.facade=e,u(e,w,t),t},a=function(e){return l(e,w)?e[w]:{}},i=function(e){return l(e,w)}}e.exports={set:r,get:a,has:i,enforce:function(e){return i(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=a(t)).type!==e)throw f("Incompatible receiver, "+e+" required");return n}}}},1052:function(e,t,n){var r=n(2532);e.exports=Array.isArray||function(e){return"Array"==r(e)}},7475:function(e,t,n){var r=n(6616),a=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===a}:function(e){return"function"==typeof e}},4284:function(e,t,n){var r=n(5329),a=n(5981),i=n(7475),o=n(9697),s=n(626),c=n(1302),u=function(){},l=[],d=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,m=r(p.exec),h=!p.exec(u),f=function(e){if(!i(e))return!1;try{return d(u,l,e),!0}catch(e){return!1}},y=function(e){if(!i(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!m(p,c(e))}catch(e){return!0}};y.sham=!0,e.exports=!d||a((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?y:f},7252:function(e,t,n){var r=n(5981),a=n(7475),i=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n==l||n!=u&&(a(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},2119:function(e){e.exports=function(e){return null==e}},941:function(e,t,n){var r=n(7475),a=n(6616),i=a.all;e.exports=a.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},2529:function(e){e.exports=!0},6664:function(e,t,n){var r=n(626),a=n(7475),i=n(7046),o=n(2302),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&i(t.prototype,s(e))}},3847:function(e,t,n){"use strict";var r=n(5143).IteratorPrototype,a=n(9290),i=n(1887),o=n(904),s=n(2077),c=function(){return this};e.exports=function(e,t,n,u){var l=t+" Iterator";return e.prototype=a(r,{next:i(+!u,n)}),o(e,l,!1,!0),s[l]=c,e}},5105:function(e,t,n){"use strict";var r=n(6887),a=n(8834),i=n(2529),o=n(9417),s=n(7475),c=n(3847),u=n(249),l=n(8929),d=n(904),p=n(2029),m=n(5929),h=n(9813),f=n(2077),y=n(5143),g=o.PROPER,w=o.CONFIGURABLE,N=y.IteratorPrototype,v=y.BUGGY_SAFARI_ITERATORS,C=h("iterator"),S="keys",b="values",x="entries",T=function(){return this};e.exports=function(e,t,n,o,h,y,z){c(n,t,o);var _,A,q,P=function(e){if(e===h&&M)return M;if(!v&&e in k)return k[e];switch(e){case S:case b:case x:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",I=!1,k=e.prototype,O=k[C]||k["@@iterator"]||h&&k[h],M=!v&&O||P(h),B="Array"==t&&k.entries||O;if(B&&(_=u(B.call(new e)))!==Object.prototype&&_.next&&(i||u(_)===N||(l?l(_,N):s(_[C])||m(_,C,T)),d(_,E,!0,!0),i&&(f[E]=T)),g&&h==b&&O&&O.name!==b&&(!i&&w?p(k,"name",b):(I=!0,M=function(){return a(O,this)})),h)if(A={values:P(b),keys:y?M:P(S),entries:P(x)},z)for(q in A)(v||I||!(q in k))&&m(k,q,A[q]);else r({target:t,proto:!0,forced:v||I},A);return i&&!z||k[C]===M||m(k,C,M,{name:h}),f[t]=M,A}},5143:function(e,t,n){"use strict";var r,a,i,o=n(5981),s=n(7475),c=n(941),u=n(9290),l=n(249),d=n(5929),p=n(9813),m=n(2529),h=p("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(a=l(l(i)))!==Object.prototype&&(r=a):f=!0),!c(r)||o((function(){var e={};return r[h].call(e)!==e}))?r={}:m&&(r=u(r)),s(r[h])||d(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},2077:function(e){e.exports={}},623:function(e,t,n){var r=n(3057);e.exports=function(e){return r(e.length)}},5331:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},9290:function(e,t,n){var r,a=n(6059),i=n(9938),o=n(6759),s=n(7748),c=n(5463),u=n(1333),l=n(4262),d="prototype",p="script",m=l("IE_PROTO"),h=function(){},f=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;g="undefined"!=typeof document?document.domain&&r?y(r):(t=u("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):y(r);for(var a=o.length;a--;)delete g[d][o[a]];return g()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=a(e),n=new h,h[d]=null,n[m]=e):n=g(),void 0===t?n:i.f(n,t)}},9938:function(e,t,n){var r=n(5746),a=n(3937),i=n(5988),o=n(6059),s=n(4529),c=n(4771);t.f=r&&!a?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),a=c(t),u=a.length,l=0;u>l;)i.f(e,n=a[l++],r[n]);return e}},5988:function(e,t,n){var r=n(5746),a=n(2840),i=n(3937),o=n(6059),s=n(3894),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",m="writable";t.f=r?i?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&m in n&&!n[m]){var r=l(e,t);r&&r[m]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return u(e,t,n)}:u:function(e,t,n){if(o(e),t=s(t),o(n),a)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},9677:function(e,t,n){var r=n(5746),a=n(8834),i=n(6760),o=n(1887),s=n(4529),c=n(3894),u=n(953),l=n(2840),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return o(!a(i.f,e,t),e[t])}},684:function(e,t,n){var r=n(2532),a=n(4529),i=n(946).f,o=n(5790),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==r(e)?function(e){try{return i(e)}catch(e){return o(s)}}(e):i(a(e))}},946:function(e,t,n){var r=n(5629),a=n(6759).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},7857:function(e,t){t.f=Object.getOwnPropertySymbols},249:function(e,t,n){var r=n(953),a=n(7475),i=n(9678),o=n(4262),s=n(4160),c=o("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(r(t,c))return t[c];var n=t.constructor;return a(n)&&t instanceof n?n.prototype:t instanceof u?l:null}},7046:function(e,t,n){var r=n(5329);e.exports=r({}.isPrototypeOf)},5629:function(e,t,n){var r=n(5329),a=n(953),i=n(4529),o=n(1692).indexOf,s=n(7748),c=r([].push);e.exports=function(e,t){var n,r=i(e),u=0,l=[];for(n in r)!a(s,n)&&a(r,n)&&c(l,n);for(;t.length>u;)a(r,n=t[u++])&&(~o(l,n)||c(l,n));return l}},4771:function(e,t,n){var r=n(5629),a=n(6759);e.exports=Object.keys||function(e){return r(e,a)}},6760:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!n.call({1:2},1);t.f=a?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},8929:function(e,t,n){var r=n(5526),a=n(6059),i=n(1851);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return a(n),i(r),t?e(n,r):n.__proto__=r,n}}():void 0)},5623:function(e,t,n){"use strict";var r=n(2885),a=n(9697);e.exports=r?{}.toString:function(){return"[object "+a(this)+"]"}},9811:function(e,t,n){var r=n(8834),a=n(7475),i=n(941),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&a(n=e.toString)&&!i(s=r(n,e)))return s;if(a(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&a(n=e.toString)&&!i(s=r(n,e)))return s;throw o("Can't convert object to primitive value")}},4058:function(e){e.exports={}},8219:function(e,t,n){var r=n(2119),a=TypeError;e.exports=function(e){if(r(e))throw a("Can't call method on "+e);return e}},904:function(e,t,n){var r=n(2885),a=n(5988).f,i=n(2029),o=n(953),s=n(5623),c=n(9813)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;o(l,c)||a(l,c,{configurable:!0,value:t}),u&&!r&&i(l,"toString",s)}}},4262:function(e,t,n){var r=n(8726),a=n(9418),i=r("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},3030:function(e,t,n){var r=n(1899),a=n(5609),i="__core-js_shared__",o=r[i]||a(i,{});e.exports=o},8726:function(e,t,n){var r=n(2529),a=n(3030);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.29.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4620:function(e,t,n){var r=n(5329),a=n(2435),i=n(5803),o=n(8219),s=r("".charAt),c=r("".charCodeAt),u=r("".slice),l=function(e){return function(t,n){var r,l,d=i(o(t)),p=a(n),m=d.length;return p<0||p>=m?e?"":void 0:(r=c(d,p))<55296||r>56319||p+1===m||(l=c(d,p+1))<56320||l>57343?e?s(d,p):r:e?u(d,p,p+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3405:function(e,t,n){var r=n(3385),a=n(5981);e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},9630:function(e,t,n){var r=n(8834),a=n(626),i=n(9813),o=n(5929);e.exports=function(){var e=a("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return r(n,this)}),{arity:1})}},4680:function(e,t,n){var r=n(3405);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},9413:function(e,t,n){var r=n(2435),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},4529:function(e,t,n){var r=n(7026),a=n(8219);e.exports=function(e){return r(a(e))}},2435:function(e,t,n){var r=n(5331);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},3057:function(e,t,n){var r=n(2435),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},9678:function(e,t,n){var r=n(8219),a=Object;e.exports=function(e){return a(r(e))}},6935:function(e,t,n){var r=n(8834),a=n(941),i=n(6664),o=n(4229),s=n(9811),c=n(9813),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!a(e)||i(e))return e;var n,c=o(e,l);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!a(n)||i(n))return n;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},3894:function(e,t,n){var r=n(6935),a=n(6664);e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},2885:function(e,t,n){var r={};r[n(9813)("toStringTag")]="z",e.exports="[object z]"===String(r)},5803:function(e,t,n){var r=n(9697),a=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return a(e)}},9826:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9418:function(e,t,n){var r=n(5329),a=0,i=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++a+i,36)}},2302:function(e,t,n){var r=n(3405);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:function(e,t,n){var r=n(5746),a=n(5981);e.exports=r&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7093:function(e,t,n){var r=n(1899),a=n(7475),i=r.WeakMap;e.exports=a(i)&&/native code/.test(String(i))},3464:function(e,t,n){var r=n(4058),a=n(953),i=n(1477),o=n(5988).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});a(t,e)||o(t,e,{value:i.f(e)})}},1477:function(e,t,n){var r=n(9813);t.f=r},9813:function(e,t,n){var r=n(1899),a=n(8726),i=n(953),o=n(9418),s=n(3405),c=n(2302),u=r.Symbol,l=a("wks"),d=c?u.for||u:u&&u.withoutSetter||o;e.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:d("Symbol."+e)),l[e]}},5906:function(e,t,n){"use strict";var r=n(6887),a=n(5981),i=n(1052),o=n(941),s=n(9678),c=n(623),u=n(6796),l=n(5449),d=n(4692),p=n(568),m=n(9813),h=n(3385),f=m("isConcatSpreadable"),y=h>=51||!a((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),g=function(e){if(!o(e))return!1;var t=e[f];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,arity:1,forced:!y||!p("concat")},{concat:function(e){var t,n,r,a,i,o=s(this),p=d(o,0),m=0;for(t=-1,r=arguments.length;t<r;t++)if(g(i=-1===t?o:arguments[t]))for(a=c(i),u(m+a),n=0;n<a;n++,m++)n in i&&l(p,m,i[n]);else u(m+1),l(p,m++,i);return p.length=m,p}})},6274:function(e,t,n){"use strict";var r=n(4529),a=n(8479),i=n(2077),o=n(5402),s=n(5988).f,c=n(5105),u=n(3538),l=n(2529),d=n(5746),p="Array Iterator",m=o.set,h=o.getterFor(p);e.exports=c(Array,"Array",(function(e,t){m(this,{type:p,target:r(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var f=i.Arguments=i.Array;if(a("keys"),a("values"),a("entries"),!l&&d&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},8084:function(){},2619:function(e,t,n){var r=n(6887),a=n(626),i=n(9730),o=n(8834),s=n(5329),c=n(5981),u=n(7475),l=n(6664),d=n(3765),p=n(3323),m=n(3405),h=String,f=a("JSON","stringify"),y=s(/./.exec),g=s("".charAt),w=s("".charCodeAt),N=s("".replace),v=s(1..toString),C=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,x=!m||c((function(){var e=a("Symbol")();return"[null]"!=f([e])||"{}"!=f({a:e})||"{}"!=f(Object(e))})),T=c((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),z=function(e,t){var n=d(arguments),r=p(t);if(u(r)||void 0!==e&&!l(e))return n[1]=function(e,t){if(u(r)&&(t=o(r,this,h(e),t)),!l(t))return t},i(f,null,n)},_=function(e,t,n){var r=g(n,t-1),a=g(n,t+1);return y(S,e)&&!y(b,a)||y(b,e)&&!y(S,r)?"\\u"+v(w(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:x||T},{stringify:function(e,t,n){var r=d(arguments),a=i(x?z:f,null,r);return T&&"string"==typeof a?N(a,C,_):a}})},9120:function(e,t,n){var r=n(1899);n(904)(r.JSON,"JSON",!0)},5327:function(){},6450:function(e,t,n){var r=n(6887),a=n(5746),i=n(5988).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!a},{defineProperty:i})},7144:function(e,t,n){var r=n(6887),a=n(3405),i=n(5981),o=n(7857),s=n(9678);r({target:"Object",stat:!0,forced:!a||i((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},5967:function(){},1502:function(){},7971:function(e,t,n){"use strict";var r=n(4620).charAt,a=n(5803),i=n(5402),o=n(5105),s=n(3538),c="String Iterator",u=i.set,l=i.getterFor(c);o(String,"String",(function(e){u(this,{type:c,string:a(e),index:0})}),(function(){var e,t=l(this),n=t.string,a=t.index;return a>=n.length?s(void 0,!0):(e=r(n,a),t.index+=e.length,s(e,!1))}))},8555:function(e,t,n){n(3464)("asyncIterator")},8616:function(e,t,n){"use strict";var r=n(6887),a=n(1899),i=n(8834),o=n(5329),s=n(2529),c=n(5746),u=n(3405),l=n(5981),d=n(953),p=n(7046),m=n(6059),h=n(4529),f=n(3894),y=n(5803),g=n(1887),w=n(9290),N=n(4771),v=n(946),C=n(684),S=n(7857),b=n(9677),x=n(5988),T=n(9938),z=n(6760),_=n(5929),A=n(9202),q=n(8726),P=n(4262),E=n(7748),I=n(9418),k=n(9813),O=n(1477),M=n(3464),B=n(9630),R=n(904),j=n(5402),D=n(3610).forEach,F=P("hidden"),$="Symbol",U="prototype",V=j.set,H=j.getterFor($),L=Object[U],G=a.Symbol,W=G&&G[U],K=a.TypeError,Q=a.QObject,J=b.f,Y=x.f,X=C.f,Z=z.f,ee=o([].push),te=q("symbols"),ne=q("op-symbols"),re=q("wks"),ae=!Q||!Q[U]||!Q[U].findChild,ie=c&&l((function(){return 7!=w(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=J(L,t);r&&delete L[t],Y(e,t,n),r&&e!==L&&Y(L,t,r)}:Y,oe=function(e,t){var n=te[e]=w(W);return V(n,{type:$,tag:e,description:t}),c||(n.description=t),n},se=function(e,t,n){e===L&&se(ne,t,n),m(e);var r=f(t);return m(n),d(te,r)?(n.enumerable?(d(e,F)&&e[F][r]&&(e[F][r]=!1),n=w(n,{enumerable:g(0,!1)})):(d(e,F)||Y(e,F,g(1,{})),e[F][r]=!0),ie(e,r,n)):Y(e,r,n)},ce=function(e,t){m(e);var n=h(t),r=N(n).concat(pe(n));return D(r,(function(t){c&&!i(ue,n,t)||se(e,t,n[t])})),e},ue=function(e){var t=f(e),n=i(Z,this,t);return!(this===L&&d(te,t)&&!d(ne,t))&&(!(n||!d(this,t)||!d(te,t)||d(this,F)&&this[F][t])||n)},le=function(e,t){var n=h(e),r=f(t);if(n!==L||!d(te,r)||d(ne,r)){var a=J(n,r);return!a||!d(te,r)||d(n,F)&&n[F][r]||(a.enumerable=!0),a}},de=function(e){var t=X(h(e)),n=[];return D(t,(function(e){d(te,e)||d(E,e)||ee(n,e)})),n},pe=function(e){var t=e===L,n=X(t?ne:h(e)),r=[];return D(n,(function(e){!d(te,e)||t&&!d(L,e)||ee(r,te[e])})),r};u||(G=function(){if(p(W,this))throw K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?y(arguments[0]):void 0,t=I(e),n=function(e){this===L&&i(n,ne,e),d(this,F)&&d(this[F],t)&&(this[F][t]=!1),ie(this,t,g(1,e))};return c&&ae&&ie(L,t,{configurable:!0,set:n}),oe(t,e)},_(W=G[U],"toString",(function(){return H(this).tag})),_(G,"withoutSetter",(function(e){return oe(I(e),e)})),z.f=ue,x.f=se,T.f=ce,b.f=le,v.f=C.f=de,S.f=pe,O.f=function(e){return oe(k(e),e)},c&&(A(W,"description",{configurable:!0,get:function(){return H(this).description}}),s||_(L,"propertyIsEnumerable",ue,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:G}),D(N(re),(function(e){M(e)})),r({target:$,stat:!0,forced:!u},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?w(e):ce(w(e),t)},defineProperty:se,defineProperties:ce,getOwnPropertyDescriptor:le}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:de}),B(),R(G,$),E[F]=!0},2615:function(){},4523:function(e,t,n){var r=n(6887),a=n(626),i=n(953),o=n(5803),s=n(8726),c=n(4680),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=o(e);if(i(u,t))return u[t];var n=a("Symbol")(t);return u[t]=n,l[n]=t,n}})},1732:function(e,t,n){n(3464)("hasInstance")},5903:function(e,t,n){n(3464)("isConcatSpreadable")},1825:function(e,t,n){n(3464)("iterator")},5824:function(e,t,n){n(8616),n(4523),n(8608),n(2619),n(7144)},8608:function(e,t,n){var r=n(6887),a=n(953),i=n(6664),o=n(9826),s=n(8726),c=n(4680),u=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw TypeError(o(e)+" is not a symbol");if(a(u,e))return u[e]}})},5915:function(e,t,n){n(3464)("matchAll")},8394:function(e,t,n){n(3464)("match")},1766:function(e,t,n){n(3464)("replace")},2737:function(e,t,n){n(3464)("search")},9911:function(e,t,n){n(3464)("species")},4315:function(e,t,n){n(3464)("split")},3131:function(e,t,n){var r=n(3464),a=n(9630);r("toPrimitive"),a()},4714:function(e,t,n){var r=n(626),a=n(3464),i=n(904);a("toStringTag"),i(r("Symbol"),"Symbol")},659:function(e,t,n){n(3464)("unscopables")},8783:function(e,t,n){n(3464)("asyncDispose")},3975:function(e,t,n){n(3464)("dispose")},2731:function(e,t,n){var r=n(6887),a=n(626),i=n(5329),o=a("Symbol"),s=o.keyFor,c=i(o.prototype.valueOf);r({target:"Symbol",stat:!0},{isRegistered:function(e){try{return void 0!==s(c(e))}catch(e){return!1}}})},5605:function(e,t,n){for(var r=n(6887),a=n(8726),i=n(626),o=n(5329),s=n(6664),c=n(9813),u=i("Symbol"),l=u.isWellKnown,d=i("Object","getOwnPropertyNames"),p=o(u.prototype.valueOf),m=a("wks"),h=0,f=d(u),y=f.length;h<y;h++)try{var g=f[h];s(u[g])&&c(g)}catch(e){}r({target:"Symbol",stat:!0,forced:!0},{isWellKnown:function(e){if(l&&l(e))return!0;try{for(var t=p(e),n=0,r=d(m),a=r.length;n<a;n++)if(m[r[n]]==t)return!0}catch(e){}return!1}})},5799:function(e,t,n){n(3464)("matcher")},1943:function(e,t,n){n(3464)("metadataKey")},5414:function(e,t,n){n(3464)("metadata")},6774:function(e,t,n){n(3464)("observable")},620:function(e,t,n){n(3464)("patternMatch")},6172:function(e,t,n){n(3464)("replaceAll")},7634:function(e,t,n){n(6274);var r=n(3281),a=n(1899),i=n(9697),o=n(2029),s=n(2077),c=n(9813)("toStringTag");for(var u in r){var l=a[u],d=l&&l.prototype;d&&i(d)!==c&&o(d,c,u),s[u]=s.Array}},1910:function(e,t,n){var r=n(8171);e.exports=r},2547:function(e,t,n){var r=n(7473);n(7634),e.exports=r},6509:function(e,t,n){var r=n(4227);n(7634),e.exports=r},5774:function(e,t,n){var r=n(2978);e.exports=r},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},9509:function(e,t,n){var r=n(9408),a=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},4189:function(e,t,n){var r=n(9509).Buffer;function a(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,a=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var c=o%a,u=Math.min(i-s,a-c),l=0;l<u;l++)n[c+l]=e[s+l];s+=u,(o+=u)%a==0&&this._update(n)}return this._len+=i,this},a.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,a=(n-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},7499:function(e,t,n){var r=n(5717),a=n(4189),i=n(9509).Buffer,o=[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],s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function m(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,a),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,a=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,f=0|this._g,y=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+m(n[g-15])+n[g-16];for(var w=0;w<64;++w){var N=y+p(c)+u(c,h,f)+o[w]+n[w]|0,v=d(r)+l(r,a,i)|0;y=f,f=h,h=c,c=s+N|0,s=i,i=a,a=r,r=N+v|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=f+this._g|0,this._h=y+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},7946:function(e){"use strict";e.exports=m},7417:function(e){"use strict";e.exports=u},3983:function(e){"use strict";e.exports=c},4711:function(e){"use strict";e.exports=s},5039:function(t){"use strict";t.exports=e},8236:function(e){"use strict";e.exports=p},5192:function(e){"use strict";e.exports=r},1986:function(e){"use strict";e.exports=d},3783:function(e){"use strict";e.exports=a},9408:function(e){"use strict";e.exports=t},3735:function(e){"use strict";e.exports=f},2716:function(e){"use strict";e.exports=h},3485:function(e){"use strict";e.exports=n},79:function(e){"use strict";e.exports=i},9882:function(e){"use strict";e.exports=l},7480:function(e){"use strict";e.exports=o},8079:function(e){"use strict";e.exports=y},7445:function(e,t,n){e.exports=n(3685)},2472:function(e,t,n){e.exports=n(6600)},8994:function(e,t,n){e.exports=n(9759)},24:function(e,t,n){e.exports=n(1384)}},w={};function N(e){var t=w[e];if(void 0!==t)return t.exports;var n=w[e]={exports:{}};return g[e](n,n.exports,N),n.exports}N.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return N.d(t,{a:t}),t},N.d=function(e,t){for(var n in t)N.o(t,n)&&!N.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},N.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),N.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},N.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var v={};return function(){"use strict";N.r(v),N.d(v,{AE_AMOUNT_FORMATS:function(){return Ie},AbiVersion:function(){return Ut},AccountBase:function(){return rs},AccountError:function(){return d},AccountGeneralized:function(){return Xu},AccountLedger:function(){return tl},AccountLedgerFactory:function(){return rl},AeSdk:function(){return uu},AeSdkAepp:function(){return Hu},AeSdkBase:function(){return cu},AeSdkMethods:function(){return su},AeSdkWallet:function(){return Ju},AensError:function(){return p},AensPointerContextError:function(){return D},AeppError:function(){return m},AlreadyConnectedError:function(){return qe},AmbiguousEventDefinitionError:function(){return de},ArgumentCountMismatchError:function(){return T},ArgumentError:function(){return b},BaseError:function(){return l},BrowserRuntimeConnection:function(){return Ud},BrowserWindowMessageConnection:function(){return Dd},BytecodeMismatchError:function(){return ee},CLIENT_TTL:function(){return It},CallReturnType:function(){return Gr},Channel:function(){return Id},ChannelCallError:function(){return W},ChannelConnectionError:function(){return K},ChannelError:function(){return h},ChannelIncomingMessageError:function(){return Y},ChannelPingTimedOutError:function(){return Q},CompilerBase:function(){return al},CompilerError:function(){return f},CompilerHttp:function(){return Zl},ConsensusProtocolVersion:function(){return Ft},Contract:function(){return kc},ContractError:function(){return y},CryptographyError:function(){return g},DRY_RUN_ACCOUNT:function(){return Lr},DecodeError:function(){return ve},DerivationError:function(){return ec},DryRunError:function(){return Se},DuplicateContractError:function(){return te},DuplicateNodeError:function(){return we},Encoding:function(){return Xe},IllegalArgumentError:function(){return x},IllegalBidFeeError:function(){return be},InactiveContractError:function(){return ne},InsufficientBalanceError:function(){return z},InsufficientNameFeeError:function(){return F},InternalError:function(){return B},InvalidAensNameError:function(){return $},InvalidAuthDataError:function(){return Z},InvalidChecksumError:function(){return pe},InvalidMethodInvocationError:function(){return re},InvalidPasswordError:function(){return me},InvalidRpcMessageError:function(){return U},InvalidSignatureError:function(){return xe},InvalidTxError:function(){return ys},MAX_AUTH_FUN_GAS:function(){return At},MESSAGE_DIRECTION:function(){return lu},METHODS:function(){return mu},MIN_GAS_PRICE:function(){return kt},MemoryAccount:function(){return ss},MerkleTreeHashMismatchError:function(){return he},MissingCallbackError:function(){return V},MissingContractAddressError:function(){return ae},MissingContractDefError:function(){return ie},MissingEventDefinitionError:function(){return le},MissingFunctionNameError:function(){return oe},MissingNodeInTreeError:function(){return fe},MissingParamError:function(){return _},NAME_BID_MAX_LENGTH:function(){return jt},NAME_BID_RANGES:function(){return Dt},NAME_BID_TIMEOUT_BLOCKS:function(){return Bt},NAME_FEE_BID_INCREMENT:function(){return Mt},NAME_FEE_MULTIPLIER:function(){return Ot},NAME_MAX_CLIENT_TTL:function(){return Et},NAME_MAX_LENGTH_FEE:function(){return Rt},NAME_MAX_TTL:function(){return Pt},NAME_TTL:function(){return qt},NoSerializerFoundError:function(){return A},NoSuchContractFunctionError:function(){return ce},NoWalletConnectedError:function(){return Pe},Node:function(){return ts},NodeError:function(){return w},NodeInvocationError:function(){return se},NodeNotFoundError:function(){return Ne},NotImplementedError:function(){return O},NotPayableFunctionError:function(){return ue},ORACLE_TTL:function(){return Ur},ORACLE_TTL_TYPES:function(){return $r},PayloadLengthError:function(){return Ce},PrefixNotFoundError:function(){return Te},QUERY_TTL:function(){return Vr},RESPONSE_TTL:function(){return Hr},RPC_STATUS:function(){return hu},RequestTimedOutError:function(){return q},RpcBroadcastError:function(){return wu},RpcConnectionDenyError:function(){return Cu},RpcConnectionError:function(){return Ee},RpcError:function(){return yu},RpcInternalError:function(){return xu},RpcInvalidTransactionError:function(){return gu},RpcMethodNotFoundError:function(){return Tu},RpcNotAuthorizeError:function(){return Su},RpcPermissionDenyError:function(){return bu},RpcRejectedByUserError:function(){return Nu},RpcUnsupportedProtocolError:function(){return vu},SUBSCRIPTION_TYPES:function(){return pu},SchemaNotFoundError:function(){return ze},Tag:function(){return Vt},TagNotFoundError:function(){return _e},TransactionError:function(){return C},TxNotInChainError:function(){return Ae},TxTimedOutError:function(){return P},TypeError:function(){return E},UnAuthorizedAccountError:function(){return H},UnavailableAccountError:function(){return j},UnexpectedChannelMessageError:function(){return J},UnexpectedTsError:function(){return R},UnknownChannelStateError:function(){return X},UnknownNodeLengthError:function(){return ye},UnknownPathNibbleError:function(){return ge},UnknownRpcClientError:function(){return L},UnsubscribedAccountError:function(){return G},UnsupportedPlatformError:function(){return I},UnsupportedProtocolError:function(){return k},UnsupportedVersionError:function(){return M},VmVersion:function(){return $t},WALLET_TYPE:function(){return du},WalletError:function(){return S},_getPollInterval:function(){return fs},aensBid:function(){return wc},aensClaim:function(){return yc},aensPreclaim:function(){return gc},aensQuery:function(){return fc},aensRevoke:function(){return pc},aensTransfer:function(){return hc},aensUpdate:function(){return mc},awaitHeight:function(){return Ns},buildAuthTxHash:function(){return Wc},buildAuthTxHashByGaMetaTx:function(){return Kc},buildContractId:function(){return on},buildContractIdByContractTx:function(){return ua},buildTx:function(){return ia},buildTxAsync:function(){return oa},buildTxHash:function(){return ca},commitmentHash:function(){return un},computeAuctionEndBlock:function(){return gn},computeBidFee:function(){return yn},connectionProxy:function(){return kd},createGeneralizedAccount:function(){return Gc},decode:function(){return dt},deriveChild:function(){return rc},derivePathFromKey:function(){return ac},derivePathFromSeed:function(){return oc},dump:function(){return Ls},encode:function(){return pt},encodeContractAddress:function(){return Nt},encodeUnsigned:function(){return gt},extendOracleTtl:function(){return jc},formatAmount:function(){return Oe},genSalt:function(){return yt},generateKeyPair:function(){return Ct},generateKeyPairFromSecret:function(){return vt},generateSaveHDWalletFromSeed:function(){return uc},getAccount:function(){return Ss},getAddressFromPriv:function(){return ht},getBalance:function(){return bs},getContract:function(){return ks},getContractByteCode:function(){return Is},getCurrentGeneration:function(){return xs},getDefaultPointerKey:function(){return hn},getExecutionCost:function(){return cs},getExecutionCostBySignedTx:function(){return us},getExecutionCostUsingNode:function(){return ls},getGeneration:function(){return Ts},getHdWalletAccountFromSeed:function(){return dc},getHeight:function(){return gs},getKeyBlock:function(){return _s},getKeyPair:function(){return cc},getMasterKeyFromSeed:function(){return ic},getMicroBlockHeader:function(){return As},getMicroBlockTransactions:function(){return zs},getMinimumNameFee:function(){return fn},getName:function(){return Os},getOracleObject:function(){return Fc},getQueryObject:function(){return Bc},getSaveHDWalletAccounts:function(){return lc},getTransactionSignerAddress:function(){return ns},hash:function(){return wt},isAddressValid:function(){return ft},isAuctionName:function(){return wn},isNameValid:function(){return pn},isValidKeypair:function(){return _t},messageToHash:function(){return xt},oracleQueryId:function(){return sn},payForTransaction:function(){return Hc},poll:function(){return ws},pollForQueries:function(){return Oc},pollForQueryResponse:function(){return Mc},postQueryToOracle:function(){return Rc},produceNameId:function(){return cn},readInt:function(){return ln},recover:function(){return Hs},registerOracle:function(){return $c},resolveName:function(){return Ms},respondToQuery:function(){return Dc},sendTransaction:function(){return Cs},sign:function(){return St},signMessage:function(){return Tt},spend:function(){return Uc},toAe:function(){return Me},toAettos:function(){return Be},toBytes:function(){return Xt},transferFunds:function(){return Vc},txDryRun:function(){return Es},unpackTx:function(){return sa},verify:function(){return bt},verifyMessage:function(){return zt},verifyTransaction:function(){return hs},waitForTxConfirm:function(){return vs},walletDetector:function(){return Fd}});var e={};N.r(e),N.d(e,{Account:function(){return Oa},ByteCode:function(){return Ja},Channel:function(){return ni},ChannelCloseMutualTx:function(){return bi},ChannelCloseSoloTx:function(){return xi},ChannelCreateTx:function(){return Ni},ChannelDepositTx:function(){return vi},ChannelForceProgressTx:function(){return Si},ChannelSetDelegatesTx:function(){return Ai},ChannelSettleTx:function(){return zi},ChannelSlashTx:function(){return Ti},ChannelSnapshotSoloTx:function(){return _i},ChannelWithdrawTx:function(){return Ci},CheckTxInPoolResponse:function(){return Ui},CommitmentId:function(){return gi},ContractCallObject:function(){return Va},ContractCallTx:function(){return Bi},ContractCreateTx:function(){return Mi},ContractObject:function(){return Qa},CountResponse:function(){return Ia},CreateContractUnsignedTx:function(){return Ki},Delegates:function(){return _a},DryRunAccount:function(){return Ra},DryRunCallContext:function(){return Fa},DryRunCallReq:function(){return Da},DryRunInput:function(){return Ba},DryRunInputItem:function(){return ja},DryRunResult:function(){return Ua},DryRunResults:function(){return $a},EncodedTx:function(){return Wa},ErrorModel:function(){return Na},Event:function(){return Ha},GAAttachTx:function(){return Di},GAMetaTx:function(){return Fi},GAObject:function(){return Ga},Generation:function(){return ka},HashResponse:function(){return Ca},Header:function(){return wa},HeightResponse:function(){return Sa},KeyBlock:function(){return va},MicroBlockHeader:function(){return ba},NameClaimTx:function(){return mi},NameEntry:function(){return ti},NameHash:function(){return wi},NamePointer:function(){return Ea},NamePreclaimTx:function(){return pi},NameRevokeTx:function(){return yi},NameTransferTx:function(){return fi},NameUpdateTx:function(){return hi},NextNonceResponse:function(){return Ma},OffChainCallContract:function(){return Wi},OffChainDeposit:function(){return Li},OffChainNewContract:function(){return Gi},OffChainTransfer:function(){return Vi},OffChainUpdate:function(){return Aa},OffChainWithdrawal:function(){return Hi},OracleExtendTx:function(){return ui},OracleQueries:function(){return Za},OracleQuery:function(){return ei},OracleQueryTx:function(){return li},OracleRegisterTx:function(){return ci},OracleRespondTx:function(){return di},PayingForTx:function(){return $i},PeerConnections:function(){return oi},PeerCount:function(){return Ii},PeerCountAvailable:function(){return Oi},PeerCountConnected:function(){return ki},PeerDetails:function(){return Pi},PeerPubKey:function(){return ri},Peers:function(){return Ei},PoI:function(){return Ya},PostTxResponse:function(){return Ka},Protocol:function(){return ii},PubKey:function(){return qi},RegisteredOracle:function(){return Xa},RelativeTTL:function(){return qa},SignedTx:function(){return Ta},SignedTxs:function(){return xa},SpendTx:function(){return si},Status:function(){return ai},TokenSupply:function(){return ji},Ttl:function(){return Pa},Tx:function(){return za},TxInfoObject:function(){return La},UnsignedTx:function(){return Ri},discriminators:function(){return Qi}});var t={};N.r(t),N.d(t,{InvalidTxError:function(){return ys},_getPollInterval:function(){return fs},awaitHeight:function(){return Ns},getAccount:function(){return Ss},getBalance:function(){return bs},getContract:function(){return ks},getContractByteCode:function(){return Is},getCurrentGeneration:function(){return xs},getGeneration:function(){return Ts},getHeight:function(){return gs},getKeyBlock:function(){return _s},getMicroBlockHeader:function(){return As},getMicroBlockTransactions:function(){return zs},getName:function(){return Os},poll:function(){return ws},resolveName:function(){return Ms},sendTransaction:function(){return Cs},txDryRun:function(){return Es},waitForTxConfirm:function(){return vs}});var n={};N.r(n),N.d(n,{aensBid:function(){return wc},aensClaim:function(){return yc},aensPreclaim:function(){return gc},aensQuery:function(){return fc},aensRevoke:function(){return pc},aensTransfer:function(){return hc},aensUpdate:function(){return mc}});var r={};N.r(r),N.d(r,{extendOracleTtl:function(){return jc},getOracleObject:function(){return Fc},getQueryObject:function(){return Bc},pollForQueries:function(){return Oc},pollForQueryResponse:function(){return Mc},postQueryToOracle:function(){return Rc},registerOracle:function(){return $c},respondToQuery:function(){return Dc}});var a={};N.r(a),N.d(a,{payForTransaction:function(){return Hc},spend:function(){return Uc},transferFunds:function(){return Vc}});var i={};N.r(i),N.d(i,{buildAuthTxHash:function(){return Wc},buildAuthTxHashByGaMetaTx:function(){return Kc},createGeneralizedAccount:function(){return Gc}});var o={};N.r(o),N.d(o,{Aci:function(){return sl},ApiVersion:function(){return xl},ByteCodeInput:function(){return vl},BytecodeCallResultInput:function(){return pl},Calldata:function(){return fl},CompileOpts:function(){return ol},CompileResult:function(){return ll},CompilerError:function(){return cl},CompilerVersion:function(){return bl},Contract:function(){return il},DecodeCalldataBytecode:function(){return yl},DecodeCalldataSource:function(){return Nl},DecodedCalldata:function(){return gl},DecodedCallresult:function(){return ml},ErrorModel:function(){return wl},ErrorPos:function(){return ul},FateAssembler:function(){return Cl},FunctionCallInput:function(){return hl},SophiaBinaryData:function(){return Tl},SophiaCallResultInput:function(){return dl},SophiaJsonData:function(){return zl},ValidateByteCodeInput:function(){return Sl}});var s=N(5192),c=N.n(s);const u=e=>e.integerValue(c().ROUND_CEIL);class l extends Error{constructor(e){super(e),this.name="BaseError"}}class d extends l{constructor(e){super(e),this.name="AccountError"}}class p extends l{constructor(e){super(e),this.name="AensError"}}class m extends l{constructor(e){super(e),this.name="AeppError"}}class h extends l{constructor(e){super(e),this.name="ChannelError"}}class f extends l{constructor(e){super(e),this.name="CompilerError"}}class y extends l{constructor(e){super(e),this.name="ContractError"}}class g extends l{constructor(e){super(e),this.name="CryptographyError"}}class w extends l{constructor(e){super(e),this.name="NodeError"}}class C extends l{constructor(e){super(e),this.name="TransactionError"}}class S extends l{constructor(e){super(e),this.name="WalletError"}}class b extends l{constructor(e,t,n){super(`${e} should be ${t}, got ${n} instead`),this.name="ArgumentError"}}class x extends g{constructor(e){super(e),this.name="IllegalArgumentError"}}class T extends l{constructor(e,t,n){super(`${e} expects ${t} arguments, got ${n} instead`),this.name="ArgumentCountMismatchError"}}class z extends l{constructor(e){super(e),this.name="InsufficientBalanceError"}}class _ extends l{constructor(e){super(e),this.name="MissingParamError"}}class A extends l{constructor(){super("Byte serialization not supported"),this.name="NoSerializerFoundError"}}class q extends l{constructor(e){super(`Giving up at height ${e}`),this.name="RequestTimedOutError"}}class P extends l{constructor(e,t){super([`Giving up after ${e} blocks mined`,`transaction hash: ${t}`].join(", ")),this.name="TxTimedOutError"}}class E extends l{constructor(e){super(e),this.name="TypeError"}}class I extends l{constructor(e){super(e),this.name="UnsupportedPlatformError"}}class k extends l{constructor(e){super(e),this.name="UnsupportedProtocolError"}}class O extends l{constructor(e){super(e),this.name="NotImplementedError"}}class M extends l{constructor(e,t,n,r){super(`Unsupported ${e} version ${t}. Supported: >= ${n} < ${r}`),this.name="UnsupportedVersionError"}}class B extends l{constructor(e){super(e),this.name="InternalError"}}class R extends B{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Expected to not happen, required for TS"),this.name="UnexpectedTsError"}}class j extends d{constructor(e){super(`Account for ${e} not available`),this.name="UnavailableAccountError"}}class D extends p{constructor(e,t){super(`Name ${e} don't have pointers for ${t}`),this.name="AensPointerContextError"}}class F extends p{constructor(e,t){super(`the provided fee ${e.toString()} is not enough to execute the claim, required: ${t.toString()}`),this.name="InsufficientNameFeeError"}}class $ extends p{constructor(e){super(e),this.name="InvalidAensNameError"}}class U extends m{constructor(e){super(`Received invalid message: ${e}`),this.name="InvalidRpcMessageError"}}class V extends m{constructor(e){super(`Can't find callback for this messageId ${e}`),this.name="MissingCallbackError"}}class H extends m{constructor(e){super(`You do not have access to account ${e}`),this.name="UnAuthorizedAccountError"}}class L extends m{constructor(e){super(`RpcClient with id ${e} do not exist`),this.name="UnknownRpcClientError"}}class G extends m{constructor(){super("You are not subscribed for an account."),this.name="UnsubscribedAccountError"}}class W extends h{constructor(e){super(e),this.name="ChannelCallError"}}class K extends h{constructor(e){super(e),this.name="ChannelConnectionError"}}class Q extends h{constructor(){super("Server pong timed out"),this.name="ChannelPingTimedOutError"}}class J extends h{constructor(e){super(e),this.name="UnexpectedChannelMessageError"}}class Y extends h{constructor(e,t){super(e.message),this.handlerError=e,this.incomingMessage=t,this.name="ChannelIncomingMessageError"}}class X extends h{constructor(){super("State Channels FSM entered unknown state"),this.name="UnknownChannelStateError"}}class Z extends f{constructor(e){super(e),this.name="InvalidAuthDataError"}}class ee extends y{constructor(e){super(`Contract ${e} do not correspond to the bytecode deployed on the chain`),this.name="BytecodeMismatchError"}}class te extends y{constructor(){super("Contract already deployed"),this.name="DuplicateContractError"}}class ne extends y{constructor(e){super(`Contract with address ${e} not active`),this.name="InactiveContractError"}}class re extends y{constructor(e){super(e),this.name="InvalidMethodInvocationError"}}class ae extends y{constructor(e){super(e),this.name="MissingContractAddressError"}}class ie extends y{constructor(){super("Either ACI or source code is required"),this.name="MissingContractDefError"}}class oe extends y{constructor(){super("Function name is required"),this.name="MissingFunctionNameError"}}class se extends y{constructor(e,t){super("Invocation failed"+(null==e?"":`: "${e}"`)),this.name="NodeInvocationError",this.transaction=t}}class ce extends y{constructor(e){super(`Function ${e} doesn't exist in contract`),this.name="NoSuchContractFunctionError"}}class ue extends y{constructor(e,t){super(`You try to pay "${e}" to function "${t}" which is not payable. Only payable function can accept coins`),this.name="NotPayableFunctionError"}}class le extends y{constructor(e,t){super(`Can't find definition of ${e} event emitted by ${t} (use omitUnknown option to ignore events like this)`),this.name="MissingEventDefinitionError"}}class de extends y{constructor(e,t){super(`Found multiple definitions of "${t[0][1]}" event with different types emitted by ${e} in ${t.map((e=>{let[t]=e;return`"${t}"`})).join(", ")} contracts (use contractAddressToName option to specify contract name corresponding to address)`),this.name="AmbiguousEventDefinitionError"}}class pe extends g{constructor(){super("Invalid checksum"),this.name="InvalidChecksumError"}}class me extends g{constructor(){super("Invalid password or nonce"),this.name="InvalidPasswordError"}}class he extends g{constructor(){super("Node hash is not equal to provided one"),this.name="MerkleTreeHashMismatchError"}}class fe extends g{constructor(e){super(e),this.name="MissingNodeInTreeError"}}class ye extends g{constructor(e){super(`Unknown node length: ${e}`),this.name="UnknownNodeLengthError"}}class ge extends g{constructor(e){super(`Unknown path nibble: ${e}`),this.name="UnknownPathNibbleError"}}class we extends w{constructor(e){super(`Node with name ${e} already exist`),this.name="DuplicateNodeError"}}class Ne extends w{constructor(e){super(e),this.name="NodeNotFoundError"}}class ve extends C{constructor(e){super(e),this.name="DecodeError"}}class Ce extends C{constructor(e){super(e),this.name="PayloadLengthError"}}class Se extends C{constructor(e){super(e),this.name="DryRunError"}}class be extends C{constructor(e){super(e),this.name="IllegalBidFeeError"}}class xe extends C{constructor(e){super(e),this.name="InvalidSignatureError"}}class Te extends C{constructor(e){super(`Prefix for id-tag ${e} not found.`),this.name="PrefixNotFoundError"}}class ze extends C{constructor(e,t){super(`Transaction schema not implemented for tag ${e} version ${t}`),this.name="SchemaNotFoundError"}}class _e extends C{constructor(e){super(`Id tag for prefix ${e} not found.`),this.name="DecodeError"}}class Ae extends C{constructor(e){super(`Transaction ${e} is removed from chain`),this.name="TxNotInChainError"}}class qe extends S{constructor(e){super(e),this.name="AlreadyConnectedError"}}class Pe extends S{constructor(e){super(e),this.name="NoWalletConnectedError"}}class Ee extends S{constructor(e){super(e),this.name="RpcConnectionError"}}let Ie;!function(e){e.AE="ae",e.MILI_AE="miliAE",e.MICRO_AE="microAE",e.NANO_AE="nanoAE",e.PICO_AE="picoAE",e.FEMTO_AE="femtoAE",e.AETTOS="aettos"}(Ie||(Ie={}));const ke={[Ie.AE]:0,[Ie.MILI_AE]:-3,[Ie.MICRO_AE]:-6,[Ie.NANO_AE]:-9,[Ie.PICO_AE]:-12,[Ie.FEMTO_AE]:-15,[Ie.AETTOS]:-18},Oe=(e,t)=>{let{denomination:n=Ie.AETTOS,targetDenomination:r=Ie.AETTOS}=t;if("bigint"!=typeof(a=e)&&(!["number","object","string"].includes(typeof a)||isNaN(a)&&!Number.isInteger(a)&&!c().isBigNumber(a)))throw new b("value","a number",e);var a;return new(c())("bigint"==typeof e?e.toString():e).shiftedBy(ke[n]-ke[r]).toFixed()},Me=function(e){let{denomination:t=Ie.AETTOS}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Oe(e,{denomination:t,targetDenomination:Ie.AE})},Be=function(e){let{denomination:t=Ie.AE}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Oe(e,{denomination:t})};var Re=N(79),je=N.n(Re),De=N(8442),Fe=N(7480),$e=N(5039),Ue=N(9408).Buffer;const Ve=async e=>new Promise((t=>{setTimeout(t,e)})),He=(e,t)=>Object.fromEntries(Object.entries(e).map(t)),Le=(()=>{try{return Ue.concat([Uint8Array.from([])]),!1}catch(e){return!0}})()?(e,t)=>Ue.concat(e.map((e=>Ue.from(e))),t):Ue.concat;function Ge(e,t){return e in t}function We(e,t){return t.includes(e)}function Ke(e){return e instanceof $e.RestError&&404===e.statusCode&&e.message.includes("Account not found")}var Qe=N(3783),Je=N(7499),Ye=N.n(Je);let Xe;!function(e){e.KeyBlockHash="kh",e.MicroBlockHash="mh",e.BlockPofHash="bf",e.BlockTxHash="bx",e.BlockStateHash="bs",e.Channel="ch",e.ContractAddress="ct",e.ContractBytearray="cb",e.ContractStoreKey="ck",e.ContractStoreValue="cv",e.Transaction="tx",e.TxHash="th",e.OracleAddress="ok",e.OracleQuery="ov",e.OracleQueryId="oq",e.OracleResponse="or",e.AccountAddress="ak",e.Signature="sg",e.Commitment="cm",e.PeerPubkey="pp",e.Name="nm",e.State="st",e.Poi="pi",e.StateTrees="ss",e.CallStateTree="cs",e.Bytearray="ba"}(Xe||(Xe={}));var Ze=N(9408).Buffer;function et(e){return(new(Ye())).update(e).digest()}const tt=[Xe.ContractBytearray,Xe.ContractStoreKey,Xe.ContractStoreValue,Xe.Transaction,Xe.OracleQuery,Xe.OracleResponse,Xe.State,Xe.Poi,Xe.StateTrees,Xe.CallStateTree,Xe.Bytearray],nt=[Xe.KeyBlockHash,Xe.MicroBlockHash,Xe.BlockPofHash,Xe.BlockTxHash,Xe.BlockStateHash,Xe.Channel,Xe.ContractAddress,Xe.TxHash,Xe.OracleAddress,Xe.OracleQueryId,Xe.AccountAddress,Xe.Signature,Xe.Commitment,Xe.PeerPubkey,Xe.Name],rt={[Xe.KeyBlockHash]:32,[Xe.MicroBlockHash]:32,[Xe.BlockPofHash]:32,[Xe.BlockTxHash]:32,[Xe.BlockStateHash]:32,[Xe.Channel]:32,[Xe.ContractAddress]:32,[Xe.TxHash]:32,[Xe.OracleAddress]:32,[Xe.OracleQueryId]:32,[Xe.AccountAddress]:32,[Xe.Signature]:64,[Xe.Commitment]:32,[Xe.PeerPubkey]:32,[Xe.State]:32};function at(e,t){if(!Ge(t,rt))return;const n=rt[t];if(null!=n&&e.length!==n)throw new Ce(`Payload should be ${n} bytes, got ${e.length} instead`)}const it=e=>et(et(e)).slice(0,4),ot=e=>Le([e,it(e)]);function st(e){const t=e.slice(0,-4);if(!it(t).equals(e.slice(-4)))throw new pe;return t}const ct={encode:e=>ot(e).toString("base64"),decode:e=>st(Ze.from(e,"base64"))},ut={encode:e=>(0,Qe.encode)(ot(e)),decode:e=>st(Ze.from((0,Qe.decode)(e)))},lt=e=>{const t=tt.find((t=>t===e));if(null!=t)return[t,ct];const n=nt.find((t=>t===e));if(null!=n)return[n,ut];throw new b("prefix",`one of ${[...nt,...tt].join(", ")}`,e)};function dt(e){const[t,n,r]=e.split("_");if(null==n)throw new ve(`Encoded string missing payload: ${e}`);if(null!=r)throw new ve(`Encoded string have extra parts: ${e}`);const[a,i]=lt(t),o=i.decode(n);return at(o,a),o}function pt(e,t){const[,n]=lt(t);return at(e,t),`${t}_${n.encode(e)}`}var mt=N(9408).Buffer;function ht(e){const t="string"==typeof e?mt.from(e,"hex"):e;return pt(je().sign.keyPair.fromSecretKey(t).publicKey,Xe.AccountAddress)}function ft(e){arguments.length>1&&void 0!==arguments[1]||Xe.AccountAddress;try{return dt(e),!0}catch(e){return!1}}function yt(){const[e]=new BigUint64Array(je().randomBytes(8).buffer);return Number(e%BigInt(Number.MAX_SAFE_INTEGER))}function gt(e){const t=mt.allocUnsafe(4);return t.writeUInt32BE(e),t.slice(t.findIndex((e=>0!==e)))}function wt(e){return mt.from((0,De.blake2b)(e,void 0,32))}function Nt(e,t){const n=dt(e);return pt(wt(Le([n,gt(t)])),Xe.ContractAddress)}function vt(e){return je().sign.keyPair.fromSecretKey(e)}function Ct(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=je().sign.keyPair(),n=mt.from(t.publicKey),r=mt.from(t.secretKey);return e?{publicKey:n,secretKey:r}:{publicKey:pt(n,Xe.AccountAddress),secretKey:r.toString("hex")}}function St(e,t){return je().sign.detached(mt.from(e),mt.from(t))}function bt(e,t,n){return je().sign.detached.verify(e,t,dt(n))}function xt(e){const t=mt.from("aeternity Signed Message:\n","utf8"),n=mt.from(e,"utf8");return wt(Le([(0,Fe.encode)(t.length),t,(0,Fe.encode)(n.length),n]))}function Tt(e,t){return St(xt(e),t)}function zt(e,t,n){return bt(xt(e),t,n)}function _t(e,t){const n=mt.from("TheMessage");return bt(n,St(n,e),pt("string"==typeof t?mt.from(t,"hex"):t,Xe.AccountAddress))}const At=5e4,qt=18e4,Pt=36e3,Et=84600,It=Et,kt=1e9,Ot=1e14,Mt=.05,Bt=480,Rt=31,jt=12,Dt=He({31:3,30:5,29:8,28:13,27:21,26:34,25:55,24:89,23:144,22:233,21:377,20:610,19:987,18:1597,17:2584,16:4181,15:6765,14:10946,13:17711,12:28657,11:46368,10:75025,9:121393,8:196418,7:317811,6:514229,5:832040,4:1346269,3:2178309,2:3524578,1:5702887},(e=>{let[t,n]=e;return[t,new(c())(n).times(Ot)]}));let Ft,$t,Ut,Vt;!function(e){e[e.Iris=5]="Iris",e[e.Ceres=6]="Ceres"}(Ft||(Ft={})),function(e){e[e.NoVm=0]="NoVm",e[e.Sophia=1]="Sophia",e[e.SophiaImprovementsMinerva=3]="SophiaImprovementsMinerva",e[e.SophiaImprovementsFortuna=4]="SophiaImprovementsFortuna",e[e.Fate=5]="Fate",e[e.SophiaImprovementsLima=6]="SophiaImprovementsLima",e[e.Fate2=7]="Fate2"}($t||($t={})),function(e){e[e.NoAbi=0]="NoAbi",e[e.Sophia=1]="Sophia",e[e.Fate=3]="Fate"}(Ut||(Ut={})),function(e){e[e.Account=10]="Account",e[e.SignedTx=11]="SignedTx",e[e.SpendTx=12]="SpendTx",e[e.Oracle=20]="Oracle",e[e.OracleRegisterTx=22]="OracleRegisterTx",e[e.OracleQueryTx=23]="OracleQueryTx",e[e.OracleResponseTx=24]="OracleResponseTx",e[e.OracleExtendTx=25]="OracleExtendTx",e[e.Name=30]="Name",e[e.NameClaimTx=32]="NameClaimTx",e[e.NamePreclaimTx=33]="NamePreclaimTx",e[e.NameUpdateTx=34]="NameUpdateTx",e[e.NameRevokeTx=35]="NameRevokeTx",e[e.NameTransferTx=36]="NameTransferTx",e[e.Contract=40]="Contract",e[e.ContractCall=41]="ContractCall",e[e.ContractCreateTx=42]="ContractCreateTx",e[e.ContractCallTx=43]="ContractCallTx",e[e.ChannelCreateTx=50]="ChannelCreateTx",e[e.ChannelDepositTx=51]="ChannelDepositTx",e[e.ChannelWithdrawTx=52]="ChannelWithdrawTx",e[e.ChannelForceProgressTx=521]="ChannelForceProgressTx",e[e.ChannelCloseMutualTx=53]="ChannelCloseMutualTx",e[e.ChannelCloseSoloTx=54]="ChannelCloseSoloTx",e[e.ChannelSlashTx=55]="ChannelSlashTx",e[e.ChannelSettleTx=56]="ChannelSettleTx",e[e.ChannelOffChainTx=57]="ChannelOffChainTx",e[e.ChannelOffChainUpdateTransfer=570]="ChannelOffChainUpdateTransfer",e[e.ChannelOffChainUpdateDeposit=571]="ChannelOffChainUpdateDeposit",e[e.ChannelOffChainUpdateWithdraw=572]="ChannelOffChainUpdateWithdraw",e[e.ChannelOffChainUpdateCreateContract=573]="ChannelOffChainUpdateCreateContract",e[e.ChannelOffChainUpdateCallContract=574]="ChannelOffChainUpdateCallContract",e[e.ChannelClientReconnectTx=575]="ChannelClientReconnectTx",e[e.Channel=58]="Channel",e[e.ChannelSnapshotSoloTx=59]="ChannelSnapshotSoloTx",e[e.TreesPoi=60]="TreesPoi",e[e.StateTrees=62]="StateTrees",e[e.Mtree=63]="Mtree",e[e.MtreeValue=64]="MtreeValue",e[e.ContractsMtree=621]="ContractsMtree",e[e.CallsMtree=622]="CallsMtree",e[e.ChannelsMtree=623]="ChannelsMtree",e[e.NameserviceMtree=624]="NameserviceMtree",e[e.OraclesMtree=625]="OraclesMtree",e[e.AccountsMtree=626]="AccountsMtree",e[e.GaAttachTx=80]="GaAttachTx",e[e.GaMetaTx=81]="GaMetaTx",e[e.PayingForTx=82]="PayingForTx",e[e.GaMetaTxAuthData=810]="GaMetaTxAuthData"}(Vt||(Vt={}));var Ht=N(9408).Buffer;const Lt={[Ft.Iris]:{"contract-create":{vmVersion:[$t.Fate2],abiVersion:[Ut.Fate]},"contract-call":{vmVersion:[],abiVersion:[Ut.Fate,Ut.Sophia]},"oracle-call":{vmVersion:[],abiVersion:[Ut.NoAbi,Ut.Fate]}},[Ft.Ceres]:{"contract-create":{vmVersion:[$t.Fate2],abiVersion:[Ut.Fate]},"contract-call":{vmVersion:[],abiVersion:[Ut.Fate]},"oracle-call":{vmVersion:[],abiVersion:[Ut.NoAbi,Ut.Fate]}}};function Gt(e,t){var n;const r=Lt[e][t];return{vmVersion:null!==(n=r.vmVersion[0])&&void 0!==n?n:$t.Fate2,abiVersion:r.abiVersion[0]}}var Wt={serialize(e,t,n){var r;let{consensusProtocolVersion:a=Ft.Iris}=n;return null!==(r=e)&&void 0!==r||(e=Gt(a,"contract-create")),Ht.from([e.vmVersion,0,e.abiVersion])},async prepare(e,t,n){return null!=e?e:null==n.consensusProtocolVersion&&2!==Object.keys(Ft).length&&null!=n.onNode?Gt((await n.onNode.getNodeInfo()).consensusProtocolVersion,"contract-create"):void 0},deserialize(e){const[t,,n]=e;return{vmVersion:+t,abiVersion:+n}}},Kt=N(3485),Qt=N(9408).Buffer,Jt={_getProtocolDetails(e,t){return Gt(e,Vt.ContractCallTx===t||Vt.GaMetaTx===t?"contract-call":"oracle-call").abiVersion},serialize(e,t,n){let{tag:r}=t,{consensusProtocolVersion:a=Ft.Iris}=n;const i=null!=e?e:this._getProtocolDetails(a,r);return Qt.from([i])},async prepare(e,t,n){let{tag:r}=t;return null!=e?e:null==n.consensusProtocolVersion&&2!==Object.keys(Ft).length&&null!=n.onNode?this._getProtocolDetails((await n.onNode.getNodeInfo()).consensusProtocolVersion,r):void 0},deserialize(e){return e[0]}},Yt=N(9408).Buffer;function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e)return Yt.from([]);if(Number.isInteger(e)||c().isBigNumber(e)||t){if(c().isBigNumber(e)||(e=new(c())(e)),!e.isInteger())throw new E(`Unexpected not integer value: ${e.toFixed()}`);let t=e.toString(16);return t.length%2==1&&(t=`0${t}`),Yt.from(t,"hex")}if("string"==typeof e)return Yt.from(e);throw new A}var Zt=N(9408).Buffer;const en=[Xe.AccountAddress,Xe.Name,Xe.Commitment,Xe.OracleAddress,Xe.ContractAddress,Xe.Channel];function tn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{serialize(e){const n=e.slice(0,2);if(!We(n,en))throw new _e(n);if(!We(n,t))throw new b("Address encoding",t.join(", "),n);const r=en.indexOf(n)+1;return Zt.from([...Xt(r),...dt(e)])},deserialize(e){const n=Zt.from(e).readUIntBE(0,1),r=en[n-1];if(null==r)throw new Te(n);if(!We(r,t))throw new b("Address encoding",t.join(", "),r);return pt(e.subarray(1),r)}}}var nn=N(9408).Buffer,rn={serialize(e){return nn.from([e?1:0])},deserialize(e){return 1===e[0]}},an=N(9408).Buffer;function on(e,t){return pt(wt(an.from([...dt(e),...Xt(t)])),Xe.ContractAddress)}function sn(e,t,n){return pt(wt(an.from([...dt(e),...function(e){const t=Xt(e,!0);return Le([an.alloc(32-t.length),t])}(t),...dt(n)])),Xe.OracleQueryId)}function cn(e){return pt(wt(e.toLowerCase()),Xe.Name)}function un(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt();return pt(wt(Le([an.from(e.toLowerCase()),an.from(t.toString(16).padStart(64,"0"),"hex")])),Xe.Commitment)}function ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:an.from([]);return new(c())(an.from(e).toString("hex"),16).toString(10)}const dn=".chain";function pn(e){return e.endsWith(dn)}const mn=[[Xe.AccountAddress,"account_pubkey"],[Xe.OracleAddress,"oracle_pubkey"],[Xe.ContractAddress,"contract_pubkey"],[Xe.Channel,"channel"]];function hn(e){dt(e);const t=e.substring(0,2),n=mn.find((e=>{let[n]=e;return n===t}))?.[1];if(null!=n)return n;throw new b("identifier",`prefixed with one of ${mn.map((e=>{let[t]=e;return`${t}_`})).join(", ")}`,e)}function fn(e){const t=e.length-dn.length;return Dt[Math.min(t,Rt)]}function yn(e){let{startFee:t,increment:n=Mt}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number(n)!==n||n%1==0)throw new be(`Increment must be float. Current increment ${n}`);if(n<Mt)throw new be(`minimum increment percentage is ${Mt}`);return u(new(c())(null!=t?t:fn(e)).times(new(c())(Mt).plus(1)))}function gn(e,t){var n,r,a;const i=e.length-dn.length;return(null!==(n=null!==(r=null!==(a=i<=4?62*Bt:null)&&void 0!==a?a:i<=8?31*Bt:null)&&void 0!==r?r:i<=12?Bt:null)&&void 0!==n?n:0)+t}function wn(e){return e.length<13+dn.length}var Nn={serialize(e){if(e<0)throw new b("value","greater or equal to 0",e);return Xt(e,!0)},deserialize(e){return ln(e)}},vn={...Nn,serializeAettos(e){return null!=e?e:"0"},serialize(e,t,n){let{denomination:r=Ie.AETTOS}=n;return Nn.serialize(this.serializeAettos(null!=e?Oe(e,{denomination:r}):e,t))}},Cn={...vn,serialize(e,t,n){var r;if(null!==(r=e)&&void 0!==r||(e=0),0!=+e)throw new x(`Contract deposit is not refundable, so it should be equal 0, got ${e.toString()} instead`);return vn.serialize(e,t,n)}},Sn=N(9408).Buffer,bn=N(9408).Buffer,xn=N(9408).Buffer;const Tn=e=>{var t;const n=null!==(t={[Vt.ChannelForceProgressTx]:30,[Vt.ChannelOffChainTx]:0,[Vt.ChannelOffChainUpdateCallContract]:0,[Vt.ChannelOffChainUpdateCreateContract]:0,[Vt.ChannelOffChainUpdateDeposit]:0,[Vt.ChannelOffChainUpdateWithdraw]:0,[Vt.ChannelOffChainUpdateTransfer]:0,[Vt.ContractCreateTx]:5,[Vt.ContractCallTx]:12,[Vt.GaAttachTx]:5,[Vt.GaMetaTx]:5,[Vt.PayingForTx]:.2}[e])&&void 0!==t?t:1;return new(c())(15e3*n)},zn=(e,t,n)=>{let{relativeTtl:r,innerTxSize:a}=n;switch(e){case Vt.OracleRegisterTx:case Vt.OracleExtendTx:case Vt.OracleQueryTx:case Vt.OracleResponseTx:return new(c())(t).times(20).plus(Math.ceil(32e3*r/Math.floor(175200)));case Vt.GaMetaTx:case Vt.PayingForTx:return new(c())(t).minus(a).times(20);default:return new(c())(t).times(20)}};function _n(e){const t={[Vt.OracleRegisterTx]:"oracleTtlValue",[Vt.OracleExtendTx]:"oracleTtlValue",[Vt.OracleQueryTx]:"queryTtlValue",[Vt.OracleResponseTx]:"responseTtlValue"},{tag:n}=e;return Ge(n,t)?e[t[n]]:1}function An(e,t,n){const{length:r}=dt(e),a=t(e);let i=0;return a.tag!==Vt.GaMetaTx&&a.tag!==Vt.PayingForTx||(i=dt(n(a.tx.encodedTx)).length),Tn(a.tag).plus(zn(a.tag,r,{relativeTtl:_n(a),innerTxSize:i})).times(kt)}var qn={...vn,serializeAettos(e,t){let{rebuildTx:n,unpackTx:r,buildTx:a,_computingMinFee:i,_pickBiggerFee:o}=t;if(null!=i)return i.toFixed();const s=function(e,t,n){let r,a=new(c())(0);do{r=a,a=An(e(a),t,n)}while(!a.eq(r));return a}((e=>n({_computingMinFee:e})),r,a),u=new(c())(null!=e?e:s);if(s.gt(u)){if(!0===o)return s.toFixed();throw new x(`Fee ${u.toString()} must be bigger then ${s}`)}return u.toFixed()}},Pn={serialize(e){return Nn.serialize(e)},deserialize(e){return+Nn.deserialize(e)}},En={...Pn,serialize(e,t,n){let{tag:r,rebuildTx:a,unpackTx:i,buildTx:o,_computingGasLimit:s}=t,{gasMax:c=6e6}=n;if(null!=s)return Pn.serialize(s);const u=r===Vt.GaMetaTx?At:function(e,t,n,r){return e-+An(t(e),n,r).dividedBy(kt)}(c,(e=>a({_computingGasLimit:e,_pickBiggerFee:!0})),i,o),l=null!=e?e:u;if(l>u)throw new x(`Gas limit ${l} must be less or equal to ${u}`);return Pn.serialize(l)}},In={...vn,serializeAettos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kt.toString();if(+e<kt)throw new x(`Gas price ${e.toString()} must be bigger then ${kt}`);return e}};function kn(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function On(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,kn(e,t,"set"),n),n}function Mn(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,kn(e,t,"get"))}var Bn,Rn=N(9408).Buffer;function jn(e,t){Fn(e,t),t.add(e)}function Dn(e,t,n){Fn(e,t),t.set(e,n)}function Fn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $n(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Un(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}!function(e){e[e.Branch=0]="Branch",e[e.Extension=1]="Extension",e[e.Leaf=2]="Leaf"}(Bn||(Bn={}));var Vn=new WeakMap,Hn=new WeakMap,Ln=new WeakMap,Gn=new WeakMap,Wn=new WeakMap,Kn=new WeakMap,Qn=new WeakSet,Jn=new WeakSet;class Yn{get isComplete(){return Mn(this,Hn)}constructor(e,t,n,r){if(jn(this,Jn),jn(this,Qn),Dn(this,Vn,{writable:!0,value:void 0}),Dn(this,Hn,{writable:!0,value:!0}),Dn(this,Ln,{writable:!0,value:void 0}),Dn(this,Gn,{writable:!0,value:void 0}),Dn(this,Wn,{writable:!0,value:void 0}),Dn(this,Kn,{writable:!0,value:void 0}),On(this,Gn,t),On(this,Wn,n),On(this,Kn,r),On(this,Vn,e[0].toString("hex")),On(this,Ln,Object.fromEntries(e[1].map((e=>[e[0].toString("hex"),e[1]])))),null!=Mn(this,Ln)[Mn(this,Vn)])Object.entries(Mn(this,Ln)).forEach((e=>{let[t,n]=e;if(Un(Yn,Yn,Xn).call(Yn,n)!==t)throw new he;const{type:r}=Un(Yn,Yn,Zn).call(Yn,n);switch(r){case Bn.Branch:n.slice(0,16).filter((e=>e.length)).forEach((e=>{null==Mn(this,Ln)[e.toString("hex")]&&On(this,Hn,!1)}));break;case Bn.Extension:if(null==Mn(this,Ln)[n[1].toString("hex")])throw new fe("Can't find a node by hash in extension node");break;case Bn.Leaf:break;default:throw new B(`Unknown MPTree node type: ${r}`)}}));else{if(0!==Object.keys(Mn(this,Ln)).length)throw new fe("Can't find a node by root hash");On(this,Hn,!1)}}isEqual(e){return Mn(this,Vn)===Mn(e,Vn)}serialize(){return[Rn.from(Mn(this,Vn),"hex"),Object.entries(Mn(this,Ln)).map((e=>{let[t,n]=e;return[Rn.from(t,"hex"),n]}))]}get(e){const t=$n(this,Qn,er).call(this,dt(e).toString("hex"));return null==t?t:Mn(this,Kn).call(this,pt(t,Xe.Transaction),Mn(this,Wn))}toObject(){return Object.fromEntries($n(this,Jn,tr).call(this).filter((e=>{let[t]=e;return Mn(this,Gn)!==Xe.ContractAddress||66!==t.length})).map((e=>{let[t,n]=e;return[pt(Rn.from(t,"hex"),Mn(this,Gn)),Mn(this,Kn).call(this,pt(n,Xe.Transaction),Mn(this,Wn))]})))}}function Xn(e){return Rn.from(wt((0,Kt.encode)(e))).toString("hex")}function Zn(e){switch(e.length){case 17:return{type:Bn.Branch,...0!==e[16].length&&{value:e[16]}};case 2:{const t=e[0][0]>>4;if(t>3)throw new ge(t);const n=t<=1?Bn.Extension:Bn.Leaf,r=[0,2].includes(t)?2:1;return{type:n,...n===Bn.Leaf&&{value:e[1]},path:e[0].toString("hex").slice(r)}}default:throw new ye(e.length)}}function er(e){let t=Mn(this,Vn),n=e;for(;;){const e=Mn(this,Ln)[t];if(null==e){if(!this.isComplete)return;throw new B("Can't find node in complete tree")}const{type:r,value:a,path:i}=Un(Yn,Yn,Zn).call(Yn,e);switch(r){case Bn.Branch:if(0===n.length)return a;t=e[+`0x${n[0]}`].toString("hex"),n=n.substring(1);break;case Bn.Extension:if(n.substring(0,i?.length)!==i)return;t=e[1].toString("hex"),n=n.substring(i.length);break;case Bn.Leaf:if(i!==n)return;return a;default:throw new B(`Unknown MPTree node type: ${r}`)}}}function tr(){const e=[],t=(n,r)=>{const a=Mn(this,Ln)[n];if(null==a){if(!this.isComplete)return;throw new B("Can't find node in complete tree")}const{type:i,value:o,path:s}=Un(Yn,Yn,Zn).call(Yn,a);switch(i){case Bn.Branch:a.slice(0,16).map(((e,t)=>[e,t])).filter((e=>{let[t]=e;return t.length})).forEach((e=>{let[n,a]=e;return t(n.toString("hex"),r+a.toString(16))})),null!=o&&e.push([r,o]);break;case Bn.Extension:t(a[1].toString("hex"),r+s);break;case Bn.Leaf:if(null==o)throw new R;e.push([r+s,o]);break;default:throw new B(`Unknown MPTree node type: ${i}`)}};return t(Mn(this,Vn),""),e}var nr=N(9408).Buffer,rr={serialize(e){return nr.from(e)},deserialize(e){return e.toString()}},ar={serialize(e){return rr.serialize(e)},deserialize(e){return rr.deserialize(e)}},ir={...vn,serializeAettos(e,t){const n=fn(t.name),r=new(c())(null!=e?e:n);if(n.gt(r))throw new F(r,n);return r.toFixed()},serialize(e,t,n){return vn.serialize.call(this,e,t,n)}};const or=tn(Xe.Name);var sr={...or,serialize(e){return or.serialize(pn(e)?cn(e):e)}};const cr=tn(...en);var ur={serialize(e){if(e.length>32)throw new x(`Expected 32 pointers or less, got ${e.length} instead`);return e.map((e=>[Xt(e.key),cr.serialize(e.id)]))},deserialize(e){return e.map((e=>{let[t,n]=e;return{key:t.toString(),id:cr.deserialize(n)}}))}},lr=N(9408).Buffer,dr={serialize(e){return lr.from(e)},deserialize(e){return e}},pr={serialize(e){return Xt(e)},deserialize(e){return e.toString()}},mr={...Pn,serialize(e){return Pn.serialize(null!=e?e:0)},async prepare(e,t,n){let{onNode:r,absoluteTtl:a}=n;if(!0!==a&&0!==e&&null!=e){if(null==r)throw new b("onNode","provided",r);e+=(await r.getCurrentKeyBlock()).height}return e}};const hr=Jt,fr=tn,yr=function(e){return{serialize(t,n){return t.map((t=>e.serialize(t,n)))},deserialize(t,n){return t.map((t=>e.deserialize(t,n)))}}},gr=rn,wr=vn,Nr=Wt,vr=Cn,Cr=function(e,t){return{serialize(e){if(null==e){if(!0===t)return Sn.from([]);throw new b("Encoded data","provided",e)}return dt(e)},deserialize(t){return pt(t,e)}}},Sr=function(e){return{serialize(t,n){let{buildTx:r}=n;return ArrayBuffer.isView(t)?bn.from(t):"string"==typeof t&&t.startsWith("tx_")?dt(t):dt(r({...t,...null!=e&&{tag:e}}))},deserialize(t,n){let{unpackTx:r}=n;const a=r(pt(t,Xe.Transaction));if(null!=e&&a.tag!==e)throw new b("Tag",e,a.tag);return a}}},br=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return{serialize(e){if("number"!=typeof e)throw new b("value","to be a number",e);if(e>255)throw new b("value","to be less than 256",e);if(!We(e,t))throw new b("value","to be a value of Enum",e);return xn.from([e])},deserialize(e){if(1!==e.length)throw new b("buffer","to have single element",e.length);const n=e[0];if(!We(n,t))throw new b("value","to be a value of Enum",n);return n}}},xr=qn,Tr=En,zr=In,_r=function(e,t){return{serialize(e,n){let{buildTx:r}=n;return dt(r({tag:Vt.Mtree,values:Object.entries(e).map((e=>{let[n,a]=e;return{tag:Vt.MtreeValue,key:dt(n),value:dt(r({...a,tag:t}))}}))}))},deserialize(n,r){let{unpackTx:a}=r;const{values:i}=a(pt(n,Xe.Transaction),Vt.Mtree);return Object.fromEntries(i.filter((t=>{let{key:n}=t;return e!==Xe.ContractAddress||32===n.length})).map((n=>{let{key:r,value:i}=n;return[pt(r,e),a(pt(i,Xe.Transaction),t)]})))},recursiveType:!0}},Ar=function(e,t){return{serialize(e){return e.serialize()},deserialize(n,r){let{unpackTx:a}=r;return new Yn(n,e,t,a)}}},qr=ar,Pr=ir,Er=sr,Ir=function(e){return{...Pn,async prepare(t,n,r){if(null!=t)return t;const{onNode:a,strategy:i}=r,o=r[e],s="provided (or provide `nonce` instead)";if(null==a)throw new b("onNode",s,a);if(null==o)throw new b("senderId",s,o);return(await a.getAccountNextNonce(o.replace(/^ok_/,"ak_"),{strategy:i}).catch((e=>{if(!Ke(e))throw e;return{nextNonce:1}}))).nextNonce},senderKey:e}},kr=ur,Or=dr,Mr=Pn,Br=function(e,t){return{serialize(n){if((!0!==t||null!=n)&&n!==e)throw new b("ShortUIntConst",e,n);return Pn.serialize(e)},deserialize(t){const n=Pn.deserialize(t);if(n!==e)throw new b("ShortUIntConst",e,n);return e},constValue:e,constValueOptional:!0===t}},Rr=pr,jr=mr,Dr=Nn,Fr=function(e){return{serialize(t,n){let{buildTx:r}=n;return dt(r({tag:e,payload:t}))},deserialize(t,n){let{unpackTx:r}=n;return r(pt(t,Xe.Transaction),e).payload},recursiveType:!0}};let $r;!function(e){e[e.delta=0]="delta",e[e.block=1]="block"}($r||($r={}));const Ur={type:$r.delta,value:500},Vr={type:$r.delta,value:10},Hr={type:$r.delta,value:10},Lr={pub:"ak_11111111111111111111111111111111273Yts",amount:100000000000000000000000000000000000n};let Gr;!function(e){e[e.Ok=0]="Ok",e[e.Error=1]="Error",e[e.Revert=2]="Revert"}(Gr||(Gr={}));const Wr=Sr(),Kr=Sr(Vt.SignedTx),Qr=yr(Sr(Vt.MtreeValue)),Jr=Sr(Vt.TreesPoi),Yr=_r(Xe.ContractAddress,Vt.Contract),Xr=_r(Xe.AccountAddress,Vt.Account),Zr=_r(Xe.Bytearray,Vt.ContractCall),ea=_r(Xe.Channel,Vt.Channel),ta=_r(Xe.Name,Vt.Name),na=_r(Xe.OracleAddress,Vt.Oracle),ra=[{tag:Br(Vt.Account),version:Br(1),nonce:Mr,balance:Dr},{tag:Br(Vt.Account),version:Br(2,!0),flags:Dr,nonce:Mr,balance:Dr,gaContract:fr(Xe.ContractAddress,Xe.Name),gaAuthFun:Cr(Xe.ContractBytearray)},{tag:Br(Vt.SignedTx),version:Br(1,!0),signatures:yr(Or),encodedTx:Wr},{tag:Br(Vt.SpendTx),version:Br(1,!0),senderId:fr(Xe.AccountAddress),recipientId:fr(Xe.AccountAddress,Xe.Name),amount:wr,fee:xr,ttl:jr,nonce:Ir("senderId"),payload:Cr(Xe.Bytearray,!0)},{tag:Br(Vt.Name),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nameTtl:Mr,status:Or,clientTtl:Mr,pointers:kr},{tag:Br(Vt.NamePreclaimTx),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),commitmentId:fr(Xe.Commitment),fee:xr,ttl:jr},{tag:Br(Vt.NameClaimTx),version:Br(2,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),name:qr,nameSalt:Dr,nameFee:Pr,fee:xr,ttl:jr},{tag:Br(Vt.NameUpdateTx),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),nameId:Er,nameTtl:Mr,pointers:kr,clientTtl:Mr,fee:xr,ttl:jr},{tag:Br(Vt.NameTransferTx),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),nameId:Er,recipientId:fr(Xe.AccountAddress,Xe.Name),fee:xr,ttl:jr},{tag:Br(Vt.NameRevokeTx),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),nameId:Er,fee:xr,ttl:jr},{tag:Br(Vt.Contract),version:Br(1,!0),owner:fr(Xe.AccountAddress),ctVersion:Nr,code:Cr(Xe.ContractBytearray),log:Cr(Xe.ContractBytearray),active:gr,referers:yr(fr(Xe.AccountAddress)),deposit:vr},{tag:Br(Vt.ContractCreateTx),version:Br(1,!0),ownerId:fr(Xe.AccountAddress),nonce:Ir("ownerId"),code:Cr(Xe.ContractBytearray),ctVersion:Nr,fee:xr,ttl:jr,deposit:vr,amount:wr,gasLimit:Tr,gasPrice:zr,callData:Cr(Xe.ContractBytearray)},{tag:Br(Vt.ContractCallTx),version:Br(1,!0),callerId:fr(Xe.AccountAddress),nonce:Ir("callerId"),contractId:fr(Xe.ContractAddress,Xe.Name),abiVersion:hr,fee:xr,ttl:jr,amount:wr,gasLimit:Tr,gasPrice:zr,callData:Cr(Xe.ContractBytearray)},{tag:Br(Vt.ContractCall),version:Br(2,!0),callerId:fr(Xe.AccountAddress),callerNonce:Mr,height:Mr,contractId:fr(Xe.ContractAddress),gasPrice:Dr,gasUsed:Mr,returnValue:Cr(Xe.ContractBytearray),returnType:br(Gr),log:yr(Or)},{tag:Br(Vt.Oracle),version:Br(1,!0),accountId:fr(Xe.AccountAddress),queryFormat:Rr,responseFormat:Rr,queryFee:wr,oracleTtlValue:Mr,abiVersion:hr},{tag:Br(Vt.OracleRegisterTx),version:Br(1,!0),accountId:fr(Xe.AccountAddress),nonce:Ir("accountId"),queryFormat:Rr,responseFormat:Rr,queryFee:wr,oracleTtlType:br($r),oracleTtlValue:Mr,fee:xr,ttl:jr,abiVersion:hr},{tag:Br(Vt.OracleExtendTx),version:Br(1,!0),oracleId:fr(Xe.OracleAddress,Xe.Name),nonce:Ir("oracleId"),oracleTtlType:br($r),oracleTtlValue:Mr,fee:xr,ttl:jr},{tag:Br(Vt.OracleQueryTx),version:Br(1,!0),senderId:fr(Xe.AccountAddress),nonce:Ir("senderId"),oracleId:fr(Xe.OracleAddress,Xe.Name),query:Rr,queryFee:wr,queryTtlType:br($r),queryTtlValue:Mr,responseTtlType:br($r),responseTtlValue:Mr,fee:xr,ttl:jr},{tag:Br(Vt.OracleResponseTx),version:Br(1,!0),oracleId:fr(Xe.OracleAddress),nonce:Ir("oracleId"),queryId:Cr(Xe.OracleQueryId),response:Rr,responseTtlType:br($r),responseTtlValue:Mr,fee:xr,ttl:jr},{tag:Br(Vt.ChannelCreateTx),version:Br(2,!0),initiator:fr(Xe.AccountAddress),initiatorAmount:Dr,responder:fr(Xe.AccountAddress),responderAmount:Dr,channelReserve:Dr,lockPeriod:Dr,ttl:jr,fee:xr,initiatorDelegateIds:yr(fr(...en)),responderDelegateIds:yr(fr(...en)),stateHash:Cr(Xe.State),nonce:Ir("initiator")},{tag:Br(Vt.ChannelCloseMutualTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),initiatorAmountFinal:Dr,responderAmountFinal:Dr,ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelCloseSoloTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),payload:Cr(Xe.Transaction),poi:Jr,ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelSlashTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),payload:Cr(Xe.Transaction),poi:Jr,ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelDepositTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),amount:Dr,ttl:jr,fee:xr,stateHash:Cr(Xe.State),round:Mr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelWithdrawTx),version:Br(1,!0),channelId:fr(Xe.Channel),toId:fr(Xe.AccountAddress),amount:Dr,ttl:jr,fee:xr,stateHash:Cr(Xe.State),round:Mr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelSettleTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),initiatorAmountFinal:Dr,responderAmountFinal:Dr,ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelForceProgressTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),payload:Cr(Xe.Transaction),round:Mr,update:Cr(Xe.ContractBytearray),stateHash:Cr(Xe.State),offChainTrees:Cr(Xe.StateTrees),ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelOffChainTx),version:Br(2,!0),channelId:fr(Xe.Channel),round:Mr,stateHash:Cr(Xe.State)},{tag:Br(Vt.Channel),version:Br(3,!0),initiator:fr(Xe.AccountAddress),responder:fr(Xe.AccountAddress),channelAmount:Dr,initiatorAmount:Dr,responderAmount:Dr,channelReserve:Dr,initiatorDelegateIds:yr(fr(...en)),responderDelegateIds:yr(fr(...en)),stateHash:Cr(Xe.State),round:Mr,soloRound:Dr,lockPeriod:Dr,lockedUntil:Dr,initiatorAuth:Cr(Xe.ContractBytearray),responderAuth:Cr(Xe.ContractBytearray)},{tag:Br(Vt.ChannelSnapshotSoloTx),version:Br(1,!0),channelId:fr(Xe.Channel),fromId:fr(Xe.AccountAddress),payload:Cr(Xe.Transaction),ttl:jr,fee:xr,nonce:Ir("fromId")},{tag:Br(Vt.ChannelOffChainUpdateTransfer),version:Br(1,!0),from:fr(Xe.AccountAddress),to:fr(Xe.AccountAddress),amount:Dr},{tag:Br(Vt.ChannelOffChainUpdateDeposit),version:Br(1,!0),from:fr(Xe.AccountAddress),amount:Dr},{tag:Br(Vt.ChannelOffChainUpdateWithdraw),version:Br(1,!0),from:fr(Xe.AccountAddress),amount:Dr},{tag:Br(Vt.ChannelOffChainUpdateCreateContract),version:Br(1,!0),owner:fr(Xe.AccountAddress),ctVersion:Nr,code:Cr(Xe.ContractBytearray),deposit:Dr,callData:Cr(Xe.ContractBytearray)},{tag:Br(Vt.ChannelOffChainUpdateCallContract),version:Br(1,!0),caller:fr(Xe.AccountAddress),contract:fr(Xe.ContractAddress),abiVersion:hr,amount:Dr,callData:Cr(Xe.ContractBytearray),callStack:Or,gasPrice:zr,gasLimit:Tr},{tag:Br(Vt.ChannelClientReconnectTx),version:Br(1,!0),channelId:fr(Xe.Channel),round:Mr,role:Rr,pubkey:fr(Xe.AccountAddress)},{tag:Br(Vt.TreesPoi),version:Br(1,!0),accounts:yr(Ar(Xe.AccountAddress,Vt.Account)),calls:yr(Ar(Xe.Bytearray,Vt.ContractCall)),channels:yr(Ar(Xe.Channel,Vt.Channel)),contracts:yr(Ar(Xe.ContractAddress,Vt.Contract)),ns:yr(Ar(Xe.Name,Vt.Name)),oracles:yr(Ar(Xe.OracleAddress,Vt.Oracle))},{tag:Br(Vt.StateTrees),version:Br(0,!0),contracts:Fr(Vt.ContractsMtree),calls:Fr(Vt.CallsMtree),channels:Fr(Vt.ChannelsMtree),ns:Fr(Vt.NameserviceMtree),oracles:Fr(Vt.OraclesMtree),accounts:Fr(Vt.AccountsMtree)},{tag:Br(Vt.Mtree),version:Br(1,!0),values:Qr},{tag:Br(Vt.MtreeValue),version:Br(1,!0),key:Or,value:Or},{tag:Br(Vt.ContractsMtree),version:Br(1,!0),payload:Yr},{tag:Br(Vt.CallsMtree),version:Br(1,!0),payload:Zr},{tag:Br(Vt.ChannelsMtree),version:Br(1,!0),payload:ea},{tag:Br(Vt.NameserviceMtree),version:Br(1,!0),payload:ta},{tag:Br(Vt.OraclesMtree),version:Br(1,!0),payload:na},{tag:Br(Vt.AccountsMtree),version:Br(1,!0),payload:Xr},{tag:Br(Vt.GaAttachTx),version:Br(1,!0),ownerId:fr(Xe.AccountAddress),nonce:Ir("ownerId"),code:Cr(Xe.ContractBytearray),authFun:Or,ctVersion:Nr,fee:xr,ttl:jr,gasLimit:Tr,gasPrice:zr,callData:Cr(Xe.ContractBytearray)},{tag:Br(Vt.GaMetaTx),version:Br(2,!0),gaId:fr(Xe.AccountAddress),authData:Cr(Xe.ContractBytearray),abiVersion:hr,fee:xr,gasLimit:Tr,gasPrice:zr,tx:Kr},{tag:Br(Vt.PayingForTx),version:Br(1,!0),payerId:fr(Xe.AccountAddress),nonce:Ir("payerId"),fee:xr,tx:Kr},{tag:Br(Vt.GaMetaTxAuthData),version:Br(1,!0),fee:wr,gasPrice:zr,txHash:Cr(Xe.TxHash)}];function aa(e,t){var n;const r=ra.filter((t=>t.tag.constValue===e));if(0===r.length)throw new ze(`${Vt[e]} (${e})`,0);null!==(n=t)&&void 0!==n||(t=Math.max(...r.map((e=>e.version.constValue))));const a=r.find((e=>e.version.constValue===t));if(null==a)throw new ze(`${Vt[e]} (${e})`,t);return Object.entries(a)}function ia(e){let{prefix:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=aa(e.tag,e.version).map((t=>{let[n,r]=t;return r.serialize(e[n],{...e,unpackTx:sa,buildTx:ia,rebuildTx:t=>ia({...e,...t})},e)}));return pt((0,Kt.encode)(n),null!=t?t:Xe.Transaction)}async function oa(e){return await Promise.all(aa(e.tag,e.version).map((async t=>{let[n,r]=t;null!=r.prepare&&(e[n]=await r.prepare(e[n],e,e))}))),ia(e)}function sa(e,t){const n=(0,Kt.decode)(dt(e)),r=+ln(n[0]),a=aa(r,+ln(n[1]));if(null!=t&&t!==r)throw new ve(`Expected transaction to have ${Vt[t]} tag, got ${Vt[r]} instead`);if(n.length!==a.length)throw new b("Transaction RLP length",a.length,n.length);return a.reduce(((e,t,r)=>{let[a,i]=t;return{...e,[a]:i.deserialize(n[r],{unpackTx:sa})}}),{})}function ca(e){return pt(wt("string"==typeof e&&e.startsWith("tx_")?dt(e):e),Xe.TxHash)}function ua(e){const t=sa(e);if(Vt.ContractCreateTx!==t.tag&&Vt.GaAttachTx!==t.tag)throw new b("contractTx","a contractCreateTx or gaAttach",t.tag);return on(t.ownerId,t.nonce)}function la(e,t,n){const r=e=>e.split(/[-+]/)[0].split(".").map((e=>+e)),a=r(e),i=r(t),o=r(n),s=Math.max(...a,...i,...o)+1,c=e=>e.reverse().reduce(((e,t,n)=>e+t*s**n),0),u=c(a),l=c(i),d=c(o);return u>=l&&u<d}const da=()=>{const e=new Map;return{policy:{name:"request-queues",async sendRequest(t,n){var r;const a=t.headers.get("__queue");t.headers.delete("__queue");const i=async()=>n(t);if(null==a)return i();const o=(null!==(r=e.get(a))&&void 0!==r?r:Promise.resolve()).then(i,i);return e.set(a,o.then((async()=>Ve(750)))),o}},position:"perCall"}},pa=()=>{const e=new Map;return{policy:{name:"combine-get-requests",async sendRequest(t,n){var r;if("GET"!==t.method)return n(t);const a=JSON.stringify([t.url,t.body]),i=null!==(r=e.get(a))&&void 0!==r?r:n(t);e.set(a,i);try{return await i}finally{e.delete(a)}}},position:"perCall"}},ma=()=>{const e=new Map;return{policy:{name:"aggressive-cache-get-responses",async sendRequest(t,n){var r;if("GET"!==t.method)return n(t);const a=JSON.stringify([t.url,t.body]),i=null!==(r=e.get(a))&&void 0!==r?r:n(t);return e.set(a,i),i}},position:"perCall"}},ha=e=>({policy:{name:"error-formatter",async sendRequest(t,n){try{return await n(t)}catch(t){if(!(t instanceof $e.RestError)||null==t.request)throw t;if(null==t.response?.bodyAsText)throw t;let n;try{n=JSON.parse(t.response.bodyAsText)}catch(e){throw t}t.message=`${new URL(t.request.url).pathname.slice(1)} error`;const r=e(n);throw""!==r&&(t.message+=`:${r}`),t}}},position:"perCall"}),fa=(e,t,n,r,a)=>({name:"version-check",async sendRequest(i,o){if(new URL(i.url).pathname===t)return o(i);const s=await n;if(s instanceof Error)throw s;const c=[s,r,a];if(!la(...c))throw new M(e,...c);return o(i)}}),ya=(e,t)=>({policy:{name:"retry-on-failure",async sendRequest(n,r){const a=[200,400,403],i=new Array(e).fill(0).map(((t,n)=>((n+1)/e)**2)),o=i.reduce(((e,t)=>e+t)),s=i.map((e=>e/o*t));let c;for(let t=0;t<=e;t+=1){if(null!=c){var u;if(!(c instanceof $e.RestError)||a.includes(null!==(u=c.response?.status)&&void 0!==u?u:0))throw c;await Ve(s[t-1])}try{return await r(n)}catch(e){c=e}}if(null==c)throw new R;throw c}},position:"perCall"});var ga=N(4711);const wa={type:{name:"Composite",className:"Header",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",type:{name:"String"}},beneficiary:{serializedName:"beneficiary",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",type:{name:"String"}},pofHash:{serializedName:"pof_hash",type:{name:"String"}},txsHash:{serializedName:"txs_hash",type:{name:"String"}},signature:{serializedName:"signature",type:{name:"String"}}}}},Na={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},va={type:{name:"Composite",className:"KeyBlock",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",required:!0,type:{name:"String"}},beneficiary:{serializedName:"beneficiary",required:!0,type:{name:"String"}},target:{serializedName:"target",required:!0,type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",required:!0,type:{name:"String"}}}}},Ca={type:{name:"Composite",className:"HashResponse",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}}}}},Sa={type:{name:"Composite",className:"HeightResponse",modelProperties:{height:{serializedName:"height",required:!0,type:{name:"String"}}}}},ba={type:{name:"Composite",className:"MicroBlockHeader",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},pofHash:{serializedName:"pof_hash",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},txsHash:{serializedName:"txs_hash",required:!0,type:{name:"String"}},signature:{serializedName:"signature",required:!0,type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}}}}},xa={type:{name:"Composite",className:"SignedTxs",modelProperties:{transactions:{serializedName:"transactions",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedTx"}}}}}}},Ta={type:{name:"Composite",className:"SignedTx",modelProperties:{tx:{serializedName:"tx",type:{name:"Composite",className:"Tx"}},blockHeight:{serializedName:"block_height",required:!0,type:{name:"String"}},blockHash:{serializedName:"block_hash",required:!0,type:{name:"String"}},hash:{serializedName:"hash",required:!0,type:{name:"String"}},signatures:{serializedName:"signatures",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},za={serializedName:"Tx",type:{name:"Composite",className:"Tx",uberParent:"Tx",polymorphicDiscriminator:{serializedName:"type",clientName:"type"},modelProperties:{recipientId:{serializedName:"recipient_id",type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",type:{name:"String"}},initiatorId:{serializedName:"initiator_id",type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",type:{name:"String"}},responderId:{serializedName:"responder_id",type:{name:"String"}},responderAmount:{serializedName:"responder_amount",type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",type:{name:"String"}},lockPeriod:{serializedName:"lock_period",type:{name:"String"}},stateHash:{serializedName:"state_hash",type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},channelId:{serializedName:"channel_id",type:{name:"String"}},fromId:{serializedName:"from_id",type:{name:"String"}},round:{serializedName:"round",type:{name:"String"}},toId:{serializedName:"to_id",type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",type:{name:"String"}},poi:{serializedName:"poi",type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},queryFormat:{serializedName:"query_format",type:{name:"String"}},responseFormat:{serializedName:"response_format",type:{name:"String"}},queryFee:{serializedName:"query_fee",type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},accountId:{serializedName:"account_id",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},oracleId:{serializedName:"oracle_id",type:{name:"String"}},query:{serializedName:"query",type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},queryId:{serializedName:"query_id",type:{name:"String"}},response:{serializedName:"response",type:{name:"String"}},commitmentId:{serializedName:"commitment_id",type:{name:"String"}},name:{serializedName:"name",type:{name:"String"}},nameSalt:{serializedName:"name_salt",type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},nameId:{serializedName:"name_id",type:{name:"String"}},nameTtl:{serializedName:"name_ttl",type:{name:"String"}},pointers:{serializedName:"pointers",type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",type:{name:"String"}},ownerId:{serializedName:"owner_id",type:{name:"String"}},code:{serializedName:"code",type:{name:"String"}},vmVersion:{serializedName:"vm_version",type:{name:"String"}},deposit:{serializedName:"deposit",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},gasPrice:{serializedName:"gas_price",type:{name:"String"}},callData:{serializedName:"call_data",type:{name:"String"}},callerId:{serializedName:"caller_id",type:{name:"String"}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",type:{name:"String"}},gaId:{serializedName:"ga_id",type:{name:"String"}},authData:{serializedName:"auth_data",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}},payerId:{serializedName:"payer_id",type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["SpendTx","ChannelCreateTx","ChannelDepositTx","ChannelWithdrawTx","ChannelForceProgressTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelSettleTx","ChannelSnapshotSoloTx","ChannelSetDelegatesTx","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleRespondTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","ContractCreateTx","ContractCallTx","GAAttachTx","GAMetaTx","PayingForTx"]}}}}},_a={type:{name:"Composite",className:"Delegates",modelProperties:{initiator:{serializedName:"initiator",type:{name:"Sequence",element:{type:{name:"String"}}}},responder:{serializedName:"responder",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Aa={type:{name:"Composite",className:"OffChainUpdate",uberParent:"OffChainUpdate",polymorphicDiscriminator:{serializedName:"op",clientName:"op"},modelProperties:{op:{serializedName:"op",required:!0,type:{name:"String"}}}}},qa={type:{name:"Composite",className:"RelativeTTL",modelProperties:{type:{defaultValue:"delta",isConstant:!0,serializedName:"type",type:{name:"String"}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},Pa={type:{name:"Composite",className:"Ttl",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["delta","block"]}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},Ea={type:{name:"Composite",className:"NamePointer",modelProperties:{key:{serializedName:"key",required:!0,type:{name:"String"}},id:{serializedName:"id",required:!0,type:{name:"String"}}}}},Ia={type:{name:"Composite",className:"CountResponse",modelProperties:{count:{serializedName:"count",required:!0,type:{name:"String"}}}}},ka={type:{name:"Composite",className:"Generation",modelProperties:{keyBlock:{serializedName:"key_block",type:{name:"Composite",className:"KeyBlock"}},microBlocks:{serializedName:"micro_blocks",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Oa={type:{name:"Composite",className:"Account",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},balance:{serializedName:"balance",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},payable:{serializedName:"payable",type:{name:"Boolean"}},kind:{serializedName:"kind",type:{name:"Enum",allowedValues:["basic","generalized"]}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{serializedName:"auth_fun",type:{name:"String"}}}}},Ma={type:{name:"Composite",className:"NextNonceResponse",modelProperties:{nextNonce:{serializedName:"next_nonce",required:!0,type:{name:"String"}}}}},Ba={type:{name:"Composite",className:"DryRunInput",modelProperties:{top:{serializedName:"top",type:{name:"String"}},accounts:{serializedName:"accounts",type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunAccount"}}}},txs:{serializedName:"txs",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunInputItem"}}}},txEvents:{defaultValue:!1,serializedName:"tx_events",type:{name:"Boolean"}}}}},Ra={type:{name:"Composite",className:"DryRunAccount",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},ja={type:{name:"Composite",className:"DryRunInputItem",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},callReq:{serializedName:"call_req",type:{name:"Composite",className:"DryRunCallReq"}}}}},Da={type:{name:"Composite",className:"DryRunCallReq",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},caller:{serializedName:"caller",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},context:{serializedName:"context",type:{name:"Composite",className:"DryRunCallContext"}}}}},Fa={type:{name:"Composite",className:"DryRunCallContext",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},txHash:{serializedName:"tx_hash",type:{name:"String"}},stateful:{serializedName:"stateful",type:{name:"Boolean"}}}}},$a={type:{name:"Composite",className:"DryRunResults",modelProperties:{results:{serializedName:"results",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunResult"}}}},txEvents:{serializedName:"tx_events",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},Ua={type:{name:"Composite",className:"DryRunResult",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"String"}},reason:{serializedName:"reason",type:{name:"String"}},callObj:{serializedName:"call_obj",type:{name:"Composite",className:"ContractCallObject"}}}}},Va={type:{name:"Composite",className:"ContractCallObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},callerNonce:{serializedName:"caller_nonce",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},log:{serializedName:"log",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Event"}}}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error","revert"]}}}}},Ha={type:{name:"Composite",className:"Event",modelProperties:{address:{serializedName:"address",required:!0,type:{name:"String"}},topics:{serializedName:"topics",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},La={type:{name:"Composite",className:"TxInfoObject",modelProperties:{callInfo:{serializedName:"call_info",type:{name:"Composite",className:"ContractCallObject"}},gaInfo:{serializedName:"ga_info",type:{name:"Composite",className:"GAObject"}},txInfo:{serializedName:"tx_info",type:{name:"String"}}}}},Ga={type:{name:"Composite",className:"GAObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error"]}},innerObject:{serializedName:"inner_object",type:{name:"Composite",className:"TxInfoObject"}}}}},Wa={type:{name:"Composite",className:"EncodedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},Ka={type:{name:"Composite",className:"PostTxResponse",modelProperties:{txHash:{serializedName:"tx_hash",required:!0,type:{name:"String"}}}}},Qa={type:{name:"Composite",className:"ContractObject",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},active:{serializedName:"active",required:!0,type:{name:"Boolean"}},referrerIds:{serializedName:"referrer_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}}}}},Ja={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Ya={type:{name:"Composite",className:"PoI",modelProperties:{poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Xa={type:{name:"Composite",className:"RegisteredOracle",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}}}}},Za={type:{name:"Composite",className:"OracleQueries",modelProperties:{oracleQueries:{serializedName:"oracle_queries",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"OracleQuery"}}}}}}},ei={type:{name:"Composite",className:"OracleQuery",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},senderNonce:{serializedName:"sender_nonce",required:!0,type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"Ttl"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}}}}},ti={type:{name:"Composite",className:"NameEntry",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},owner:{serializedName:"owner",type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}}}}},ni={type:{name:"Composite",className:"Channel",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},channelAmount:{serializedName:"channel_amount",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},soloRound:{serializedName:"solo_round",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},lockedUntil:{serializedName:"locked_until",required:!0,type:{name:"String"}}}}},ri={type:{name:"Composite",className:"PeerPubKey",modelProperties:{pubkey:{serializedName:"pubkey",required:!0,type:{name:"String"}}}}},ai={type:{name:"Composite",className:"Status",modelProperties:{genesisKeyBlockHash:{serializedName:"genesis_key_block_hash",required:!0,type:{name:"String"}},solutions:{serializedName:"solutions",required:!0,type:{name:"String"}},difficulty:{serializedName:"difficulty",required:!0,type:{name:"String"}},syncing:{serializedName:"syncing",required:!0,type:{name:"Boolean"}},syncProgress:{constraints:{InclusiveMaximum:100,InclusiveMinimum:0},serializedName:"sync_progress",type:{name:"Number"}},listening:{serializedName:"listening",required:!0,type:{name:"Boolean"}},protocols:{serializedName:"protocols",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Protocol"}}}},nodeVersion:{serializedName:"node_version",required:!0,type:{name:"String"}},nodeRevision:{serializedName:"node_revision",required:!0,type:{name:"String"}},peerCount:{serializedName:"peer_count",required:!0,type:{name:"String"}},peerConnections:{serializedName:"peer_connections",type:{name:"Composite",className:"PeerConnections"}},pendingTransactionsCount:{serializedName:"pending_transactions_count",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",required:!0,type:{name:"String"}},peerPubkey:{serializedName:"peer_pubkey",required:!0,type:{name:"String"}},topKeyBlockHash:{serializedName:"top_key_block_hash",required:!0,type:{name:"String"}},topBlockHeight:{serializedName:"top_block_height",required:!0,type:{name:"String"}}}}},ii={type:{name:"Composite",className:"Protocol",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}},effectiveAtHeight:{serializedName:"effective_at_height",required:!0,type:{name:"String"}}}}},oi={type:{name:"Composite",className:"PeerConnections",modelProperties:{inbound:{serializedName:"inbound",required:!0,type:{name:"String"}},outbound:{serializedName:"outbound",required:!0,type:{name:"String"}}}}},si={type:{name:"Composite",className:"SpendTx",modelProperties:{recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}}}}},ci={type:{name:"Composite",className:"OracleRegisterTx",modelProperties:{queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"Ttl"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}}}}},ui={type:{name:"Composite",className:"OracleExtendTx",modelProperties:{fee:{serializedName:"fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}}}}},li={type:{name:"Composite",className:"OracleQueryTx",modelProperties:{oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},di={type:{name:"Composite",className:"OracleRespondTx",modelProperties:{queryId:{serializedName:"query_id",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},pi={type:{name:"Composite",className:"NamePreclaimTx",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},mi={type:{name:"Composite",className:"NameClaimTx",modelProperties:{name:{serializedName:"name",required:!0,type:{name:"String"}},nameSalt:{serializedName:"name_salt",required:!0,type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},hi={type:{name:"Composite",className:"NameUpdateTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},nameTtl:{serializedName:"name_ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},fi={type:{name:"Composite",className:"NameTransferTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},yi={type:{name:"Composite",className:"NameRevokeTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},gi={type:{name:"Composite",className:"CommitmentId",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}}}}},wi={type:{name:"Composite",className:"NameHash",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}}}}},Ni={type:{name:"Composite",className:"ChannelCreateTx",modelProperties:{initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}}}}},vi={type:{name:"Composite",className:"ChannelDepositTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},Ci={type:{name:"Composite",className:"ChannelWithdrawTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},toId:{serializedName:"to_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},Si={type:{name:"Composite",className:"ChannelForceProgressTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}}}}},bi={type:{name:"Composite",className:"ChannelCloseMutualTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},xi={type:{name:"Composite",className:"ChannelCloseSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Ti={type:{name:"Composite",className:"ChannelSlashTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},zi={type:{name:"Composite",className:"ChannelSettleTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},_i={type:{name:"Composite",className:"ChannelSnapshotSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ai={type:{name:"Composite",className:"ChannelSetDelegatesTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},qi={type:{name:"Composite",className:"PubKey",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}}}}},Pi={type:{name:"Composite",className:"PeerDetails",modelProperties:{host:{serializedName:"host",required:!0,type:{name:"String"}},port:{serializedName:"port",required:!0,type:{name:"String"}},firstSeen:{serializedName:"first_seen",required:!0,type:{name:"String"}},lastSeen:{serializedName:"last_seen",required:!0,type:{name:"String"}},genesisHash:{serializedName:"genesis_hash",required:!0,type:{name:"String"}},topHash:{serializedName:"top_hash",required:!0,type:{name:"String"}},topDifficulty:{serializedName:"top_difficulty",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",type:{name:"String"}},nodeVersion:{serializedName:"node_version",type:{name:"String"}},nodeRevision:{serializedName:"node_revision",type:{name:"String"}},nodeVendor:{serializedName:"node_vendor",type:{name:"String"}},nodeOs:{serializedName:"node_os",type:{name:"String"}}}}},Ei={type:{name:"Composite",className:"Peers",modelProperties:{peers:{serializedName:"peers",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},blocked:{serializedName:"blocked",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Ii={type:{name:"Composite",className:"PeerCount",modelProperties:{connected:{serializedName:"connected",type:{name:"Composite",className:"PeerCountConnected"}},available:{serializedName:"available",type:{name:"Composite",className:"PeerCountAvailable"}},blocked:{serializedName:"blocked",required:!0,type:{name:"String"}}}}},ki={type:{name:"Composite",className:"PeerCountConnected",modelProperties:{inbound:{serializedName:"inbound",type:{name:"String"}},outbound:{serializedName:"outbound",type:{name:"String"}}}}},Oi={type:{name:"Composite",className:"PeerCountAvailable",modelProperties:{verified:{serializedName:"verified",type:{name:"String"}},unverified:{serializedName:"unverified",type:{name:"String"}}}}},Mi={type:{name:"Composite",className:"ContractCreateTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Bi={type:{name:"Composite",className:"ContractCallTx",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Ri={type:{name:"Composite",className:"UnsignedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},ji={type:{name:"Composite",className:"TokenSupply",modelProperties:{accounts:{serializedName:"accounts",type:{name:"String"}},contracts:{serializedName:"contracts",type:{name:"String"}},contractOracles:{serializedName:"contract_oracles",type:{name:"String"}},locked:{serializedName:"locked",type:{name:"String"}},oracles:{serializedName:"oracles",type:{name:"String"}},oracleQueries:{serializedName:"oracle_queries",type:{name:"String"}},pendingRewards:{serializedName:"pending_rewards",type:{name:"String"}},total:{serializedName:"total",type:{name:"String"}}}}},Di={type:{name:"Composite",className:"GAAttachTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",required:!0,type:{name:"String"}}}}},Fi={type:{name:"Composite",className:"GAMetaTx",modelProperties:{gaId:{serializedName:"ga_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},authData:{serializedName:"auth_data",required:!0,type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},$i={type:{name:"Composite",className:"PayingForTx",modelProperties:{payerId:{serializedName:"payer_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},Ui={type:{name:"Composite",className:"CheckTxInPoolResponse",modelProperties:{status:{serializedName:"status",required:!0,type:{name:"String"}}}}},Vi={serializedName:"OffChainTransfer",type:{name:"Composite",className:"OffChainTransfer",uberParent:"OffChainUpdate",polymorphicDiscriminator:Aa.type.polymorphicDiscriminator,modelProperties:{...Aa.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Hi={serializedName:"OffChainWithdrawal",type:{name:"Composite",className:"OffChainWithdrawal",uberParent:"OffChainUpdate",polymorphicDiscriminator:Aa.type.polymorphicDiscriminator,modelProperties:{...Aa.type.modelProperties,to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Li={serializedName:"OffChainDeposit",type:{name:"Composite",className:"OffChainDeposit",uberParent:"OffChainUpdate",polymorphicDiscriminator:Aa.type.polymorphicDiscriminator,modelProperties:{...Aa.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Gi={serializedName:"OffChainNewContract",type:{name:"Composite",className:"OffChainNewContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:Aa.type.polymorphicDiscriminator,modelProperties:{...Aa.type.modelProperties,owner:{serializedName:"owner",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},code:{serializedName:"code",type:{name:"Composite",className:"ByteCode"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Wi={serializedName:"OffChainCallContract",type:{name:"Composite",className:"OffChainCallContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:Aa.type.polymorphicDiscriminator,modelProperties:{...Aa.type.modelProperties,caller:{serializedName:"caller",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Ki={type:{name:"Composite",className:"CreateContractUnsignedTx",modelProperties:{...Ri.type.modelProperties,contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}}}}};let Qi={"Tx.Tx":za,OffChainUpdate:Aa,"OffChainUpdate.OffChainTransfer":Vi,"OffChainUpdate.OffChainWithdrawal":Hi,"OffChainUpdate.OffChainDeposit":Li,"OffChainUpdate.OffChainNewContract":Gi,"OffChainUpdate.OffChainCallContract":Wi};const Ji={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Yi={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},Xi={parameterPath:"intAsString",mapper:{defaultValue:!1,serializedName:"int-as-string",type:{name:"Boolean"}}},Zi={parameterPath:"hash",mapper:{serializedName:"hash",required:!0,type:{name:"String"}}},eo={parameterPath:"height",mapper:{constraints:{InclusiveMaximum:0x10000000000000000,InclusiveMinimum:0},serializedName:"height",required:!0,type:{name:"Number"}}},to={parameterPath:"pubkey",mapper:{serializedName:"pubkey",required:!0,type:{name:"String"}}},no={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},ro={parameterPath:"body",mapper:Ba},ao={parameterPath:"body",mapper:Wa};class io extends ga.ServiceClient{constructor(e,t){var n,r;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-node/1.0.0-beta.1",i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`;super({requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:i},endpoint:null!==(n=null!==(r=t.endpoint)&&void 0!==r?r:t.baseUri)&&void 0!==n?n:"{$host}"}),this.$host=e}getTopHeader(e){return this.sendOperationRequest({options:e},so)}getCurrentKeyBlock(e){return this.sendOperationRequest({options:e},co)}getCurrentKeyBlockHash(e){return this.sendOperationRequest({options:e},uo)}getCurrentKeyBlockHeight(e){return this.sendOperationRequest({options:e},lo)}getPendingKeyBlock(e){return this.sendOperationRequest({options:e},po)}getKeyBlockByHash(e,t){return this.sendOperationRequest({hash:e,options:t},mo)}getKeyBlockByHeight(e,t){return this.sendOperationRequest({height:e,options:t},ho)}getMicroBlockHeaderByHash(e,t){return this.sendOperationRequest({hash:e,options:t},fo)}getMicroBlockTransactionsByHash(e,t){return this.sendOperationRequest({hash:e,options:t},yo)}getMicroBlockTransactionByHashAndIndex(e,t,n){return this.sendOperationRequest({hash:e,index:t,options:n},go)}getMicroBlockTransactionsCountByHash(e,t){return this.sendOperationRequest({hash:e,options:t},wo)}getCurrentGeneration(e){return this.sendOperationRequest({options:e},No)}getGenerationByHash(e,t){return this.sendOperationRequest({hash:e,options:t},vo)}getGenerationByHeight(e,t){return this.sendOperationRequest({height:e,options:t},Co)}getAccountByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},So)}getAccountByPubkeyAndHeight(e,t,n){return this.sendOperationRequest({pubkey:e,height:t,options:n},bo)}getAccountByPubkeyAndHash(e,t,n){return this.sendOperationRequest({pubkey:e,hash:t,options:n},xo)}getPendingAccountTransactionsByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},To)}getAccountNextNonce(e,t){return this.sendOperationRequest({pubkey:e,options:t},zo)}protectedDryRunTxs(e,t){return this.sendOperationRequest({body:e,options:t},_o)}getTransactionByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Ao)}getTransactionInfoByHash(e,t){return this.sendOperationRequest({hash:e,options:t},qo)}postTransaction(e,t){return this.sendOperationRequest({body:e,options:t},Po)}getContract(e,t){return this.sendOperationRequest({pubkey:e,options:t},Eo)}getContractCode(e,t){return this.sendOperationRequest({pubkey:e,options:t},Io)}getContractPoI(e,t){return this.sendOperationRequest({pubkey:e,options:t},ko)}getOracleByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},Oo)}getOracleQueriesByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},Mo)}getOracleQueryByPubkeyAndQueryId(e,t,n){return this.sendOperationRequest({pubkey:e,queryId:t,options:n},Bo)}getNameEntryByName(e,t){return this.sendOperationRequest({name:e,options:t},Ro)}getChannelByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},jo)}getPeerPubkey(e){return this.sendOperationRequest({options:e},Do)}getStatus(e){return this.sendOperationRequest({options:e},Fo)}getChainEnds(e){return this.sendOperationRequest({options:e},$o)}}const oo=ga.createSerializer(e,!1),so={path:"/v3/headers/top",httpMethod:"GET",responses:{200:{bodyMapper:wa},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},co={path:"/v3/key-blocks/current",httpMethod:"GET",responses:{200:{bodyMapper:va},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},uo={path:"/v3/key-blocks/current/hash",httpMethod:"GET",responses:{200:{bodyMapper:Ca},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},lo={path:"/v3/key-blocks/current/height",httpMethod:"GET",responses:{200:{bodyMapper:Sa},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},po={path:"/v3/key-blocks/pending",httpMethod:"GET",responses:{200:{bodyMapper:va},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},mo={path:"/v3/key-blocks/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:va},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},ho={path:"/v3/key-blocks/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:va},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,eo],headerParameters:[Ji],serializer:oo},fo={path:"/v3/micro-blocks/hash/{hash}/header",httpMethod:"GET",responses:{200:{bodyMapper:ba},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},yo={path:"/v3/micro-blocks/hash/{hash}/transactions",httpMethod:"GET",responses:{200:{bodyMapper:xa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},go={path:"/v3/micro-blocks/hash/{hash}/transactions/index/{index}",httpMethod:"GET",responses:{200:{bodyMapper:Ta},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi,{parameterPath:"index",mapper:{constraints:{InclusiveMinimum:1},serializedName:"index",required:!0,type:{name:"Number"}}}],headerParameters:[Ji],serializer:oo},wo={path:"/v3/micro-blocks/hash/{hash}/transactions/count",httpMethod:"GET",responses:{200:{bodyMapper:Ia},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},No={path:"/v3/generations/current",httpMethod:"GET",responses:{200:{bodyMapper:ka},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},vo={path:"/v3/generations/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:ka},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},Co={path:"/v3/generations/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:ka},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,eo],headerParameters:[Ji],serializer:oo},So={path:"/v3/accounts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Oa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},bo={path:"/v3/accounts/{pubkey}/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:Oa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,eo,to],headerParameters:[Ji],serializer:oo},xo={path:"/v3/accounts/{pubkey}/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Oa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi,to],headerParameters:[Ji],serializer:oo},To={path:"/v3/accounts/{pubkey}/transactions/pending",httpMethod:"GET",responses:{200:{bodyMapper:xa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},zo={path:"/v3/accounts/{pubkey}/next-nonce",httpMethod:"GET",responses:{200:{bodyMapper:Ma},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi,{parameterPath:["options","strategy"],mapper:{defaultValue:"max",serializedName:"strategy",type:{name:"Enum",allowedValues:["max","continuity"]}}}],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},_o={path:"/v3/dry-run",httpMethod:"POST",responses:{200:{bodyMapper:$a},403:{bodyMapper:Na,isError:!0}},requestBody:ro,queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji,no],mediaType:"json",serializer:oo},Ao={path:"/v3/transactions/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Ta},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},qo={path:"/v3/transactions/{hash}/info",httpMethod:"GET",responses:{200:{bodyMapper:La},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,Zi],headerParameters:[Ji],serializer:oo},Po={path:"/v3/transactions",httpMethod:"POST",responses:{200:{bodyMapper:Ka},400:{bodyMapper:Na,isError:!0}},requestBody:ao,queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji,no],mediaType:"json",serializer:oo},Eo={path:"/v3/contracts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Qa},400:{bodyMapper:Na,isError:!0},404:{isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},Io={path:"/v3/contracts/{pubkey}/code",httpMethod:"GET",responses:{200:{bodyMapper:Ja},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},ko={path:"/v3/contracts/{pubkey}/poi",httpMethod:"GET",responses:{200:{bodyMapper:Ya},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},Oo={path:"/v3/oracles/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Xa},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},Mo={path:"/v3/oracles/{pubkey}/queries",httpMethod:"GET",responses:{200:{bodyMapper:Za},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi,{parameterPath:["options","from"],mapper:{serializedName:"from",type:{name:"String"}}},{parameterPath:["options","limit"],mapper:{defaultValue:20,constraints:{InclusiveMaximum:1e3,InclusiveMinimum:1},serializedName:"limit",type:{name:"Number"}}},{parameterPath:["options","type"],mapper:{defaultValue:"all",serializedName:"type",type:{name:"Enum",allowedValues:["open","closed","all"]}}}],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},Bo={path:"/v3/oracles/{pubkey}/queries/{query-id}",httpMethod:"GET",responses:{200:{bodyMapper:ei},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to,{parameterPath:"queryId",mapper:{serializedName:"query-id",required:!0,type:{name:"String"}}}],headerParameters:[Ji],serializer:oo},Ro={path:"/v3/names/{name}",httpMethod:"GET",responses:{200:{bodyMapper:ti},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,{parameterPath:"name",mapper:{serializedName:"name",required:!0,type:{name:"String"}}}],headerParameters:[Ji],serializer:oo},jo={path:"/v3/channels/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:ni},400:{bodyMapper:Na,isError:!0},404:{bodyMapper:Na,isError:!0}},queryParameters:[Xi],urlParameters:[Yi,to],headerParameters:[Ji],serializer:oo},Do={path:"/v3/peers/pubkey",httpMethod:"GET",responses:{200:{bodyMapper:ri}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},Fo={path:"/v3/status",httpMethod:"GET",responses:{200:{bodyMapper:ai}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo},$o={path:"/v3/status/chain-ends",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"String"}}}}}},queryParameters:[Xi],urlParameters:[Yi],headerParameters:[Ji],serializer:oo};function Uo(e,t){Vo(e,t),t.add(e)}function Vo(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ho(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}const Lo=["balance","queryFee","fee","amount","nameFee","channelAmount","initiatorAmount","responderAmount","channelReserve","initiatorAmountFinal","responderAmountFinal","gasPrice","deposit"],Go=["time","gas","gasUsed","nameSalt","nonce","nextNonce","height","blockHeight","topBlockHeight","ttl","nameTtl","clientTtl","inbound","outbound","peerCount","pendingTransactionsCount","effectiveAtHeight","version","solutions","round"];var Wo=new WeakSet,Ko=new WeakSet,Qo=new WeakSet;class Jo extends io{constructor(){super(...arguments),Uo(this,Qo),Uo(this,Ko),Uo(this,Wo)}async sendOperationRequest(e,t){const n=He(e,(e=>{let[t,n]=e;return[t,Ho(this,Ko,Xo).call(this,n)]}));return Ho(this,Qo,Zo).call(this,await super.sendOperationRequest(n,t))}}function Yo(e,t){return Array.isArray(e)?e.map((e=>Ho(this,Wo,Yo).call(this,e,t))):null!=e&&"object"==typeof e?He(e,(e=>{let[n,r]=e;return null==r?[n,r]:Lo.some((e=>e===n))?[n,t.bigInt(r)]:Go.some((e=>e===n))?[n,t.number(r)]:[n,Ho(this,Wo,Yo).call(this,r,t)]})):e}function Xo(e){return Ho(this,Wo,Yo).call(this,e,{bigInt:e=>e instanceof c()?e.toFixed():e.toString(),number:e=>e.toString()})}function Zo(e){return Ho(this,Wo,Yo).call(this,e,{bigInt:e=>BigInt(e),number:e=>+e})}var es=new WeakMap;class ts extends Jo{constructor(e){let{ignoreVersion:t=!1,retryCount:n=3,retryOverallDelay:r=800,...a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;if(super(e,{allowInsecureConnection:!0,additionalPolicies:[da(),pa(),ya(n,r),ha((e=>` ${e.reason}`))],...a}),o={writable:!0,value:void 0},Vo(this,i=es),i.set(this,o),!t){const e=this.getStatus(),t=e.then((e=>{let{nodeVersion:t}=e;return t}),(e=>e));On(this,es,e.then((e=>{let{networkId:t}=e;return t}),(e=>e))),this.pipeline.addPolicy(fa("node","/v3/status",t,"6.2.0","7.0.0"))}this.intAsString=!0}async getNetworkId(){var e;null!==(e=Mn(this,es))&&void 0!==e||On(this,es,this.getStatus().then((e=>{let{networkId:t}=e;return t})));const t=await Mn(this,es);if(t instanceof Error)throw t;return t}async getNodeInfo(){const{nodeVersion:e,networkId:t,protocols:n,topBlockHeight:r}=await this.getStatus(),a=n.filter((e=>{let{effectiveAtHeight:t}=e;return r>=t})).reduce(((e,t)=>t.effectiveAtHeight>e.effectiveAtHeight?t:e),{effectiveAtHeight:-1,version:0}).version;return{url:this.$host,nodeNetworkId:t,version:e,consensusProtocolVersion:a}}}function ns(e){const t=sa(e);switch(t.tag){case Vt.SignedTx:return ns(ia(t.encodedTx));case Vt.GaMetaTx:return t.gaId}const n=aa(t.tag,t.version).find((e=>{let[t]=e;return"nonce"===t}))?.[1];if(null==n)throw new C(`Transaction doesn't have nonce: ${Vt[t.tag]}`);if(!("senderKey"in n))throw new R;return t[n.senderKey].replace(/^ok_/,"ak_")}class rs{}var as=N(9408).Buffer;const is=new WeakMap;function os(e,t,n){const r=[t];n&&r.push("inner_tx");const a=dt(e);return Le([as.from(r.join("-")),wt(a)])}class ss extends rs{constructor(e){if(super(),64!==(e="string"==typeof e?as.from(e,"hex"):e).length)throw new b("secretKey","64 bytes",e.length);is.set(this,e),this.address=pt(vt(is.get(this)).publicKey,Xe.AccountAddress)}static generate(){return new ss(Ct().secretKey)}async sign(e,t){return St(e,is.get(this))}async signTransaction(e){let{innerTx:t,networkId:n,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==n)throw new b("networkId","provided",n);const a=dt(e),i=os(e,n,!0===t),o=[await this.sign(i,r)];return ia({tag:Vt.SignedTx,encodedTx:a,signatures:o})}async signMessage(e,t){return this.sign(xt(e),t)}}function cs(e){let{innerTx:t,gasUsed:n,queryFee:r,isInitiator:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=sa(e);if(i.tag===Vt.SignedTx)throw new x("Transaction shouldn't be a SignedTx, use `getExecutionCostBySignedTx` instead");let o=0n;return"fee"in i&&"freeloader"!==t&&(o+=BigInt(i.fee)),i.tag===Vt.NameClaimTx&&(o+=BigInt(i.nameFee)),i.tag===Vt.OracleQueryTx&&(o+=BigInt(i.queryFee)),i.tag===Vt.OracleResponseTx&&(o-=BigInt(null!=r?r:0)),i.tag===Vt.ChannelSettleTx&&(!0===a&&(o-=BigInt(i.initiatorAmountFinal)),!1===a&&(o-=BigInt(i.responderAmountFinal))),(i.tag===Vt.SpendTx&&i.senderId!==i.recipientId||i.tag===Vt.ContractCreateTx||i.tag===Vt.ContractCallTx||i.tag===Vt.ChannelDepositTx)&&"fee-payer"!==t&&(o+=BigInt(i.amount)),i.tag===Vt.ContractCreateTx&&(o+=BigInt(i.deposit)),i.tag!==Vt.ContractCreateTx&&i.tag!==Vt.ContractCallTx&&i.tag!==Vt.GaAttachTx&&i.tag!==Vt.GaMetaTx||"freeloader"===t||(o+=BigInt(i.gasPrice)*BigInt(null!=n?n:i.gasLimit)),i.tag!==Vt.GaMetaTx&&i.tag!==Vt.PayingForTx||(o+=cs(ia(i.tx.encodedTx),i.tag===Vt.PayingForTx?{innerTx:"fee-payer"}:{})),o}function us(e,t,n){const r=sa(e,Vt.SignedTx);if(r.encodedTx.tag===Vt.GaMetaTx)return cs(ia(r.encodedTx),n);const a=ia(r.encodedTx),i=ns(a),[o,s]=[!0,!1].map((e=>bt(os(a,t,e),r.signatures[0],i)));if(!o&&!s)throw new C("Can't verify signature");return cs(ia(r.encodedTx),{...o&&{innerTx:"freeloader"},...n})}async function ls(e,t){let{isMined:n,...r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=sa(e);const i=a.tag===Vt.SignedTx,o=i&&!0===n&&ca(e);if(a.tag===Vt.SignedTx&&(a=a.encodedTx),null==r.gasUsed&&!1!==o&&[Vt.ContractCreateTx,Vt.ContractCallTx,Vt.GaAttachTx,Vt.GaMetaTx].includes(a.tag)){const{callInfo:e,gaInfo:n}=await t.getTransactionInfoByHash(o),a=null!=e?e:n;if(null==a)throw new B(`callInfo and gaInfo is not available for transaction ${o}`);r.gasUsed=a.gasUsed}if(null==r.queryFee&&Vt.OracleResponseTx===a.tag&&(r.queryFee=(await t.getOracleByPubkey(a.oracleId)).queryFee.toString()),null==r.isInitiator&&Vt.ChannelSettleTx===a.tag&&!0!==n){const{initiatorId:e}=await t.getChannelByPubkey(a.channelId);r.isInitiator=a.fromId===e}return i?us(e,await t.getNetworkId(),r):cs(e,r)}var ds=N(9408).Buffer;const ps=[];async function ms(e,t,n){const r=ns(ia(e)),[a,{height:i},{consensusProtocolVersion:o,nodeNetworkId:s}]=await Promise.all([t.getAccountByPubkey(r).catch((e=>{if(!Ke(e))throw e;return{id:r,balance:0n,nonce:0}})).then((e=>({...e,id:e.id}))),t.getCurrentKeyBlockHeight(),t.getNodeInfo()]);return(await Promise.all(ps.map((async r=>r(e,{node:t,account:a,height:i,consensusProtocolVersion:o,nodeNetworkId:s,parentTxTypes:n}))))).flat()}async function hs(e,t){const n=new ts(t.$host,{ignoreVersion:!0,pipeline:t.pipeline.clone(),additionalPolicies:[ma()]});return ms(sa(e),n,[])}function fs(e,t){let{_expectedMineRate:n=18e4,_microBlockCycle:r=3e3,_maxPollInterval:a=5e3}=t;const i={block:n,microblock:r}[e];return Math.min(i/3,a)}ps.push(((e,t)=>{let{account:n,nodeNetworkId:r,parentTxTypes:a}=t;if(e.tag!==Vt.SignedTx)return[];const{encodedTx:i,signatures:o}=e;if(null==(null!=i?i:o))return[];if(1!==o.length)return[];const s=ds.from([r,...a.includes(Vt.PayingForTx)?["inner_tx"]:[]].join("-")),c=dt(ia(i)),u=Le([s,c]),l=Le([s,wt(c)]);return bt(u,o[0],n.id)||bt(l,o[0],n.id)?[]:[{message:"Signature cannot be verified, please ensure that you transaction have the correct prefix and the correct private key for the sender address",key:"InvalidSignature",checkedKeys:["encodedTx","signatures"]}]}),(async(e,t)=>{let n,{node:r,parentTxTypes:a}=t;return"encodedTx"in e&&(n=e.encodedTx),"tx"in e&&(n=e.tx),null==n?[]:ms(n,r,[...a,e.tag])}),((e,t)=>{let{height:n}=t;return"ttl"in e?0===e.ttl||e.ttl>=n?[]:[{message:`TTL ${e.ttl} is already expired, current height is ${n}`,key:"ExpiredTTL",checkedKeys:["ttl"]}]:[]}),(async(e,t)=>{let{account:n,parentTxTypes:r,node:a}=t;if(0!==r.length)return[];const i=await ls(ia(e),a).catch((()=>0n));return i<=n.balance?[]:[{message:`Account balance ${n.balance} is not enough to execute the transaction that costs ${i}`,key:"InsufficientBalance",checkedKeys:["amount","fee","nameFee","gasLimit","gasPrice"]}]}),((e,t)=>{let n,{account:r}=t;return e.tag===Vt.SignedTx&&"generalized"===r.kind&&0!==e.signatures.length&&(n="Generalized account can't be used to generate SignedTx with signatures"),e.tag===Vt.GaMetaTx&&"basic"===r.kind&&(n="Basic account can't be used to generate GaMetaTx"),null==n?[]:[{message:n,key:"InvalidAccountType",checkedKeys:["tag"]}]}),((e,t)=>{var n,r;let{consensusProtocolVersion:a}=t;const i=Vt.Oracle===e.tag||Vt.OracleRegisterTx===e.tag,o=Vt.ContractCreateTx===e.tag||Vt.GaAttachTx===e.tag,s=Vt.ContractCallTx===e.tag||Vt.GaMetaTx===e.tag,c=null!==(n=null!==(r=i?"oracle-call":null)&&void 0!==r?r:o?"contract-create":null)&&void 0!==n?n:s?"contract-call":null;if(null==c)return[];const u=Lt[a][c];let l;if("abiVersion"in e&&(l={abiVersion:e.abiVersion}),"ctVersion"in e&&(l=e.ctVersion),null==l)throw new R;return!u.abiVersion.includes(l.abiVersion)||o&&!u.vmVersion.includes(l.vmVersion)?[{message:`ABI/VM version ${JSON.stringify(l)} is wrong, supported is: ${JSON.stringify(u)}`,key:"VmAndAbiVersionMismatch",checkedKeys:["ctVersion","abiVersion"]}]:[]}),(async(e,t)=>{let{node:n}=t;if(Vt.ContractCallTx!==e.tag)return[];try{const{active:t}=await n.getContract(e.contractId);return t?[]:[{message:`Contract ${e.contractId} is not active`,key:"ContractNotActive",checkedKeys:["contractId"]}]}catch(e){if(null==e.response?.parsedBody?.reason)throw e;return[{message:e.response.parsedBody.reason,key:"ContractNotFound",checkedKeys:["contractId"]}]}}));class ys extends C{constructor(e,t,n){super(e),this.name="InvalidTxError",this.validation=t,this.transaction=n}}async function gs(e){let{onNode:t}=e;return(await t.getCurrentKeyBlockHeight()).height}async function ws(e,t){var n;let{blocks:r=10,interval:a,onNode:i,...o}=t;null!==(n=a)&&void 0!==n||(a=fs("microblock",o));const s=await gs({onNode:i})+r;do{const t=await i.getTransactionByHash(e);if(-1!==t.blockHeight)return t;await Ve(a)}while(await gs({onNode:i})<s);throw new P(r,e)}async function Ns(e,t){var n;let r,{interval:a,onNode:i,...o}=t;null!==(n=a)&&void 0!==n||(a=fs("block",o));do{null!=r&&await Ve(a),r=(await i.getCurrentKeyBlockHeight()).height}while(r<e);return r}async function vs(e,t){let{confirm:n=3,onNode:r,...a}=t;const{blockHeight:i}=await r.getTransactionByHash(e),o=await Ns(i+n,{onNode:r,...a}),{blockHeight:s}=await r.getTransactionByHash(e);switch(s){case-1:throw new Ae(e);case i:return o;default:return vs(e,{onNode:r,confirm:n,...a})}}async function Cs(e,t){let{onNode:n,onAccount:r,verify:a=!0,waitMined:i=!0,confirm:o,innerTx:s,...c}=t;const u=await r.signTransaction(e,{...c,onNode:n,innerTx:s,networkId:await n.getNetworkId()});if(!0===s)return{hash:ca(u),rawTx:u};if(a){const e=await hs(u,n);if(e.length>0){const t=`Transaction verification errors: ${e.map((e=>e.message)).join(", ")}`;throw new ys(t,e,u)}}try{let e;try{e=null!=r?`tx-${r.address}`:null}catch(t){e=null}const{txHash:t}=await n.postTransaction({tx:u},null!=e?{requestOptions:{customHeaders:{__queue:e}}}:{});if(i){const e=await ws(t,{onNode:n,...c}),r={...e,hash:e.hash,rawTx:u};if(null!=o&&(!0===o||o>0)){const e="boolean"==typeof o?void 0:o;return{...r,confirmationHeight:await vs(t,{onNode:n,confirm:e,...c})}}return r}return{hash:t,rawTx:u}}catch(e){throw Object.assign(e,{rawTx:u,verifyTx:async()=>hs(u,n)})}}async function Ss(e,t){let{height:n,hash:r,onNode:a}=t;return null!=n?a.getAccountByPubkeyAndHeight(e,n):null!=r?a.getAccountByPubkeyAndHash(e,r):a.getAccountByPubkey(e)}async function bs(e,t){let{format:n=Ie.AETTOS,...r}=t;const a=e.startsWith("ok_")?pt(dt(e),Xe.AccountAddress):e,{balance:i}=await Ss(a,r).catch((e=>{if(!Ke(e))throw e;return{balance:0n}}));return Oe(i,{targetDenomination:n})}async function xs(e){let{onNode:t}=e;return t.getCurrentGeneration()}async function Ts(e,t){let{onNode:n}=t;return"number"==typeof e?n.getGenerationByHeight(e):n.getGenerationByHash(e)}async function zs(e,t){let{onNode:n}=t;return(await n.getMicroBlockTransactionsByHash(e)).transactions}async function _s(e,t){let{onNode:n}=t;return"number"==typeof e?n.getKeyBlockByHeight(e):n.getKeyBlockByHash(e)}async function As(e,t){let{onNode:n}=t;return n.getMicroBlockHeaderByHash(e)}const qs=new Map;async function Ps(e,t){const n=qs.get(e);if(qs.delete(e),null==n)throw new B("Can't get dry-run request");let r;try{const e="number"==typeof n[0].top?(await _s(n[0].top,{onNode:t})).hash:n[0].top;r=await t.protectedDryRunTxs({top:e,txEvents:n[0].txEvents,txs:n.map((e=>({tx:e.tx}))),accounts:Array.from(new Set(n.map((e=>e.accountAddress)))).map((e=>({pubKey:e,amount:Lr.amount})))})}catch(e){return void n.forEach((t=>{let{reject:n}=t;return n(e)}))}const{results:a,txEvents:i}=r;a.forEach(((e,t)=>{let{result:r,reason:a,...o}=e;const{resolve:s,reject:c,tx:u,accountAddress:l}=n[t];"ok"===r?s({...o,txEvents:i}):c(Object.assign(new Se(a),{tx:u,accountAddress:l}))}))}async function Es(e,t,n){var r;let{top:a,txEvents:i,combine:o,onNode:s}=n;const c=!0===o?[a,i].join():"immediate",u=null!==(r=qs.get(c))&&void 0!==r?r:[];return qs.set(c,u),new Promise(((n,r)=>{var l;u.push({tx:e,accountAddress:t,top:a,txEvents:i,resolve:n,reject:r}),!0===o?null!==(l=u.timeout)&&void 0!==l||(u.timeout=setTimeout((()=>{Ps(c,s)}))):Ps(c,s)}))}async function Is(e,t){let{onNode:n}=t;return n.getContractCode(e)}async function ks(e,t){let{onNode:n}=t;return n.getContract(e)}async function Os(e,t){let{onNode:n}=t;return n.getNameEntryByName(e)}async function Ms(e,t,n){let{verify:r=!0,resolveByNode:a=!1,onNode:i}=n;if(pn(e)){if(r||a){const n=(await i.getNameEntryByName(e)).pointers.find((e=>e.key===t));if(null==n)throw new D(e,t);if(a)return n.id}return cn(e)}try{return dt(e),e}catch(t){throw new $(`Invalid name or address: ${e}`)}}var Bs=N(3983),Rs=N(7417),js=N(9408).Buffer;const Ds={async argon2id(e,t,n){const{memlimit_kib:r,opslimit:a}=n;return(0,Rs.hash)(e,{hashLength:32,salt:t,timeCost:a,memoryCost:r,type:Rs.argon2id})}},Fs={"xsalsa20-poly1305":{encrypt:je().secretbox,decrypt(){const e=je().secretbox.open(...arguments);if(null==e)throw new me;return e}}},$s={secret_type:"ed25519",symmetric_alg:"xsalsa20-poly1305",kdf:"argon2id",kdf_params:{memlimit_kib:65536,opslimit:3,parallelism:1}};function Us(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$s.symmetric_alg;return Fs[r].encrypt(e,n,t)}async function Vs(e,t,n,r){return Ds[n](e,t,r)}async function Hs(e,t){let{crypto:n}=t;const r=js.from(n.kdf_params.salt,"hex");return js.from(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$s.symmetric_alg;return Fs[r].decrypt(e,n,t)}(js.from(n.ciphertext,"hex"),await Vs(e,r,n.kdf,n.kdf_params),js.from(n.cipher_params.nonce,"hex"),n.symmetric_alg)).toString("hex")}async function Ls(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:je().randomBytes(24),a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:je().randomBytes(16),i=arguments.length>5?arguments[5]:void 0;const o={...$s,...i},s=await Vs(t,a,o.kdf,o.kdf_params),c="string"==typeof n?js.from(n,"hex"):n;return{name:e,version:1,public_key:ht(c),id:(0,Bs.v4)(),crypto:{secret_type:o.secret_type,symmetric_alg:o.symmetric_alg,ciphertext:js.from(Us(c,s,r,o.symmetric_alg)).toString("hex"),cipher_params:{nonce:js.from(r).toString("hex")},kdf:o.kdf,kdf_params:{...o.kdf_params,salt:js.from(a).toString("hex")}}}}var Gs=N(9882),Ws=N(1986),Ks=N(8236),Qs=N.n(Ks),Js=N(9408).Buffer;const Ys=Qs().ModeOfOperation.ecb;function Xs(e,t){const n=et(e);return new Ys(n).encrypt(t)}function Zs(e,t){const n=Js.from(t),r=et(e);return new Ys(r).decrypt(n)}class ec extends g{constructor(e){super(e),this.name="DerivationError"}}const tc=Js.from("ed25519 seed"),nc=2147483648;function rc(e,t){let{secretKey:n,chainCode:r}=e;if(t<nc)throw new ec(`Segment ${t} is not hardened`);const a=Js.allocUnsafe(4);a.writeUInt32BE(t,0);const i=Le([Js.alloc(1,0),n,a]),o=(0,Gs.full)(i,r);return{secretKey:o.slice(0,32),chainCode:o.slice(32)}}function ac(e,t){const n=""===e?[]:(0,Ws.fromString)(e).toPathArray();return n.forEach(((e,t)=>{if(e<nc)throw new ec(`Segment #${t+1} is not hardened`)})),n.reduce(((e,t)=>rc(e,t)),t)}function ic(e){const t=(0,Gs.full)(e,tc);return{secretKey:t.slice(0,32),chainCode:t.slice(32)}}function oc(e,t){if(!["m","m/"].includes(e.slice(0,2)))throw new ec("Root element is required");const n=ic(t);return ac(e.slice(2),n)}function sc(e){const{secretKey:t,publicKey:n}=e;return{secretKey:Js.from(t).toString("hex"),publicKey:pt(n,Xe.AccountAddress)}}function cc(e){return je().sign.keyPair.fromSeed(e)}function uc(e,t){const n=oc("m/44h/457h",e);return{secretKey:Js.from(Xs(t,n.secretKey)).toString("hex"),chainCode:Js.from(Xs(t,n.chainCode)).toString("hex")}}function lc(e,t,n){const r={secretKey:Zs(t,Js.from(e.secretKey,"hex")),chainCode:Zs(t,Js.from(e.chainCode,"hex"))};return new Array(n).fill(void 0).map(((e,t)=>sc(cc(ac(`${t}h/0h/0h`,r).secretKey))))}const dc=(e,t)=>({...sc(cc(ac(`${t}h/0h/0h`,oc("m/44h/457h",e)).secretKey)),idx:t});async function pc(e,t){return Cs(await oa({...t,tag:Vt.NameRevokeTx,nameId:e,accountId:t.onAccount.address}),t)}async function mc(e,t,n){let{extendPointers:r,...a}=n;const i={...!0===r&&Object.fromEntries((await Os(e,a)).pointers.map((e=>{let{key:t,id:n}=e;return[t,n]}))),...t};return Cs(await oa({clientTtl:It,nameTtl:qt,...a,tag:Vt.NameUpdateTx,nameId:e,accountId:a.onAccount.address,pointers:Object.entries(i).map((e=>{let[t,n]=e;return{key:t,id:n}}))}),a)}async function hc(e,t,n){return Cs(await oa({...n,tag:Vt.NameTransferTx,nameId:e,accountId:n.onAccount.address,recipientId:t}),n)}async function fc(e,t){const n=await Os(e,t);return Object.freeze({...n,id:n.id,owner:n.owner,async update(n,r){return{...await mc(e,n,{...t,...r}),...await fc(e,{...t,...r})}},async transfer(n,r){return{...await hc(e,n,{...t,...r}),...await fc(e,{...t,...r})}},async revoke(n){return pc(e,{...t,...n})},async extendTtl(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n>qt||n<=0)throw new b("nameTtl",`a number between 1 and ${qt} blocks`,n);return{...await mc(e,{},{...t,...r,nameTtl:n,extendPointers:!0}),...await fc(e,{...t,...r})}}})}async function yc(e,t,n){const r=await oa({...n,tag:Vt.NameClaimTx,accountId:n.onAccount.address,nameSalt:t,name:e}),a=await Cs(r,n);if(!wn(e)){const t=null!=a.blockHeight&&a.blockHeight>0?await fc(e,n):{};return Object.assign(a,t)}return a}async function gc(e,t){const n=yt(),r=un(e,n),a=await oa({...t,tag:Vt.NamePreclaimTx,accountId:t.onAccount.address,commitmentId:r});return Object.freeze({...await Cs(a,t),salt:n,commitmentId:r,async claim(r){const{version:a,...i}=t;return yc(e,n,{...i,...r})}})}async function wc(e,t,n){return yc(e,0,{...n,nameFee:t})}var Nc=N(7946);function vc(e,t){Cc(e,t),t.add(e)}function Cc(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sc(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var bc=new WeakSet,xc=new WeakSet,Tc=new WeakSet,zc=new WeakSet,_c=new WeakMap;function Ac(e,t,n,r){let a,{returnType:i,returnValue:o,log:s}=e;switch(i){case"ok":{const e=Sc(this,Tc,Pc).call(this,t);return{decodedResult:this._calldata.decode(this._name,e.name,o),decodedEvents:this.$decodeEvents(s,r)}}case"revert":a=this._calldata.decodeFateString(o);break;case"error":a=dt(o).toString();break;default:throw new B(`Unknown return type: ${i}`)}throw new se(a,n)}async function qc(e,t,n){const r=await Cs(e,{...this.$options,...n});return{hash:r.hash,tx:sa(r.rawTx),txData:r,rawTx:r.rawTx,...null!=r.blockHeight&&await this.$getCallResultByTxHash(r.hash,t,n)}}function Pc(e){const t=Mn(this,_c).functions.find((t=>t.name===e));if(null!=t)return t;if("init"===e)return{arguments:[],name:"init",payable:!1,returns:"unit",stateful:!0};throw new ce(`Function ${e} doesn't exist in contract`)}function Ec(e,t,n){let{contractAddressToName:r}=n;const a={...this.$options.contractAddressToName,...r};if(null!=a[e])return a[e];const i=this._aci.map((e=>{let{contract:t}=e;return t})).filter((e=>e?.event)).map((e=>[e.name,e.event.variant])).map((e=>{let[t,n]=e;return n.map((e=>[t,Object.keys(e)[0],Object.values(e)[0]]))})).flat().filter((e=>{let[,n]=e;return BigInt(`0x${wt(n).toString("hex")}`)===t})).filter(((e,t,n)=>{let[,,r]=e;return!n.slice(0,t).some((e=>{return t=e[2],n=r,JSON.stringify(t)===JSON.stringify(n);var t,n}))}));switch(i.length){case 0:throw new le(t.toString(),e);case 1:return i[0][0];default:throw new de(e,i)}}const Ic=class{async $compile(){if(null!=this.$options.bytecode)return this.$options.bytecode;if(null==this.$options.sourceCode)throw new x("Can't compile without source code");if(null==this.$options.onCompiler)throw new x("Can't compile without compiler");return this.$options.bytecode=(await this.$options.onCompiler.compileBySourceCode(this.$options.sourceCode,this.$options.fileSystem)).bytecode,this.$options.bytecode}async $getCallResultByTxHash(e,t,n){const{callInfo:r}=await this.$options.onNode.getTransactionInfoByHash(e);if(null==r)throw new y(`callInfo is not available for transaction ${e}`);const a=r;return{...Sc(this,bc,Ac).call(this,a,t,void 0,n),result:a}}async _estimateGas(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{result:r}=await this.$call(e,t,{...n,callStatic:!0});if(null==r)throw new R;const{gasUsed:a}=r;return Math.floor(1.25*a)}async $deploy(e,t){var n;const{callStatic:r,...a}={...this.$options,...t};if(null==this.$options.bytecode&&await this.$compile(),!0===r)return this.$call("init",e,{...a,callStatic:r});if(null!=this.$options.address)throw new te;if(null==a.onAccount)throw new x("Can't deploy without account");const i=a.onAccount.address;if(null==this.$options.bytecode)throw new x("Can't deploy without bytecode");const o=await oa({...a,tag:Vt.ContractCreateTx,gasLimit:null!==(n=a.gasLimit)&&void 0!==n?n:await this._estimateGas("init",e,a),callData:this._calldata.encode(this._name,"init",e),code:this.$options.bytecode,ownerId:i});this.$options.address=ua(o);const{hash:s,...c}=await Sc(this,xc,qc).call(this,o,"init",{...a,onAccount:a.onAccount});return{...c,...null!=c.result?.log&&{decodedEvents:this.$decodeEvents(c.result.log,a)},owner:i,transaction:s,address:this.$options.address}}async $call(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{callStatic:a,top:i,...o}={...this.$options,...r},s=Sc(this,Tc,Pc).call(this,e),c=this.$options.address,{onNode:u}=o;if(null==e)throw new oe;if("init"===e&&!0!==a)throw new re('"init" can be called only via dryRun');if("init"!==e&&null!=o.amount&&o.amount>0&&!s.payable)throw new ue(o.amount,e);let l;try{if(null==o.onAccount)throw new B("Use fallback account");l=o.onAccount.address}catch(e){if(!0!==a||!(e instanceof E&&"Account should be an address (ak-prefixed string), or instance of AccountBase, got undefined instead"===e.message||e instanceof Pe))throw e;l=Lr.pub}const d=this._calldata.encode(this._name,e,t);if(!0===a){if(null==o.nonce&&null!=i){const e="number"==typeof i?"height":"hash";o.nonce=(await Ss(l,{[e]:i,onNode:u})).nonce+1}const t={...o,onNode:u,callData:d};let n;if("init"===e){if(null==this.$options.bytecode)throw new x('Can\'t dry-run "init" without bytecode');n=await oa({...t,tag:Vt.ContractCreateTx,code:this.$options.bytecode,ownerId:l})}else{if(null==c)throw new ae("Can't dry-run contract without address");n=await oa({...t,tag:Vt.ContractCallTx,callerId:l,contractId:c})}const{callObj:r,...a}=await Es(n,l,{...o,top:i});if(null==r)throw new B(`callObj is not available for transaction ${n}`);const s=r;return{...a,...Sc(this,bc,Ac).call(this,s,e,n,o),tx:sa(n),result:s,rawTx:n,hash:ca(n),txData:void 0}}if(null!=i)throw new x("Can't handle `top` option in on-chain contract call");if(null==c)throw new ae("Can't call contract without address");const p=await oa({...o,tag:Vt.ContractCallTx,gasLimit:null!==(n=o.gasLimit)&&void 0!==n?n:await this._estimateGas(e,t,o),callerId:l,contractId:c,callData:d});if(null==o.onAccount)throw new x("Can't call contract on chain without account");return Sc(this,xc,qc).call(this,p,e,{...o,onAccount:o.onAccount})}$decodeEvents(e){let{omitUnknown:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.map((e=>{const r=e.topics.map((e=>BigInt(e)));let a;try{a=Sc(this,zc,Ec).call(this,e.address,r[0],n)}catch(e){if(null!=t&&t&&e instanceof le)return null;throw e}const i=this._calldata.decodeEvent(a,e.data,r),[o,s]=Object.entries(i)[0];return{name:o,args:s,contract:{name:a,address:e.address}}})).filter((e=>null!=e))}static async initialize(e){let{onCompiler:t,onNode:n,bytecode:r,aci:a,address:i,sourceCodePath:o,sourceCode:s,fileSystem:c,validateBytecode:u,...l}=e;if(null==a&&null!=t){let e;var d;null!=o&&(e=await t.compile(o)),null!=s&&(e=await t.compileBySourceCode(s,c)),null!=e&&(a=e.aci,null!==(d=r)&&void 0!==d||(r=e.bytecode))}if(null==a)throw new ie;if(null!=i&&(i=await Ms(i,"contract_pubkey",{resolveByNode:!0,onNode:n})),null==i&&null==s&&null==r)throw new ae("Can't create instance by ACI without address");if(null!=i&&null==(await ks(i,{onNode:n})).active)throw new ne(i);if(!0===u){if(null==i)throw new ae("Can't validate bytecode without contract address");const e=(await Is(i,{onNode:n})).bytecode;let a=!1;if(null!=r)a=r===e;else if(null!=s){if(null==t)throw new x("Can't validate bytecode without compiler");a=await t.validateBySourceCode(e,s,c)}if(!a)throw new ee(null!=s?"source code":"bytecode")}return new Ic({onCompiler:t,onNode:n,sourceCode:s,bytecode:r,aci:a,address:i,fileSystem:c,...l})}constructor(e){var t=this;let{aci:n,...r}=e;var a,i;vc(this,zc),vc(this,Tc),vc(this,xc),vc(this,bc),i={writable:!0,value:void 0},Cc(this,a=_c),a.set(this,i),this._aci=n;const o=n[n.length-1];if(null==o.contract)throw new x(`The last 'aci' item should have 'contract' key, got ${Object.keys(o)} keys instead`);On(this,_c,o.contract),this._name=Mn(this,_c).name,this._calldata=new Nc.Encoder(n),this.$options=r,Object.assign(this,Object.fromEntries(Mn(this,_c).functions.map((e=>{let{name:n,arguments:r,stateful:a}=e;const i="init"!==n&&!a;return[n,async function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];const s=a.length===r.length+1?a.pop():{};if("object"!=typeof s)throw new E(`Options should be an object: ${s}`);return"init"===n?t.$deploy(a,{callStatic:i,...s}):t.$call(n,a,{callStatic:i,...s})}]}))))}};var kc=Ic;function Oc(e,t,n){var r;let{interval:a,onNode:i,...o}=n;null!==(r=a)&&void 0!==r||(a=fs("microblock",o));const s=new Set,c=async()=>{var n;(null!==(n=(await i.getOracleQueriesByPubkey(e)).oracleQueries)&&void 0!==n?n:[]).filter((e=>{let{id:t}=e;return!s.has(t)})).forEach((e=>{s.add(e.id),t(e)}))};let u=!1;return(async()=>{for(;!u;)await c().catch(console.error),await Ve(a)})(),()=>{u=!0}}async function Mc(e,t,n){var r;let a,i,o,{interval:s,onNode:c,...u}=n;null!==(r=s)&&void 0!==r||(s=fs("microblock",u));do{({response:o,ttl:i}=await c.getOracleQueryByPubkeyAndQueryId(e,t));const n=dt(o);if(n.length>0)return n.toString();await Ve(s),a=await gs({onNode:c})}while(i>=a);throw new q(a)}async function Bc(e,t,n){const r=await n.onNode.getOracleQueryByPubkeyAndQueryId(e,t);return{...r,decodedQuery:dt(r.query).toString(),decodedResponse:dt(r.response).toString(),respond:async(e,r)=>Dc(t,e,{...n,...r}),pollForResponse:async r=>Mc(e,t,{...n,...r})}}async function Rc(e,t,n){var r;null!==(r=n.queryFee)&&void 0!==r||(n.queryFee=(await n.onNode.getOracleByPubkey(e)).queryFee.toString());const a=n.onAccount.address,i=await oa({queryTtlType:Vr.type,queryTtlValue:Vr.value,responseTtlType:Hr.type,responseTtlValue:Hr.value,...n,tag:Vt.OracleQueryTx,oracleId:e,senderId:a,query:t}),{nonce:o}=sa(i,Vt.OracleQueryTx),s=sn(a,o,e);return{...await Cs(i,n),...await Bc(e,s,n)}}async function jc(e){const t=pt(dt(e.onAccount.address),Xe.OracleAddress),n=await oa({oracleTtlType:Ur.type,oracleTtlValue:Ur.value,...e,tag:Vt.OracleExtendTx,oracleId:t});return{...await Cs(n,e),...await Fc(t,e)}}async function Dc(e,t,n){const r=pt(dt(n.onAccount.address),Xe.OracleAddress),a=await oa({responseTtlType:Hr.type,responseTtlValue:Hr.value,...n,tag:Vt.OracleResponseTx,oracleId:r,queryId:e,response:t});return{...await Cs(a,n),...await Fc(r,n)}}async function Fc(e,t){return{...await t.onNode.getOracleByPubkey(e),queries:(await t.onNode.getOracleQueriesByPubkey(e)).oracleQueries,...He({pollQueries:Oc,postQuery:Rc,respondToQuery:Dc,extendOracle:jc,getQuery:Bc},(n=>{let[r,a]=n;return[r,function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];const s=i[i.length-1];return null!=s&&"object"==typeof s&&s.constructor===Object?Object.assign(s,{...t,...s}):i.push(t),a(...["extendOracle","respondToQuery"].includes(r)?[]:[e],...i)}]}))}}async function $c(e,t,n){const r=n.onAccount.address,a=await oa({oracleTtlValue:Ur.value,oracleTtlType:Ur.type,...n,tag:Vt.OracleRegisterTx,accountId:r,queryFormat:e,responseFormat:t});return{...await Cs(a,n),...await Fc(pt(dt(r),Xe.OracleAddress),n)}}async function Uc(e,t,n){return Cs(await oa({...n,tag:Vt.SpendTx,senderId:n.onAccount.address,recipientId:await Ms(t,"account_pubkey",n),amount:e}),n)}async function Vc(e,t,n){if(e<0||e>1)throw new b("fraction","a number between 0 and 1",e);const r=await Ms(t,"account_pubkey",n),a=n.onAccount.address,i=new(c())(await bs.bind(n.onAccount)(a,n)),o=i.times(e).integerValue(c().ROUND_HALF_UP),{fee:s}=sa(await oa({...n,tag:Vt.SpendTx,senderId:a,recipientId:r,amount:o}),Vt.SpendTx),u=o.plus(s).gt(i)?i.minus(s):o;return Cs(await oa({...n,tag:Vt.SpendTx,senderId:a,recipientId:r,amount:u}),n)}async function Hc(e,t){return Cs(await oa({...t,tag:Vt.PayingForTx,payerId:t.onAccount.address,tx:e}),t)}var Lc=N(9408).Buffer;async function Gc(e,t,n){var r;let{onAccount:a,onCompiler:i,onNode:o,bytecode:s,aci:c,sourceCodePath:u,sourceCode:l,fileSystem:d,...p}=n;const m=a.address;if("generalized"===(await Ss(m,{onNode:o})).kind)throw new x(`Account ${m} is already GA`);const h=await kc.initialize({onAccount:a,onCompiler:i,onNode:o,bytecode:s,aci:c,sourceCodePath:u,sourceCode:l,fileSystem:d}),f=await oa({...p,tag:Vt.GaAttachTx,onNode:o,code:await h.$compile(),gasLimit:null!==(r=p.gasLimit)&&void 0!==r?r:await h._estimateGas("init",t,p),ownerId:m,callData:h._calldata.encode(h._name,"init",t),authFun:wt(e)}),y=ua(f),{hash:g,rawTx:w}=await Cs(f,{onNode:o,onAccount:a,onCompiler:i,...p});return Object.freeze({owner:m,transaction:g,rawTx:w,gaContractId:y})}async function Wc(e,t){let{fee:n,gasPrice:r,onNode:a}=t;const{nodeNetworkId:i,consensusProtocolVersion:o}=await a.getNodeInfo();let s=wt(Le([Lc.from(i),dt(e)]));if(o===Ft.Ceres){if(null==n)throw new b("fee","provided (in Ceres)",n);if(null==r)throw new b("gasPrice","provided (in Ceres)",r);s=wt(dt(ia({tag:Vt.GaMetaTxAuthData,fee:n,gasPrice:r,txHash:pt(s,Xe.TxHash)})))}return s}async function Kc(e,t){let{onNode:n}=t;const r=sa(e,Vt.SignedTx);if(r.encodedTx.tag!==Vt.GaMetaTx)throw new b("transaction","to include GaMetaTx",Vt[r.encodedTx.tag]);return Wc(ia(r.encodedTx.tx.encodedTx),{fee:r.encodedTx.fee,gasPrice:r.encodedTx.gasPrice,onNode:n})}var Qc=N(7445),Jc=N(2472),Yc=N(8994);function Xc(e){return Xc="function"==typeof Jc&&"symbol"==typeof Yc?function(e){return typeof e}:function(e){return e&&"function"==typeof Jc&&e.constructor===Jc&&e!==Jc.prototype?"symbol":typeof e},Xc(e)}var Zc=N(24);function eu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Xc(e)||null===e)return e;var n=e[Zc];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Xc(t)?t:String(t)}(t))in e?Qc(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tu=N(9408).Buffer;function nu(e){return new Proxy({},{...Object.fromEntries(["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"].map((e=>[e,()=>{throw new O(`${e} proxy request`)}]))),get(t,n,r){const a=e(),i=Reflect.get(a,n,r);return"function"==typeof i?i.bind(a):i},has(t,n){return Reflect.has(e(),n)}})}const{InvalidTxError:ru,...au}=t,iu={...au,...n,...a,...r,createDelegationSignature:async function(e,t,n){return n.onAccount.sign(Le([tu.from(await n.onNode.getNetworkId()),...!0===n.omitAddress?[]:[dt(n.onAccount.address)],...t.map((e=>pn(e)?cn(e):e)).map((e=>dt(e))),dt(e)]),n)},...i};class ou{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eu(this,"_options",{}),Object.assign(this._options,e)}_resolveAccount(e){if("string"==typeof e)throw new O("Address in AccountResolver");if("object"==typeof e)return e;throw new E(`Account should be an address (ak-prefixed string), or instance of AccountBase, got ${String(e)} instead`)}_getOptions(){return{...this._options,onAccount:nu((()=>this._resolveAccount()))}}async buildTx(e){return oa({...this._getOptions(),...e})}async initializeContract(e){const{onNode:t,onCompiler:n,...r}=this._getOptions();if(null==n||null==t)throw new b("onCompiler, onNode","provided",null);return kc.initialize({...r,onNode:t,onCompiler:n,...e})}}Object.assign(ou.prototype,He(iu,(e=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length=n.length;const a=t[t.length-1];return t[t.length-1]={...this._getOptions(),...a,...null!=a?.onAccount&&{onAccount:this._resolveAccount(a.onAccount)}},n(...t)}]})));var su=ou;class cu extends su{constructor(){let{nodes:e=[],...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),eu(this,"pool",new Map),e.forEach(((e,t)=>{let{name:n,instance:r}=e;return this.addNode(n,r,0===t)}))}get compilerApi(){if(null==this._options.onCompiler)throw new f("You can't use Compiler API. Compiler is not ready!");return this._options.onCompiler}get api(){return this.ensureNodeConnected(),this.pool.get(this.selectedNodeName)}addNode(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.pool.has(e))throw new we(e);this.pool.set(e,t),(n||null==this.selectedNodeName)&&this.selectNode(e)}selectNode(e){if(!this.pool.has(e))throw new Ne(`Node with name ${e} not in pool`);this.selectedNodeName=e}isNodeConnected(){return null!=this.selectedNodeName}ensureNodeConnected(){if(!this.isNodeConnected())throw new Ne("You can't use Node API. Node is not connected or not defined!")}async getNodeInfo(){return this.ensureNodeConnected(),{name:this.selectedNodeName,...await this.api.getNodeInfo()}}async getNodesInPool(){return Promise.all(Array.from(this.pool.entries()).map((async e=>{let[t,n]=e;return{name:t,...await n.getNodeInfo()}})))}addresses(){return[]}get address(){return this._resolveAccount().address}async sign(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).sign(e,n)}async signTransaction(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null!==this.selectedNodeName?await this.api.getNetworkId():void 0;return this._resolveAccount(t).signTransaction(e,{networkId:r,...n})}async signMessage(e){let{onAccount:t,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).signMessage(e,n)}_getOptions(){return{...super._getOptions(),onNode:nu((()=>this.api)),onCompiler:nu((()=>this.compilerApi))}}}class uu extends cu{constructor(){let{accounts:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),eu(this,"accounts",{}),e?.forEach(((e,t)=>this.addAccount(e,{select:0===t})))}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedAddress;if("string"==typeof e){const t=e;if(dt(t),null==this.accounts[t])throw new j(e);e=this.accounts[t]}return super._resolveAccount(e)}addresses(){return Object.keys(this.accounts)}addAccount(e){let{select:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{address:n}=e;this.accounts[n]=e,!0===t&&this.selectAccount(n)}removeAccount(e){if(null==this.accounts[e])throw new j(e);delete this.accounts[e],this.selectedAddress===e&&delete this.selectedAddress}selectAccount(e){if(dt(e),null==this.accounts[e])throw new j(e);this.selectedAddress=e}}let lu,du,pu,mu,hu;!function(e){e.to_waellet="to_waellet",e.to_aepp="to_aepp"}(lu||(lu={})),function(e){e.window="window",e.extension="extension"}(du||(du={})),function(e){e.subscribe="subscribe",e.unsubscribe="unsubscribe"}(pu||(pu={})),function(e){e.readyToConnect="connection.announcePresence",e.updateAddress="address.update",e.address="address.get",e.connect="connection.open",e.sign="transaction.sign",e.signMessage="message.sign",e.subscribeAddress="address.subscribe",e.updateNetwork="networkId.update",e.closeConnection="connection.close"}(mu||(mu={})),function(e){e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.WAITING_FOR_CONNECTION_REQUEST="WAITING_FOR_CONNECTION_REQUEST"}(hu||(hu={}));const fu=[];class yu extends l{toJSON(){return{code:this.code,message:this.message,data:this.data}}static deserialize(e){const t=fu.find((t=>t.code===e.code));if(null==t)throw new B(`Can't find RpcError with code: ${e.code}`);return new t(e.data)}}class gu extends yu{constructor(e){super("Invalid transaction"),eu(this,"code",2),this.data=e,this.name="RpcInvalidTransactionError"}}eu(gu,"code",2),fu.push(gu);class wu extends yu{constructor(e){super("Broadcast failed"),eu(this,"code",3),this.data=e,this.name="RpcBroadcastError"}}eu(wu,"code",3),fu.push(wu);class Nu extends yu{constructor(e){super("Operation rejected by user"),eu(this,"code",4),this.data=e,this.name="RpcRejectedByUserError"}}eu(Nu,"code",4),fu.push(Nu);class vu extends yu{constructor(){super("Unsupported Protocol Version"),eu(this,"code",5),this.name="RpcUnsupportedProtocolError"}}eu(vu,"code",5),fu.push(vu);class Cu extends yu{constructor(e){super("Wallet deny your connection request"),eu(this,"code",9),this.data=e,this.name="RpcConnectionDenyError"}}eu(Cu,"code",9),fu.push(Cu);class Su extends yu{constructor(){super("You are not connected to the wallet"),eu(this,"code",10),this.name="RpcNotAuthorizeError"}}eu(Su,"code",10),fu.push(Su);class bu extends yu{constructor(e){super(`You are not subscribed for account ${e}`),eu(this,"code",11),this.data=e,this.name="RpcPermissionDenyError"}}eu(bu,"code",11),fu.push(bu);class xu extends yu{constructor(){super("The peer failed to execute your request due to unknown error"),eu(this,"code",12),this.name="RpcInternalError"}}eu(xu,"code",12),fu.push(xu);class Tu extends yu{constructor(){super("Method not found"),eu(this,"code",-32601),this.name="RpcMethodNotFoundError"}}eu(Tu,"code",-32601),fu.push(Tu);var zu=N(9408).Buffer;class _u extends rs{constructor(e,t){super(),this._rpcClient=e,this.address=t}async sign(){throw new O("RAW signing using wallet")}async signTransaction(e){let{innerTx:t,networkId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new O("innerTx option in AccountRpc");if(null==n)throw new b("networkId","provided",n);const r=await this._rpcClient.request(mu.sign,{onAccount:this.address,tx:e,returnSigned:!0,networkId:n});if(null==r.signedTransaction)throw new k("signedTransaction is missed in wallet response");return r.signedTransaction}async signMessage(e){const{signature:t}=await this._rpcClient.request(mu.signMessage,{onAccount:this.address,message:e});return zu.from(t,"hex")}}function Au(e,t){Pu(e,t),t.add(e)}function qu(e,t,n){Pu(e,t),t.set(e,n)}function Pu(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Eu(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Iu=new WeakMap,ku=new WeakMap,Ou=new WeakMap,Mu=new WeakSet,Bu=new WeakSet,Ru=new WeakSet,ju=new WeakSet;class Du{constructor(e,t,n){Au(this,ju),Au(this,Ru),Au(this,Bu),Au(this,Mu),qu(this,Iu,{writable:!0,value:new Map}),qu(this,ku,{writable:!0,value:0}),qu(this,Ou,{writable:!0,value:void 0}),this.connection=e,On(this,Ou,n),e.connect(Eu(this,Mu,Fu).bind(this),t)}async request(e,t){return Eu(this,Bu,$u).call(this,On(this,ku,Mn(this,ku)+1),e,t),new Promise(((e,t)=>{Mn(this,Iu).set(Mn(this,ku),{resolve:e,reject:t})}))}notify(e,t){Eu(this,Bu,$u).call(this,void 0,e,t)}}async function Fu(e,t){if("2.0"!==e?.jsonrpc)throw new U(JSON.stringify(e));if("result"in e||"error"in e)return void Eu(this,ju,Vu).call(this,e);const n=e;let r,a;try{if(!(n.method in Mn(this,Ou)))throw new Tu;const e=n.method;r=await Mn(this,Ou)[e](n.params,t)}catch(e){a=e instanceof yu?e:new xu}null!=n.id&&Eu(this,Ru,Uu).call(this,n.id,n.method,r,a)}function $u(e,t,n){this.connection.sendMessage({jsonrpc:"2.0",...null!=e?{id:e}:{},method:t,...null!=n?{params:n}:{}})}function Uu(e,t,n,r){this.connection.sendMessage({jsonrpc:"2.0",id:e,method:t,...null!=r?{error:r.toJSON()}:{result:n}})}function Vu(e){let{id:t,error:n,result:r}=e;const a=Mn(this,Iu).get(t);if(null==a)throw new V(t);null!=n?a.reject(yu.deserialize(n)):a.resolve(r),Mn(this,Iu).delete(t)}class Hu extends cu{constructor(e){let{name:t,onAddressChange:n=(()=>{}),onDisconnect:r=(()=>{}),onNetworkChange:a=(()=>{}),...i}=e;super(i),this.onAddressChange=n,this.onDisconnect=r,this.onNetworkChange=a,this.name=t}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.addresses()[0];if("string"==typeof e){const t=e;if(dt(t),!this.addresses().includes(t))throw new H(t);this._ensureConnected(),e=new _u(this.rpcClient,t)}return null==e&&this._ensureAccountAccess(),super._resolveAccount(e)}addresses(){if(null==this._accounts)return[];const e=Object.keys(this._accounts.current)[0];return[...null!=e?[e]:[],...Object.keys(this._accounts.connected)]}async connectToWallet(e){let t,{connectNode:n=!1,name:r="wallet-node",select:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=this.rpcClient)throw new qe("You are already connected to wallet");const i=new Du(e,(()=>{delete this.rpcClient,delete this._accounts,this.onDisconnect(t)}),{[mu.updateAddress]:e=>{this._accounts=e,this.onAddressChange(e)},[mu.updateNetwork]:e=>{const{node:t}=e;null!=t&&this.addNode(t.name,new ts(t.url),!0),this.onNetworkChange(e)},[mu.closeConnection]:e=>{t=e,i.connection.disconnect()},[mu.readyToConnect]:()=>{}}),{node:o,...s}=await i.request(mu.connect,{name:this.name,version:1,connectNode:n});if(n){if(null==o)throw new Ee("Missing URLs of the Node");this.addNode(r,new ts(o.url),a)}return this.rpcClient=i,s}disconnectWallet(){this._ensureConnected(),this.rpcClient.notify(mu.closeConnection,{reason:"bye"}),this.rpcClient.connection.disconnect()}async askAddresses(){return this._ensureAccountAccess(),this.rpcClient.request(mu.address,void 0)}async subscribeAddress(e,t){this._ensureConnected();const n=await this.rpcClient.request(mu.subscribeAddress,{type:e,value:t});return this._accounts=n.address,n}_ensureConnected(){if(null==this.rpcClient)throw new Pe("You are not connected to Wallet")}_ensureAccountAccess(){if(this._ensureConnected(),0===this.addresses().length)throw new G}}var Lu=N(2716);const Gu=N.n(Lu)()({storeAsString:!0}),Wu=e=>{if("object"==typeof e&&null!==e&&e.constructor===Object)return He(e,(e=>{let[t,n]=e;return[t,Wu(n)]}));if(Array.isArray(e))return e.map((e=>Wu(e)));if("string"==typeof e&&new(c())(e).toString(10)===e){const t=new(c())(e);return t.toJSON=()=>t.toString(10),t}return e};var Ku={stringify:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gu.stringify(Wu(t[0]),...t.slice(1))},parse:Gu.parse},Qu=N(9408).Buffer;class Ju extends uu{constructor(e){let{name:t,id:n,type:r,onConnection:a,onSubscription:i,onDisconnect:o,onAskAccounts:s,...c}=e;super(c),eu(this,"_clients",new Map),this.onConnection=a,this.onSubscription=i,this.onDisconnect=o,this.onAskAccounts=s,this.name=t,this.id=n,this._type=r}_pushAccountsToApps(){null!=this._clients&&Array.from(this._clients.keys()).filter((e=>this._isRpcClientSubscribed(e))).map((e=>this._getClient(e).rpc)).forEach((e=>e.notify(mu.updateAddress,this.getAccounts())))}selectAccount(e){super.selectAccount(e),this._pushAccountsToApps()}addAccount(e,t){super.addAccount(e,t),this._pushAccountsToApps()}_getNode(){return this.ensureNodeConnected(),{node:{url:this.api.$host,name:this.selectedNodeName}}}async selectNode(e){super.selectNode(e);const t=await this.api.getNetworkId();Array.from(this._clients.keys()).filter((e=>this._isRpcClientConnected(e))).map((e=>this._getClient(e))).forEach((e=>{e.rpc.notify(mu.updateNetwork,{networkId:t,...e.connectNode&&this._getNode()})}))}_getClient(e){const t=this._clients.get(e);if(null==t)throw new L(e);return t}_isRpcClientSubscribed(e){return this._isRpcClientConnected(e)&&0!==this._getClient(e).addressSubscription.size}_isRpcClientConnected(e){return hu.CONNECTED===this._getClient(e).status&&this._getClient(e).rpc.connection.isConnected()}_disconnectRpcClient(e){const t=this._getClient(e);t.rpc.connection.disconnect(),t.status=hu.DISCONNECTED,t.addressSubscription=new Set}removeRpcClient(e){this._disconnectRpcClient(e),this._clients.delete(e)}addRpcClient(e){const t=(0,Bs.v4)();let n;const r={id:t,status:hu.WAITING_FOR_CONNECTION_REQUEST,addressSubscription:new Set,connectNode:!1,rpc:new Du(e,(()=>{this._clients.delete(t),this.onDisconnect(t,n)}),{[mu.closeConnection]:e=>{n=e,this._disconnectRpcClient(t)},[mu.connect]:async(e,n)=>{let{name:a,version:i,icons:o,connectNode:s}=e;if(1!==i)throw new vu;return await this.onConnection(t,{name:a,icons:o,connectNode:s},n),r.status=hu.CONNECTED,r.connectNode=s,{...await this.getWalletInfo(),...s&&this._getNode()}},[mu.subscribeAddress]:async(e,n)=>{let{type:a,value:i}=e;if(!this._isRpcClientConnected(t))throw new Su;switch(await this.onSubscription(t,{type:a,value:i},n),a){case pu.subscribe:r.addressSubscription.add(i);break;case pu.unsubscribe:r.addressSubscription.delete(i);break;default:throw new B(`Unknown subscription type: ${a}`)}return{subscription:Array.from(r.addressSubscription),address:this.getAccounts()}},[mu.address]:async(e,n)=>{if(!this._isRpcClientSubscribed(t))throw new Su;return await this.onAskAccounts(t,e,n),this.addresses()},[mu.sign]:async(e,n)=>{let{tx:r,onAccount:a=this.address,returnSigned:i}=e;if(!this._isRpcClientConnected(t))throw new Su;if(!this.addresses().includes(a))throw new bu(a);const o={onAccount:a,aeppOrigin:n,aeppRpcClientId:t};if(i)return{signedTransaction:await this.signTransaction(r,o)};try{return Ku.parse(Ku.stringify({transactionHash:await this.sendTransaction(r,{...o,verify:!1})}))}catch(e){const t=await hs(r,this.api);if(t.length>0)throw new gu(t);throw new wu(e.message)}},[mu.signMessage]:async(e,n)=>{let{message:r,onAccount:a=this.address}=e;if(!this._isRpcClientConnected(t))throw new Su;if(!this.addresses().includes(a))throw new bu(a);const i={onAccount:a,aeppOrigin:n,aeppRpcClientId:t};return{signature:Qu.from(await this.signMessage(r,i)).toString("hex")}}})};return this._clients.set(t,r),t}async shareWalletInfo(e){this._getClient(e).rpc.notify(mu.readyToConnect,await this.getWalletInfo())}async getWalletInfo(){return{id:this.id,name:this.name,networkId:await this.api.getNetworkId(),origin:window.location.origin,type:this._type}}getAccounts(){return{current:null!=this.selectedAddress?{[this.selectedAddress]:{}}:{},connected:this.addresses().filter((e=>e!==this.selectedAddress)).reduce(((e,t)=>({...e,[t]:{}})),{})}}}var Yu=new WeakMap;class Xu extends rs{constructor(e){var t,n,r;super(),r={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t=this,n=Yu),n.set(t,r),dt(e),this.address=e}async sign(){throw new O("Can't sign using generalized account")}async signMessage(){throw new O("Can't sign using generalized account")}async signTransaction(e,t){let{authData:n,onCompiler:r,onNode:a}=t;if(null==n||null==r||null==a)throw new b("authData, onCompiler, onNode","provided",null);const{callData:i,sourceCode:o,args:s,fee:c,gasLimit:u,gasPrice:l}="function"==typeof n?await n(e):n,d=null!=i?i:await(async()=>{if(null==Mn(this,Yu)){const e=await Ss(this.address,{onNode:a});if("generalized"!==e.kind)throw new b("account kind","generalized",e.kind);On(this,Yu,e.authFun)}if(null==Mn(this,Yu))throw new B("Account in generalised, but authFun not provided");if(null==o||null==s)throw new Z("Auth data must contain source code and arguments.");const e=await kc.initialize({onCompiler:r,onNode:a,sourceCode:o});return e._calldata.encode(e._name,Mn(this,Yu),s)})(),p=await oa({tag:Vt.GaMetaTx,tx:{tag:Vt.SignedTx,encodedTx:dt(e),signatures:[]},gaId:this.address,authData:d,fee:c,gasLimit:u,gasPrice:l,onNode:a});return ia({tag:Vt.SignedTx,encodedTx:dt(p),signatures:[]})}}var Zu=N(9408).Buffer;const el=224;class tl extends rs{constructor(e,t,n){super(),this.transport=e,this.index=t,this.address=n,e.decorateAppAPIMethods(this,["signTransaction","signMessage"],"w0w")}async sign(){throw new O("RAW signing using Ledger HW")}async signTransaction(e){let{innerTx:t,networkId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new O("innerTx option in AccountLedger");if(null==n)throw new b("networkId","provided",n);const r=dt(e);let a=0;const i=Zu.from(n),o=[];for(;a!==r.length;){const e=0===a?141-i.length:150,t=a+e>r.length?r.length-a:e,n=Zu.alloc(0===a?9+i.length+t:t);if(0===a){let e=n.writeUInt32BE(this.index,0);e=n.writeUInt32BE(r.length,e),e=n.writeUInt8(i.length,e),e+=i.copy(n,e,0,i.length),r.copy(n,e,0,150-e)}else r.copy(n,0,a,a+t);o.push(n),a+=t}const s=[(await o.reduce((async(e,t,n)=>(await e,this.transport.send(el,4,0===n?0:128,0,t))),Promise.resolve(Zu.alloc(0)))).subarray(0,64)];return ia({tag:Vt.SignedTx,encodedTx:r,signatures:s})}async signMessage(e){let t=0;const n=Zu.from(e),r=[];for(;t!==n.length;){const e=0===t?142:150,a=t+e>n.length?n.length-t:e,i=Zu.alloc(0===t?8+a:a);0===t?(i.writeUInt32BE(this.index,0),i.writeUInt32BE(n.length,4),n.copy(i,8,t,t+a)):n.copy(i,0,t,t+a),r.push(i),t+=a}return(await r.reduce((async(e,t,n)=>(await e,this.transport.send(el,8,0===n?0:128,0,t))),Promise.resolve(Zu.alloc(0)))).subarray(0,64)}}var nl=N(9408).Buffer;class rl{constructor(e){this.transport=e,this.versionCheckPromise=this.getAppConfiguration().then((e=>{let{version:t}=e;const n=[t,"0.4.4","0.5.0"];if(!la(...n))throw new M("app on ledger",...n)})),e.decorateAppAPIMethods(this,["getAddress","getAppConfiguration"],"w0w")}async getAppConfiguration(){await this.versionCheckPromise;const e=await this.transport.send(el,6,0,0);return{version:[e[1],e[2],e[3]].join(".")}}async getAddress(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];await this.versionCheckPromise;const n=nl.alloc(4);n.writeUInt32BE(e,0);const r=await this.transport.send(el,2,t?1:0,0,n),a=r[0];return r.subarray(1,1+a).toString("ascii")}async initialize(e){return await this.versionCheckPromise,new tl(this.transport,e,await this.getAddress(e))}async discover(e){let t=0;const n=[];let r;do{null!=r&&n.push(r),r=await this.initialize(t),t+=1}while(await e.getAccountByPubkey(r.address).then((()=>!0),(()=>!1)));return n}}class al{}const il={type:{name:"Composite",className:"Contract",modelProperties:{code:{serializedName:"code",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},ol={type:{name:"Composite",className:"CompileOpts",modelProperties:{fileSystem:{serializedName:"file_system",type:{name:"Dictionary",value:{type:{name:"any"}}}},srcFile:{serializedName:"src_file",type:{name:"String"}}}}},sl={type:{name:"Composite",className:"Aci",modelProperties:{encodedAci:{serializedName:"encoded_aci",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}},externalEncodedAci:{serializedName:"external_encoded_aci",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}},interface:{serializedName:"interface",required:!0,type:{name:"String"}}}}},cl={type:{name:"Composite",className:"CompilerError",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},pos:{serializedName:"pos",type:{name:"Composite",className:"ErrorPos"}},message:{serializedName:"message",required:!0,type:{name:"String"}},context:{serializedName:"context",type:{name:"String"}}}}},ul={type:{name:"Composite",className:"ErrorPos",modelProperties:{file:{serializedName:"file",type:{name:"String"}},line:{serializedName:"line",required:!0,type:{name:"Number"}},col:{serializedName:"col",required:!0,type:{name:"Number"}}}}},ll={type:{name:"Composite",className:"CompileResult",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},aci:{serializedName:"aci",required:!0,type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},dl={type:{name:"Composite",className:"SophiaCallResultInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},pl={type:{name:"Composite",className:"BytecodeCallResultInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},ml={type:{name:"Composite",className:"DecodedCallresult",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},hl={type:{name:"Composite",className:"FunctionCallInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},fl={type:{name:"Composite",className:"Calldata",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}}}}},yl={type:{name:"Composite",className:"DecodeCalldataBytecode",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},gl={type:{name:"Composite",className:"DecodedCalldata",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},wl={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},Nl={type:{name:"Composite",className:"DecodeCalldataSource",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}}}}},vl={type:{name:"Composite",className:"ByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Cl={type:{name:"Composite",className:"FateAssembler",modelProperties:{fateAssembler:{serializedName:"fate-assembler",required:!0,type:{name:"String"}}}}},Sl={type:{name:"Composite",className:"ValidateByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},bl={type:{name:"Composite",className:"CompilerVersion",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}}}}},xl={type:{name:"Composite",className:"ApiVersion",modelProperties:{apiVersion:{serializedName:"api-version",required:!0,type:{name:"String"}}}}},Tl={type:{name:"Composite",className:"SophiaBinaryData",modelProperties:{sophiaType:{serializedName:"sophia-type",required:!0,type:{name:"String"}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},zl={type:{name:"Composite",className:"SophiaJsonData",modelProperties:{data:{serializedName:"data",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},_l={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},Al={parameterPath:"body",mapper:il},ql={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Pl={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},El={parameterPath:"body",mapper:dl},Il={parameterPath:"body",mapper:pl},kl={parameterPath:"body",mapper:hl},Ol={parameterPath:"body",mapper:yl},Ml={parameterPath:"body",mapper:Nl},Bl={parameterPath:"body",mapper:vl},Rl={parameterPath:"body",mapper:Sl};class jl extends ga.ServiceClient{constructor(e,t){var n,r;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-compiler/1.0.0-beta.1",i=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`;super({requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:i},endpoint:null!==(n=null!==(r=t.endpoint)&&void 0!==r?r:t.baseUri)&&void 0!==n?n:"{$host}"}),this.$host=e}generateACI(e,t){return this.sendOperationRequest({body:e,options:t},Fl)}compileContract(e,t){return this.sendOperationRequest({body:e,options:t},$l)}decodeCallResult(e,t){return this.sendOperationRequest({body:e,options:t},Ul)}decodeCallResultBytecode(e,t){return this.sendOperationRequest({body:e,options:t},Vl)}encodeCalldata(e,t){return this.sendOperationRequest({body:e,options:t},Hl)}decodeCalldataBytecode(e,t){return this.sendOperationRequest({body:e,options:t},Ll)}decodeCalldataSource(e,t){return this.sendOperationRequest({body:e,options:t},Gl)}getFateAssemblerCode(e,t){return this.sendOperationRequest({body:e,options:t},Wl)}validateByteCode(e,t){return this.sendOperationRequest({body:e,options:t},Kl)}getCompilerVersion(e,t){return this.sendOperationRequest({body:e,options:t},Ql)}version(e){return this.sendOperationRequest({options:e},Jl)}apiVersion(e){return this.sendOperationRequest({options:e},Yl)}api(e){return this.sendOperationRequest({options:e},Xl)}}const Dl=ga.createSerializer(o,!1),Fl={path:"/aci",httpMethod:"POST",responses:{200:{bodyMapper:sl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Al,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},$l={path:"/compile",httpMethod:"POST",responses:{200:{bodyMapper:ll},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Al,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Ul={path:"/decode-call-result",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"any"}}},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:El,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Vl={path:"/decode-call-result/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:ml},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Il,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Hl={path:"/encode-calldata",httpMethod:"POST",responses:{200:{bodyMapper:fl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:kl,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Ll={path:"/decode-calldata/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:gl},400:{bodyMapper:wl,isError:!0}},requestBody:Ol,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Gl={path:"/decode-calldata/source",httpMethod:"POST",responses:{200:{bodyMapper:gl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Ml,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Wl={path:"/fate-assembler",httpMethod:"POST",responses:{200:{bodyMapper:Cl},400:{bodyMapper:wl,isError:!0}},requestBody:Bl,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Kl={path:"/validate-byte-code",httpMethod:"POST",responses:{200:{},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Rl,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Ql={path:"/compiler-version",httpMethod:"POST",responses:{200:{bodyMapper:bl},400:{bodyMapper:wl,isError:!0}},requestBody:Bl,urlParameters:[Pl],headerParameters:[_l,ql],mediaType:"json",serializer:Dl},Jl={path:"/version",httpMethod:"GET",responses:{200:{bodyMapper:bl},500:{bodyMapper:wl,isError:!0}},urlParameters:[Pl],headerParameters:[ql],serializer:Dl},Yl={path:"/api-version",httpMethod:"GET",responses:{200:{bodyMapper:xl},500:{bodyMapper:wl,isError:!0}},urlParameters:[Pl],headerParameters:[ql],serializer:Dl},Xl={path:"/api",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Dictionary",value:{type:{name:"any"}}}}},400:{bodyMapper:wl,isError:!0}},urlParameters:[Pl],headerParameters:[ql],serializer:Dl};class Zl extends al{constructor(e){let{ignoreVersion:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.api=new jl(e,{allowInsecureConnection:!0,additionalPolicies:[ha((e=>{let t="";return"reason"in e&&(t+=` ${e.reason}${null!=e.parameter?` in ${e.parameter}`:""}${null!=e.info?` (${JSON.stringify(e.info)})`:""}`),Array.isArray(e)&&(t+=`\n${e.map((e=>`${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${null!=e.context?` (${e.context})`:""}`)).join("\n")}`),t}))]}),!0!==t){const e=this.api.apiVersion().then((e=>{let{apiVersion:t}=e;return t}),(e=>e));this.api.pipeline.addPolicy(fa("compiler","/api-version",e,"7.1.1","8.0.0"))}}async compileBySourceCode(e,t){try{return await this.api.compileContract({code:e,options:{fileSystem:t}})}catch(e){if(e instanceof $e.RestError&&400===e.statusCode)throw new f(e.message.replace(/^aci error:/,"compile error:"));throw e}}async compile(e){throw new O("File system access, use CompilerHttpNode instead")}async validateBySourceCode(e,t,n){try{return await this.api.validateByteCode({bytecode:e,source:t,options:{fileSystem:n}}),!0}catch{return!1}}async validate(e,t){throw new O("File system access, use CompilerHttpNode instead")}async version(){return(await this.api.version()).version}}function ed(e){return e.replace(/_./g,(e=>e[1].toUpperCase()))}var td=N(8079);const nd=1e4,rd=15e3;function ad(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const[a,...i]=n;e._eventEmitter.emit(a,...i)}function id(e,t){if(null==t)throw new X;e._fsm=t,null!=t?.handler?.enter&&t.handler.enter(e),ld(e)}function od(e,t){t!==e._status&&(e._status=t,ad(e,"statusChanged",t))}function sd(e,t){e._state=t,ad(e,"stateChanged",t)}function cd(e,t){e._options.debug&&console.log("Send message: ",t),e._websocket.send(Ku.stringify({jsonrpc:"2.0",...t}))}function ud(e,t){cd(e,{method:t,params:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}})}async function ld(e){if(e._isActionQueueLocked)return;const t=e._actionQueue;if(0===t.length)return;const n=t.findIndex((t=>t.guard(e,e._fsm)));if(-1===n)return;e._actionQueue=t.filter(((e,t)=>n!==t)),e._isActionQueueLocked=!0;const r=await t[n].action(e,e._fsm);e._isActionQueueLocked=!1,id(e,r)}async function dd(e,t){const{handler:n,state:r}=e._fsm,a=await Promise.resolve(n(e,t,r));if(id(e,a),"OffChainNewContract"===t?.params?.data?.updates?.[0]?.op&&"channelOpen"===a?.handler.name){const n=e.round();if(null==n)throw new R("Round is null");const r=t?.params?.data?.updates?.[0]?.owner;ad(e,"newContract",Nt(r,n+1))}}function pd(e){e._websocket.close(),clearTimeout(e._pingTimeoutId)}function md(e){clearTimeout(e._pingTimeoutId),e._pingTimeoutId=setTimeout((()=>{ud(e,"channels.system",{action:"ping"}),e._pingTimeoutId=setTimeout((()=>{pd(e),ad(e,"error",new Q)}),rd)}),nd)}async function hd(e,t,n){return new Promise(((r,a)=>{const i=e._nextRpcMessageId;e._nextRpcMessageId+=1,e._rpcCallbacks.set(i,(e=>{if(null!=e.error){var t;const n=null!==(t=e.error.data[0].message)&&void 0!==t?t:"";a(new W(e.error.message+n))}else r(e.result)})),cd(e,{method:t,id:i,params:n})}))}async function fd(e,t,n,r){var a;let i;if(null!=n.tx)i=await r(n.tx);else{if(null==n.signed_tx)throw new h("Can't find transaction in message");i=await async function(e,t){const{signatures:n,encodedTx:r}=sa(e,Vt.SignedTx),a=ia(r),i=await t(a);if("string"==typeof i){const{signatures:e}=sa(i,Vt.SignedTx);return ia({tag:Vt.SignedTx,signatures:n.concat(e),encodedTx:dt(a)})}return i}(n.signed_tx,r)}const o="string"!=typeof i,s=null!=n.tx?"tx":"signed_tx";return ud(e,t,o?{error:null!==(a=i)&&void 0!==a?a:1}:{[s]:i}),o}function yd(e,t,n){return n?.reject?.(Object.assign(new J(`Unexpected message received:\n\n${JSON.stringify(t)}`),{wsMessage:t})),{handler:bd}}function gd(e,t,n,r){if(null!=r&&"channels.update"===t.method)return r(e,t,n);if("channels.conflict"===t.method)return n.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:bd};if("channels.info"===t.method&&"aborted_update"===t.params.data.event)return n.resolve({accepted:!1}),{handler:bd};if(null!=t.error){const e=t.error.data.map((e=>e.code));return e.includes(1001)?n.reject(new z("Insufficient balance")):e.includes(1002)?n.reject(new x("Amount cannot be negative")):n.reject(new K(t.error.message)),{handler:bd}}return yd(0,t,n)}function wd(e,t){if("channels.info"===t.method){const n=t.params.data.event;let r=null;return"channel_accept"===n&&(r="accepted"),"funding_created"===n&&(r="halfSigned"),null!=r?(od(e,r),{handler:vd}):"channel_reestablished"===t.params.data.event?{handler:Sd}:"fsm_up"===t.params.data.event?(e._fsmId=t.params.data.fsm_id,{handler:wd}):{handler:wd}}if("channels.error"===t.method)return ad(e,"error",new K(t?.payload?.message)),{handler:_d}}async function Nd(e,t,n){if("channels.info"===t.method&&"fsm_up"===t.params.data.event){e._fsmId=t.params.data.fsm_id;const{signedTx:n}=await e.state();return sd(e,null==n?"":ia(n)),{handler:bd}}return yd(0,t,n)}async function vd(e,t){const n="initiator"===e._options.role?"initiator_sign":"responder_sign";if(t.method===`channels.sign.${n}`)return await fd(e,`channels.${n}`,t.params.data,(async t=>e._options.sign(n,t))),{handler:Cd}}function Cd(e,t){if("channels.on_chain_tx"===t.method){const{info:n}=t.params.data,{role:r}=e._options;if("funding_signed"===n&&"initiator"===r||"funding_created"===n&&"responder"===r)return{handler:function t(n,r){if("channels.info"===r.method)switch(r.params.data.event){case"funding_created":case"own_funding_locked":return{handler:t};case"funding_locked":return{handler:Sd}}if("channels.on_chain_tx"===r.method)return ad(e,"onChainTx",r.params.data.tx,{info:r.params.data.info,type:r.params.data.type}),{handler:t}}}}if("channels.info"===t.method&&"funding_signed"===t.params.data.event&&"initiator"===e._options.role)return e._channelId=t.params.channel_id,od(e,"signed"),{handler:Cd}}function Sd(e,t){if("channels.info"===t.method&&"open"===t.params.data.event)return e._channelId=t.params.channel_id,{handler(t,n){if("channels.update"===n.method)return sd(e,n.params.data.state),{handler:bd}}}}async function bd(e,t,n){switch(t.method){case"channels.info":switch(t.params.data.event){case"update":case"withdraw_created":case"deposit_created":return{handler:xd};case"own_withdraw_locked":case"withdraw_locked":case"own_deposit_locked":case"deposit_locked":case"peer_disconnected":case"channel_reestablished":case"open":return ad(e,ed(t.params.data.event)),{handler:bd};case"fsm_up":return e._fsmId=t.params.data.fsm_id,{handler:bd};case"timeout":case"close_mutual":case"shutdown":return{handler:bd};case"closing":return od(e,"closing"),{handler:bd};case"closed_confirmed":return od(e,"closed"),{handler:_d};case"died":return od(e,"died"),{handler:_d}}break;case"channels.on_chain_tx":return ad(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),{handler:bd};case"channels.leave":return{handler:bd};case"channels.update":return sd(e,t.params.data.state),{handler:bd};case"channels.sign.shutdown_sign_ack":return xd(e,t,n)}}async function xd(e,t,n){var r;const[,a]=null!==(r=t.method.match(/^channels\.sign\.([^.]+)$/))&&void 0!==r?r:[];return null==a?yd(0,t,n):await fd(e,`channels.${a}`,t.params.data,(async n=>e._options.sign(a,n,{updates:t.params.data.updates})))?{handler:function e(t,r){return null!=r.error?{handler:e,state:n}:"channels.conflict"===r.method?{handler:bd}:yd(0,r,n)},state:n}:{handler:bd}}async function Td(e,t,n){return"channels.sign.shutdown_sign"!==t.method?yd(0,t,n):(await fd(e,"channels.shutdown_sign",t.params.data,(async e=>n.sign(e))),{handler(e,t){return"channels.on_chain_tx"!==t.method?yd(0,t,n):{handler:_d,state:n}},state:n})}function zd(e,t,n){return"channels.leave"===t.method?(n.resolve({channelId:t.params.channel_id,signedTx:t.params.data.state}),pd(e),{handler:_d}):"channels.error"===t.method?(n.reject(new K(t.data.message)),{handler:bd}):yd(0,t,n)}function _d(e,t,n){return null==n?{handler:_d}:"closing"===t.params.data.event?{handler:_d,state:n}:"channel_closed"===t.params.data.info?(n.closeTx=t.params.data.tx,{handler:_d,state:n}):"closed_confirmed"===t.params.data.event?(n.resolve(n.closeTx),{handler:_d}):{handler:_d,state:n}}bd.enter=e=>{od(e,"open")};var Ad=N(3735);class qd{constructor(){eu(this,"_eventEmitter",new Ad.EventEmitter),eu(this,"_nextRpcMessageId",0),eu(this,"_rpcCallbacks",new Map),eu(this,"_messageQueue",[]),eu(this,"_isMessageQueueLocked",!1),eu(this,"_actionQueue",[]),eu(this,"_isActionQueueLocked",!1),eu(this,"_status","disconnected"),eu(this,"_state","")}static async initialize(e){return qd._initialize(new qd,e)}static async _initialize(e,t){return await async function(e,t,n,r){let{url:a,...i}=r;e._options={url:a,...i},e._fsm={handler:t};const o=new URL(a);Object.entries(i).filter((e=>{let[t]=e;return!["sign","debug"].includes(t)})).forEach((e=>{let[t,n]=e;return o.searchParams.set(t.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),n.toString())})),o.searchParams.set("protocol","json-rpc"),od(e,"connecting"),e._websocket=new td.w3cwebsocket(o.toString()),await new Promise(((t,r)=>{Object.assign(e._websocket,{onerror:r,onopen:async()=>{if(t(),od(e,"connected"),null!=i.reconnectTx){id(e,{handler:n});const{signedTx:t}=await e.state();if(null==t)throw new h("`signedTx` missed in state while reconnection");sd(e,ia(t))}md(e)},onclose:()=>{od(e,"disconnected"),clearTimeout(e._pingTimeoutId)},onmessage:t=>{let{data:n}=t;return function(e,t){const n=Ku.parse(t);if(e._options.debug&&console.log("Receive message: ",n),null==n.id)"channels.message"!==n.method?"channels.system.pong"!==n.method?(e._messageQueue.push(n),async function(e){if(!e._isMessageQueueLocked){for(e._isMessageQueueLocked=!0;e._messageQueue.length>0;){const t=e._messageQueue.shift();if(null==t)throw new R;try{await dd(e,t)}catch(n){ad(e,"error",new Y(n,t))}}e._isMessageQueueLocked=!1}}(e)):n.params.channel_id!==e._channelId&&null!=e._channelId||md(e):ad(e,"message",n.params.data.message);else{const t=e._rpcCallbacks.get(n.id);if(null==t)return void ad(e,"error",new h(`Can't find callback by id: ${n.id}`));try{t(n)}finally{e._rpcCallbacks.delete(n.id)}}}(e,n)}})}))}(e,null!=t.existingFsmId?Nd:wd,bd,t),e}on(e,t){this._eventEmitter.on(e,t)}off(e,t){this._eventEmitter.removeListener(e,t)}disconnect(){return pd(this)}status(){return this._status}async state(){const e=(t=await hd(this,"channels.get.offchain_state",{}),Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return{...e,[ed(n)]:r}}),{}));var t;return{calls:sa(e.calls,Vt.CallsMtree),...""!==e.halfSignedTx&&{halfSignedTx:sa(e.halfSignedTx,Vt.SignedTx)},...""!==e.signedTx&&{signedTx:sa(e.signedTx,Vt.SignedTx)},trees:sa(e.trees,Vt.StateTrees)}}round(){if(""===this._state)return null;const e=sa(this._state,Vt.SignedTx).encodedTx;switch(e.tag){case Vt.ChannelCreateTx:return 1;case Vt.ChannelOffChainTx:case Vt.ChannelWithdrawTx:case Vt.ChannelDepositTx:return e.round;default:return null}}id(){if(null==this._channelId)throw new h("Channel is not initialized");return this._channelId}fsmId(){if(null==this._fsmId)throw new h("Channel is not initialized");return this._fsmId}async enqueueAction(e){return async function(e,t,n){const r=new Promise(((r,a)=>{e._actionQueue.push({guard:t,action(){const e=n();return{...e,state:{...e.state,resolve:r,reject:a}}}})}));return ld(e),r}(this,((e,t)=>t?.handler===bd),e)}async leave(){return this.enqueueAction((()=>(ud(this,"channels.leave"),{handler:zd})))}async shutdown(e){return this.enqueueAction((()=>(ud(this,"channels.shutdown"),{handler:Td,state:{sign:e}})))}static async reconnect(e,t){const{sign:n}=e;return qd.initialize({...e,reconnectTx:await n("reconnect",ia({...t,tag:Vt.ChannelClientReconnectTx}))})}}class Pd extends qd{async update(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return this.enqueueAction((()=>{ud(this,"channels.update.new",{from:e,to:t,amount:n,meta:a});const i=async(e,t,n)=>"channels.sign.update"===t.method?await fd(this,"channels.update",t.params.data,(async e=>r(e,{updates:t.params.data.updates})))?{handler:i,state:n}:{handler:(e,t)=>gd(this,t,n,(()=>(sd(this,t.params.data.state),n.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:bd}))),state:n}:"channels.error"===t.method?(n.reject(new K(t.data.message)),{handler:bd}):gd(this,t,n);return{handler:i}}))}async poi(e){let{accounts:t,contracts:n}=e;return sa((await hd(this,"channels.get.poi",{accounts:t,contracts:n})).poi,Vt.TreesPoi)}async balances(e){return Object.fromEntries((await hd(this,"channels.get.balances",{accounts:e})).map((e=>[e.account,e.balance])))}async awaitingActionTx(e,t,n){if(t.method!==`channels.sign.${e}_tx`)return yd(0,t,n);const r=(t,a)=>{if("channels.on_chain_tx"===a.method)return n.onOnChainTx?.(a.params.data.tx),{handler:r,state:n};if("channels.info"===a.method&&[`own_${e}_locked`,`${e}_locked`].includes(a.params.data.event)){const t="deposit"===e?"Deposit":"Withdraw",i=a.params.data.event.startsWith("own_");return n[`on${i?"Own":""}${t}Locked`]?.(),{handler:r,state:n}}return gd(this,a,n,(()=>(sd(this,a.params.data.state),n.resolve({accepted:!0,signedTx:a.params.data.state}),{handler:bd})))},{sign:a}=n;return await fd(this,`channels.${e}_tx`,t.params.data,(async e=>a(e,{updates:t.params.data.updates}))),{handler:r,state:n}}async withdraw(e,t){let{onOnChainTx:n,onOwnWithdrawLocked:r,onWithdrawLocked:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(ud(this,"channels.withdraw",{amount:e}),{handler:async(e,t,n)=>this.awaitingActionTx("withdraw",t,n),state:{sign:t,onOnChainTx:n,onOwnWithdrawLocked:r,onWithdrawLocked:a}})))}async deposit(e,t){let{onOnChainTx:n,onOwnDepositLocked:r,onDepositLocked:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(ud(this,"channels.deposit",{amount:e}),{handler:async(e,t,n)=>this.awaitingActionTx("deposit",t,n),state:{sign:t,onOnChainTx:n,onOwnDepositLocked:r,onDepositLocked:a}})))}async sendMessage(e,t){const n="object"==typeof e?JSON.stringify(e):e;"connecting"===this.status()&&(await new Promise((e=>{const t=n=>{"connecting"!==n&&(e(),this.off("statusChanged",t))};this.on("statusChanged",t)})),await Ve(500)),ud(this,"channels.message",{info:n,to:t})}}function Ed(e){return Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return{...e,[ed(n)]:r}}),{})}class Id extends Pd{static async initialize(e){return qd._initialize(new Id,e)}async createContract(e,t){let{code:n,callData:r,deposit:a,vmVersion:i,abiVersion:o}=e;return this.enqueueAction((()=>(ud(this,"channels.update.new_contract",{code:n,call_data:r,deposit:a,vm_version:i,abi_version:o}),{handler:async(e,t,n)=>"channels.sign.update"!==t.method?yd(0,t,n):(await fd(this,"channels.update",t.params.data,(async e=>n.sign(e))),{handler:(e,t,n)=>gd(this,t,n,(()=>{const e=sa(t.params.data.state,Vt.SignedTx).encodedTx;if(e.tag!==Vt.ChannelOffChainTx)throw new h(`Tag should be ${Vt[Vt.ChannelOffChainTx]}, got ${Vt[e.tag]} instead`);const r="initiator"===this._options.role?"initiatorId":"responderId",a=this._options[r];sd(this,t.params.data.state);const i=Nt(a,e.round);return ad(this,"newContract",i),n.resolve({accepted:!0,address:i,signedTx:t.params.data.state}),{handler:bd}})),state:n}),state:{sign:t}})))}async callContract(e,t){let{amount:n,callData:r,contract:a,abiVersion:i}=e;return this.enqueueAction((()=>(ud(this,"channels.update.call_contract",{amount:n,call_data:r,contract_id:a,abi_version:i}),{handler:async(e,t,n)=>"channels.sign.update"!==t.method?yd(0,t,n):(await fd(this,"channels.update",t.params.data,(async e=>n.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,n)=>gd(this,t,n,(()=>(sd(this,t.params.data.state),n.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:bd}))),state:n}),state:{sign:t}})))}async forceProgress(e,t){let{amount:n,callData:r,contract:a,abiVersion:i,gasLimit:o=1e6,gasPrice:s=kt}=e,{onOnChainTx:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(ud(this,"channels.force_progress",{amount:n,call_data:r,contract_id:a,abi_version:i,gas_price:s,gas:o}),{handler:async(e,t,n)=>"channels.sign.force_progress_tx"!==t.method?yd(0,t,n):(await fd(this,"channels.force_progress_sign",t.params.data,(async e=>n.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,n)=>("channels.on_chain_tx"===t.method&&(n.onOnChainTx?.(t.params.data.tx),ad(this,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),n.resolve({accepted:!0,tx:t.params.data.tx})),yd(0,t,n)),state:n}),state:{sign:t,onOnChainTx:c}})))}async callContractStatic(e){let{amount:t,callData:n,contract:r,abiVersion:a}=e;return Ed(await hd(this,"channels.dry_run.call_contract",{amount:t,call_data:n,contract_id:r,abi_version:a}))}async getContractCall(e){let{caller:t,contract:n,round:r}=e;return Ed(await hd(this,"channels.get.contract_call",{caller_id:t,contract_id:n,round:r}))}async getContractState(e){const t=await hd(this,"channels.get.contract",{pubkey:e});return Ed({...t,contract:Ed(t.contract)})}async cleanContractCalls(){return this.enqueueAction((()=>(ud(this,"channels.clean_contract_calls"),{handler(e,t,n){return"channels.calls_pruned.reply"===t.method?(n.resolve(),{handler:bd}):(n.reject(new J("Unexpected message received")),{handler:_d})}})))}}var kd=(e,t)=>(e.connect((e=>t.sendMessage(e)),(()=>t.disconnect())),t.connect((t=>e.sendMessage(t)),(()=>e.disconnect())),()=>{e.disconnect(),t.disconnect()});class Od{constructor(e){let{debug:t=!1}=e;this.debug=t}connect(e,t){if(this.isConnected())throw new qe("You already connected")}disconnect(){if(!this.isConnected())throw new Pe("You dont have connection. Please connect before")}receiveMessage(e){this.debug&&console.log("Receive message:",e)}sendMessage(e){this.debug&&console.log("Send message:",e)}}function Md(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Bd=new WeakMap,Rd=new WeakMap,jd=new WeakMap;class Dd extends Od{constructor(){let{target:e,self:t=window,origin:n,sendDirection:r,receiveDirection:a=lu.to_aepp,...i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(i),Md(this,Bd,{writable:!0,value:void 0}),Md(this,Rd,{writable:!0,value:void 0}),Md(this,jd,{writable:!0,value:void 0}),On(this,Rd,e),On(this,jd,t),this.origin=n,this.sendDirection=r,this.receiveDirection=a}isConnected(){return null!=this.listener}connect(e,t){super.connect(e,t),this.listener=t=>{var n;if("object"!=typeof t.data||"2.0"!==(null!==(n=t.data.jsonrpc)&&void 0!==n?n:t.data.data?.jsonrpc))return;if(null!=this.origin&&this.origin!==t.origin)return;if(null!=Mn(this,Rd)&&Mn(this,Rd)!==t.source)return;this.receiveMessage(t);let{data:r}=t;if(null!=r.type){if(t.data.type!==this.receiveDirection)return;r=r.data}e(r,t.origin,t.source)},Mn(this,jd).addEventListener("message",this.listener),On(this,Bd,t)}disconnect(){if(super.disconnect(),null==this.listener||null==Mn(this,Bd))throw new B("Expected to not happen, required for TS");Mn(this,jd).removeEventListener("message",this.listener),delete this.listener,Mn(this,Bd).call(this),On(this,Bd,void 0)}sendMessage(e){var t;if(null==Mn(this,Rd))throw new Ee("Can't send messages without target");const n=null!=this.sendDirection?{type:this.sendDirection,data:e}:e;super.sendMessage(n),Mn(this,Rd).postMessage(n,null!==(t=this.origin)&&void 0!==t?t:"*")}}var Fd=(e,t)=>{if(null==window)throw new I("Window object not found, you can run wallet detector only in browser");const n={};return e.connect(((e,r,a)=>{let{method:i,params:o}=e;if(i!==mu.readyToConnect||null!=n[o.id])return;const s={info:o,getConnection(){const e="extension"===o.type;return new Dd({sendDirection:e?lu.to_waellet:void 0,receiveDirection:e?lu.to_aepp:void 0,target:a,origin:e?window.origin:o.origin})}};n[s.info.id]=s,t({wallets:n,newWallet:s})}),(()=>{})),Object.keys(n).length>0&&t({wallets:n}),()=>e.disconnect()};var $d=new WeakMap;class Ud extends Od{constructor(e){let{port:t,...n}=e;var r,a,i;super(n),i={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(r=this,a=$d),a.set(r,i),this.port=t}disconnect(){if(super.disconnect(),this.port.disconnect(),null==Mn(this,$d))throw new R;this.port.onMessage.removeListener(Mn(this,$d)[0]),this.port.onDisconnect.removeListener(Mn(this,$d)[1]),On(this,$d,void 0)}connect(e,t){super.connect(e,t),On(this,$d,[(t,n)=>{var r;this.receiveMessage(t),e(t,null!==(r=n.sender?.url)&&void 0!==r?r:"",n)},t]),this.port.onMessage.addListener(Mn(this,$d)[0]),this.port.onDisconnect.addListener(Mn(this,$d)[1])}sendMessage(e){super.sendMessage(e),this.port.postMessage(e)}isConnected(){return null!=Mn(this,$d)}}}(),v}()}));
|
|
3
3
|
//# sourceMappingURL=aepp-sdk.browser.js.map
|