@aeternity/aepp-sdk 11.0.0 → 12.1.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/LICENSE +1 -1
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -22
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +2 -1
- package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +20764 -1
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +37 -0
- package/es/AeSdk.mjs +81 -0
- package/es/AeSdk.mjs.map +1 -0
- package/es/AeSdkAepp.d.ts +70 -0
- package/es/AeSdkAepp.mjs +176 -0
- package/es/AeSdkAepp.mjs.map +1 -0
- package/es/AeSdkBase.d.ts +213 -0
- package/es/AeSdkBase.mjs +314 -0
- package/es/AeSdkBase.mjs.map +1 -0
- package/es/AeSdkWallet.d.ts +104 -0
- package/es/AeSdkWallet.mjs +326 -0
- package/es/AeSdkWallet.mjs.map +1 -0
- package/es/Node.d.ts +41 -0
- package/es/Node.mjs +147 -0
- package/es/Node.mjs.map +1 -0
- package/es/account/Base.d.ts +68 -0
- package/es/account/Base.mjs +123 -0
- package/es/account/Base.mjs.map +1 -0
- package/es/account/Memory.d.ts +26 -0
- package/es/account/Memory.mjs +103 -0
- package/es/account/Memory.mjs.map +1 -0
- package/es/account/Rpc.d.ts +27 -0
- package/es/account/Rpc.mjs +80 -0
- package/es/account/Rpc.mjs.map +1 -0
- package/es/aens.d.ts +222 -0
- package/es/aens.mjs +338 -0
- package/es/aens.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/Browser.d.ts +33 -0
- package/es/aepp-wallet-communication/connection/Browser.mjs +73 -0
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +58 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +146 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection-proxy.d.ts +11 -0
- package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +16 -11
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
- package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
- package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
- package/es/aepp-wallet-communication/schema.d.ts +105 -46
- package/es/aepp-wallet-communication/schema.mjs +251 -0
- package/es/aepp-wallet-communication/schema.mjs.map +1 -0
- package/es/aepp-wallet-communication/wallet-detector.d.ts +25 -0
- package/es/aepp-wallet-communication/wallet-detector.mjs +62 -0
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
- package/es/apis/compiler/compiler.d.ts +92 -0
- package/es/apis/compiler/compiler.mjs +576 -0
- package/es/apis/compiler/compiler.mjs.map +1 -0
- package/es/apis/compiler/index.d.ts +2 -0
- package/es/apis/compiler/index.mjs +3 -0
- package/es/apis/compiler/index.mjs.map +1 -0
- package/es/apis/compiler/models/index.d.ts +248 -0
- package/es/apis/compiler/models/index.mjs +48 -0
- package/es/apis/compiler/models/index.mjs.map +1 -0
- package/es/apis/compiler/models/mappers.d.ts +23 -0
- package/es/apis/compiler/models/mappers.mjs +585 -0
- package/es/apis/compiler/models/mappers.mjs.map +1 -0
- package/es/apis/compiler/models/parameters.d.ts +13 -0
- package/es/apis/compiler/models/parameters.mjs +71 -0
- package/es/apis/compiler/models/parameters.mjs.map +1 -0
- package/es/apis/node/index.d.ts +2 -0
- package/es/apis/node/index.mjs +3 -0
- package/es/apis/node/index.mjs.map +1 -0
- package/es/apis/node/models/index.d.ts +1065 -0
- package/es/apis/node/models/index.mjs +2 -0
- package/es/apis/node/models/index.mjs.map +1 -0
- package/es/apis/node/models/mappers.d.ts +95 -0
- package/es/apis/node/models/mappers.mjs +4166 -0
- package/es/apis/node/models/mappers.mjs.map +1 -0
- package/es/apis/node/models/parameters.d.ts +17 -0
- package/es/apis/node/models/parameters.mjs +165 -0
- package/es/apis/node/models/parameters.mjs.map +1 -0
- package/es/apis/node/node.d.ts +215 -0
- package/es/apis/node/node.mjs +1165 -0
- package/es/apis/node/node.mjs.map +1 -0
- package/es/chain.d.ts +248 -0
- package/es/chain.mjs +560 -0
- package/es/chain.mjs.map +1 -0
- package/es/channel/handlers.d.ts +34 -0
- package/es/channel/handlers.mjs +164 -131
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/index.d.ts +625 -0
- package/es/channel/index.mjs +897 -902
- package/es/channel/index.mjs.map +1 -1
- package/es/channel/internal.d.ts +101 -0
- package/es/channel/internal.mjs +138 -88
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Compiler.d.ts +18 -0
- package/es/contract/Compiler.mjs +68 -0
- package/es/contract/Compiler.mjs.map +1 -0
- package/es/contract/aci.d.ts +127 -0
- package/es/contract/aci.mjs +225 -193
- package/es/contract/aci.mjs.map +1 -1
- package/es/contract/ga.d.ts +69 -0
- package/es/contract/ga.mjs +195 -0
- package/es/contract/ga.mjs.map +1 -0
- package/es/contract/methods.d.ts +71 -0
- package/es/contract/methods.mjs +104 -0
- package/es/contract/methods.mjs.map +1 -0
- package/es/deprecated/index.d.ts +143 -0
- package/es/deprecated/index.mjs +162 -0
- package/es/deprecated/index.mjs.map +1 -0
- package/es/deprecated/methods.d.ts +18 -0
- package/es/deprecated/methods.mjs +26 -0
- package/es/deprecated/methods.mjs.map +1 -0
- package/es/index.d.ts +35 -0
- package/es/index.mjs +35 -40
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +161 -0
- package/es/oracle.mjs +306 -0
- package/es/oracle.mjs.map +1 -0
- package/es/spend.d.ts +62 -0
- package/es/spend.mjs +111 -0
- package/es/spend.mjs.map +1 -0
- package/es/tx/builder/address.d.ts +25 -0
- package/es/tx/builder/address.mjs +45 -0
- package/es/tx/builder/address.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +70 -0
- package/es/tx/builder/constants.mjs +122 -0
- package/es/tx/builder/constants.mjs.map +1 -0
- package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
- package/es/tx/builder/field-types/coin-amount.mjs +26 -0
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
- package/es/tx/builder/field-types/deposit.d.ts +15 -0
- package/es/tx/builder/field-types/deposit.mjs +19 -0
- package/es/tx/builder/field-types/deposit.mjs.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +25 -0
- package/es/tx/builder/field-types/fee.mjs +150 -0
- package/es/tx/builder/field-types/fee.mjs.map +1 -0
- package/es/tx/builder/field-types/field.d.ts +6 -0
- package/es/tx/builder/field-types/field.mjs +15 -0
- package/es/tx/builder/field-types/field.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
- package/es/tx/builder/field-types/gas-limit.mjs +33 -0
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-price.d.ts +8 -0
- package/es/tx/builder/field-types/gas-price.mjs +18 -0
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
- package/es/tx/builder/field-types/index.d.ts +70 -0
- package/es/tx/builder/field-types/index.mjs +25 -0
- package/es/tx/builder/field-types/index.mjs.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +20 -0
- package/es/tx/builder/field-types/name-fee.mjs +24 -0
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
- package/es/tx/builder/field-types/name-id.d.ts +14 -0
- package/es/tx/builder/field-types/name-id.mjs +19 -0
- package/es/tx/builder/field-types/name-id.mjs.map +1 -0
- package/es/tx/builder/field-types/name.d.ts +13 -0
- package/es/tx/builder/field-types/name.mjs +18 -0
- package/es/tx/builder/field-types/name.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/es/tx/builder/field-types/short-u-int.mjs +12 -0
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.d.ts +8 -0
- package/es/tx/builder/field-types/u-int.mjs +14 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -0
- package/es/tx/builder/helpers.d.ts +125 -0
- package/es/tx/builder/helpers.mjs +94 -240
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +88 -0
- package/es/tx/builder/index.mjs +167 -358
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +1201 -0
- package/es/tx/builder/schema.mjs +175 -664
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/index.d.ts +64 -0
- package/es/tx/index.mjs +151 -265
- package/es/tx/index.mjs.map +1 -1
- package/es/tx/validator.d.ts +20 -0
- package/es/tx/validator.mjs +104 -124
- package/es/tx/validator.mjs.map +1 -1
- package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
- package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
- package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
- package/es/typings/bip32-path/index.d.mjs +2 -0
- package/es/typings/bip32-path/index.d.mjs.map +1 -0
- package/es/typings/blakejs/index.d.mjs.map +1 -1
- package/es/typings/sha-js/index.d.mjs +2 -0
- package/es/typings/sha-js/index.d.mjs.map +1 -0
- package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
- package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
- package/es/utils/amount-formatter.d.ts +42 -0
- package/es/utils/amount-formatter.mjs +36 -49
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +6 -0
- package/es/utils/autorest.mjs +97 -0
- package/es/utils/autorest.mjs.map +1 -0
- package/es/utils/bignumber.d.ts +13 -0
- package/es/utils/bignumber.mjs +11 -8
- package/es/utils/bignumber.mjs.map +1 -1
- package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
- package/es/utils/bytes.mjs +11 -15
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +88 -0
- package/es/utils/crypto.mjs +64 -108
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder-types.d.ts +61 -0
- package/es/utils/encoder-types.mjs +36 -0
- package/es/utils/encoder-types.mjs.map +1 -0
- package/es/utils/encoder.d.ts +25 -0
- package/es/utils/encoder.mjs +118 -0
- package/es/utils/encoder.mjs.map +1 -0
- package/es/{errors.d.ts → utils/errors.d.ts} +246 -59
- package/es/utils/errors.mjs +313 -136
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +50 -0
- package/es/utils/hd-wallet.mjs +86 -45
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.d.ts +5 -0
- package/es/utils/json-big.mjs +12 -16
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.d.ts +51 -0
- package/es/utils/keystore.mjs +101 -194
- package/es/utils/keystore.mjs.map +1 -1
- package/es/{mptree.d.ts → utils/mptree.d.ts} +6 -9
- package/es/utils/mptree.mjs +22 -18
- package/es/utils/mptree.mjs.map +1 -1
- package/es/utils/other.d.ts +20 -0
- package/es/utils/other.mjs +32 -35
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.d.ts +1 -0
- package/es/utils/semver-satisfies.mjs +2 -2
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.d.ts +24 -0
- package/es/utils/string.mjs +8 -10
- package/es/utils/string.mjs.map +1 -1
- package/package.json +56 -42
- package/src/AeSdk.ts +68 -0
- package/src/AeSdkAepp.ts +176 -0
- package/src/AeSdkBase.ts +338 -0
- package/src/AeSdkWallet.ts +348 -0
- package/src/Node.ts +173 -0
- package/src/account/Base.ts +124 -0
- package/src/account/Memory.ts +98 -0
- package/src/account/Rpc.ts +69 -0
- package/src/aens.ts +407 -0
- package/src/aepp-wallet-communication/connection/Browser.ts +71 -0
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +59 -0
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +122 -0
- package/{es/utils/crypto-ts.mjs → src/aepp-wallet-communication/connection-proxy.ts} +18 -18
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +143 -0
- package/src/aepp-wallet-communication/rpc/types.ts +66 -0
- package/src/aepp-wallet-communication/schema.ts +224 -0
- package/src/aepp-wallet-communication/wallet-detector.ts +72 -0
- package/src/apis/compiler/code-model-v4.yaml +2649 -0
- package/src/apis/compiler/compiler.ts +585 -0
- package/src/apis/compiler/index.ts +2 -0
- package/src/apis/compiler/models/index.ts +301 -0
- package/src/apis/compiler/models/mappers.ts +583 -0
- package/src/apis/compiler/models/parameters.ts +93 -0
- package/src/apis/node/code-model-v4.yaml +10080 -0
- package/src/apis/node/index.ts +2 -0
- package/src/apis/node/models/index.ts +1257 -0
- package/src/apis/node/models/mappers.ts +4280 -0
- package/src/apis/node/models/parameters.ts +188 -0
- package/src/apis/node/node.ts +1299 -0
- package/src/chain.ts +502 -0
- package/src/channel/handlers.ts +817 -0
- package/src/channel/index.ts +1025 -0
- package/src/channel/internal.ts +361 -0
- package/src/contract/Compiler.ts +67 -0
- package/src/contract/aci.ts +538 -0
- package/src/contract/ga.ts +199 -0
- package/src/contract/methods.ts +123 -0
- package/src/deprecated/index.ts +170 -0
- package/src/deprecated/methods.ts +25 -0
- package/src/index.ts +56 -0
- package/src/oracle.ts +364 -0
- package/src/spend.ts +164 -0
- package/src/tx/builder/address.ts +50 -0
- package/src/tx/builder/constants.ts +126 -0
- package/src/tx/builder/field-types/coin-amount.ts +27 -0
- package/src/tx/builder/field-types/deposit.ts +21 -0
- package/src/tx/builder/field-types/fee.ts +143 -0
- package/src/tx/builder/field-types/field.ts +9 -0
- package/src/tx/builder/field-types/gas-limit.ts +41 -0
- package/src/tx/builder/field-types/gas-price.ts +16 -0
- package/src/tx/builder/field-types/index.ts +45 -0
- package/src/tx/builder/field-types/name-fee.ts +32 -0
- package/src/tx/builder/field-types/name-id.ts +20 -0
- package/src/tx/builder/field-types/name.ts +18 -0
- package/src/tx/builder/field-types/short-u-int.ts +11 -0
- package/src/tx/builder/field-types/u-int.ts +16 -0
- package/src/tx/builder/helpers.ts +248 -0
- package/src/tx/builder/index.ts +400 -0
- package/src/tx/builder/schema.ts +727 -0
- package/src/tx/index.ts +192 -0
- package/src/tx/validator.ts +230 -0
- package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
- package/src/typings/@aeternity__uuid/index.d.ts +5 -0
- package/src/typings/bip32-path/index.d.ts +33 -0
- package/src/typings/blakejs/index.d.ts +4 -32
- package/src/typings/sha-js/index.d.ts +5 -0
- package/src/typings/tweetnacl-auth/index.d.ts +14 -0
- package/src/utils/amount-formatter.ts +56 -69
- package/src/utils/autorest.ts +93 -0
- package/src/utils/bignumber.ts +11 -12
- package/src/utils/bytes.ts +29 -31
- package/src/utils/crypto.ts +205 -0
- package/src/utils/encoder-types.ts +63 -0
- package/src/utils/encoder.ts +146 -0
- package/src/utils/errors.ts +482 -366
- package/src/utils/hd-wallet.ts +166 -0
- package/src/utils/json-big.ts +27 -0
- package/src/utils/keystore.ts +182 -0
- package/src/utils/mptree.ts +64 -61
- package/src/utils/other.ts +34 -41
- package/src/utils/semver-satisfies.ts +15 -11
- package/src/utils/string.ts +18 -20
- package/es/account/base.mjs +0 -179
- package/es/account/base.mjs.map +0 -1
- package/es/account/memory.mjs +0 -99
- package/es/account/memory.mjs.map +0 -1
- package/es/account/multiple.mjs +0 -179
- package/es/account/multiple.mjs.map +0 -1
- package/es/ae/aens.mjs +0 -404
- package/es/ae/aens.mjs.map +0 -1
- package/es/ae/aepp.mjs +0 -45
- package/es/ae/aepp.mjs.map +0 -1
- package/es/ae/contract.mjs +0 -159
- package/es/ae/contract.mjs.map +0 -1
- package/es/ae/index.mjs +0 -207
- package/es/ae/index.mjs.map +0 -1
- package/es/ae/oracle.mjs +0 -339
- package/es/ae/oracle.mjs.map +0 -1
- package/es/ae/universal.mjs +0 -45
- package/es/ae/universal.mjs.map +0 -1
- package/es/ae/wallet.mjs +0 -50
- package/es/ae/wallet.mjs.map +0 -1
- package/es/amount-formatter.d.ts +0 -58
- package/es/bignumber.d.ts +0 -18
- package/es/chain/index.mjs +0 -272
- package/es/chain/index.mjs.map +0 -1
- package/es/chain/node.mjs +0 -442
- package/es/chain/node.mjs.map +0 -1
- package/es/contract/compiler.mjs +0 -115
- package/es/contract/compiler.mjs.map +0 -1
- package/es/contract/ga/helpers.mjs +0 -30
- package/es/contract/ga/helpers.mjs.map +0 -1
- package/es/contract/ga/index.mjs +0 -178
- package/es/contract/ga/index.mjs.map +0 -1
- package/es/crypto-ts.d.ts +0 -9
- package/es/node-pool/index.mjs +0 -188
- package/es/node-pool/index.mjs.map +0 -1
- package/es/node.mjs +0 -133
- package/es/node.mjs.map +0 -1
- package/es/other.d.ts +0 -31
- package/es/semver-satisfies.d.ts +0 -1
- package/es/string.d.ts +0 -26
- package/es/tx/builder/field-types.mjs +0 -74
- package/es/tx/builder/field-types.mjs.map +0 -1
- package/es/tx/tx-object.mjs +0 -283
- package/es/tx/tx-object.mjs.map +0 -1
- package/es/tx/tx.mjs +0 -938
- package/es/tx/tx.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs +0 -132
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs +0 -183
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/index.mjs +0 -87
- package/es/utils/aepp-wallet-communication/connection/index.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/content-script-bridge.mjs +0 -98
- package/es/utils/aepp-wallet-communication/content-script-bridge.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/helpers.mjs +0 -92
- package/es/utils/aepp-wallet-communication/helpers.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs +0 -375
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs +0 -275
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs +0 -541
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/schema.mjs +0 -102
- package/es/utils/aepp-wallet-communication/schema.mjs.map +0 -1
- package/es/utils/aepp-wallet-communication/wallet-detector.mjs +0 -110
- package/es/utils/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
- package/es/utils/async-init.mjs +0 -64
- package/es/utils/async-init.mjs.map +0 -1
- package/es/utils/crypto-ts.mjs.map +0 -1
- package/es/utils/swagger.mjs +0 -164
- package/es/utils/swagger.mjs.map +0 -1
- package/src/account/base.js +0 -153
- package/src/account/memory.js +0 -83
- package/src/account/multiple.js +0 -162
- package/src/ae/aens.js +0 -361
- package/src/ae/aepp.js +0 -45
- package/src/ae/contract.js +0 -148
- package/src/ae/index.js +0 -168
- package/src/ae/oracle.js +0 -311
- package/src/ae/universal.js +0 -47
- package/src/ae/wallet.js +0 -50
- package/src/chain/index.js +0 -269
- package/src/chain/node.js +0 -320
- package/src/channel/handlers.js +0 -673
- package/src/channel/index.js +0 -898
- package/src/channel/internal.js +0 -237
- package/src/contract/aci.js +0 -376
- package/src/contract/compiler.js +0 -100
- package/src/contract/ga/helpers.js +0 -19
- package/src/contract/ga/index.js +0 -150
- package/src/index.js +0 -89
- package/src/node-pool/index.js +0 -172
- package/src/node.js +0 -116
- package/src/tx/builder/field-types.js +0 -61
- package/src/tx/builder/helpers.js +0 -380
- package/src/tx/builder/index.js +0 -465
- package/src/tx/builder/schema.js +0 -1197
- package/src/tx/index.js +0 -301
- package/src/tx/tx-object.js +0 -187
- package/src/tx/tx.js +0 -631
- package/src/tx/validator.js +0 -181
- package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -119
- package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -165
- package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
- package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -86
- package/src/utils/aepp-wallet-communication/helpers.js +0 -60
- package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -294
- package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -232
- package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -401
- package/src/utils/aepp-wallet-communication/schema.ts +0 -80
- package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -92
- package/src/utils/async-init.js +0 -45
- package/src/utils/crypto.js +0 -229
- package/src/utils/hd-wallet.js +0 -100
- package/src/utils/json-big.js +0 -26
- package/src/utils/keystore.js +0 -219
- package/src/utils/swagger.js +0 -156
package/es/chain.mjs
ADDED
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ISC License (ISC)
|
|
3
|
+
* Copyright (c) 2022 aeternity developers
|
|
4
|
+
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
|
8
|
+
*
|
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
*/
|
|
17
|
+
import { AE_AMOUNT_FORMATS, formatAmount } from "./utils/amount-formatter.mjs";
|
|
18
|
+
import verifyTransaction from "./tx/validator.mjs";
|
|
19
|
+
import { pause } from "./utils/other.mjs";
|
|
20
|
+
import { isNameValid, produceNameId } from "./tx/builder/helpers.mjs";
|
|
21
|
+
import { DRY_RUN_ACCOUNT } from "./tx/builder/schema.mjs";
|
|
22
|
+
import { AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError, TxTimedOutError, TxNotInChainError, InternalError } from "./utils/errors.mjs";
|
|
23
|
+
import { decode } from "./utils/encoder.mjs";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @category chain
|
|
27
|
+
*/
|
|
28
|
+
export function _getPollInterval(type, _ref) {
|
|
29
|
+
let {
|
|
30
|
+
_expectedMineRate = 180000,
|
|
31
|
+
_microBlockCycle = 3000,
|
|
32
|
+
_maxPollInterval = 5000
|
|
33
|
+
} = _ref;
|
|
34
|
+
const base = {
|
|
35
|
+
block: _expectedMineRate,
|
|
36
|
+
microblock: _microBlockCycle
|
|
37
|
+
}[type];
|
|
38
|
+
return Math.min(base / 3, _maxPollInterval);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @category exception
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
export class InvalidTxError extends TransactionError {
|
|
45
|
+
constructor(message, validation, transaction) {
|
|
46
|
+
super(message);
|
|
47
|
+
this.name = 'InvalidTxError';
|
|
48
|
+
this.validation = validation;
|
|
49
|
+
this.transaction = transaction;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Obtain current height of the chain
|
|
55
|
+
* @category chain
|
|
56
|
+
* @returns Current chain height
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
export async function getHeight(_ref2) {
|
|
60
|
+
let {
|
|
61
|
+
onNode
|
|
62
|
+
} = _ref2;
|
|
63
|
+
return (await onNode.getCurrentKeyBlockHeight()).height;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Wait for a transaction to be mined
|
|
67
|
+
* @category chain
|
|
68
|
+
* @param th - The hash of transaction to poll
|
|
69
|
+
* @param options - Options
|
|
70
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
71
|
+
* @param options.blocks - Number of blocks mined after which to fail
|
|
72
|
+
* @param options.onNode - Node to use
|
|
73
|
+
* @returns The transaction as it was mined
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
export async function poll(th, _ref3) {
|
|
77
|
+
var _interval;
|
|
78
|
+
|
|
79
|
+
let {
|
|
80
|
+
blocks = 10,
|
|
81
|
+
interval,
|
|
82
|
+
onNode,
|
|
83
|
+
...options
|
|
84
|
+
} = _ref3;
|
|
85
|
+
(_interval = interval) !== null && _interval !== void 0 ? _interval : interval = _getPollInterval('microblock', options);
|
|
86
|
+
const max = (await getHeight({
|
|
87
|
+
onNode
|
|
88
|
+
})) + blocks;
|
|
89
|
+
|
|
90
|
+
do {
|
|
91
|
+
const tx = await onNode.getTransactionByHash(th);
|
|
92
|
+
if (tx.blockHeight !== -1) return tx;
|
|
93
|
+
await pause(interval);
|
|
94
|
+
} while ((await getHeight({
|
|
95
|
+
onNode
|
|
96
|
+
})) < max);
|
|
97
|
+
|
|
98
|
+
throw new TxTimedOutError(blocks, th);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Wait for the chain to reach a specific height
|
|
102
|
+
* @category chain
|
|
103
|
+
* @param height - Height to wait for
|
|
104
|
+
* @param options - Options
|
|
105
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
106
|
+
* @param options.onNode - Node to use
|
|
107
|
+
* @returns Current chain height
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export async function awaitHeight(height, _ref4) {
|
|
111
|
+
var _interval2;
|
|
112
|
+
|
|
113
|
+
let {
|
|
114
|
+
interval,
|
|
115
|
+
onNode,
|
|
116
|
+
...options
|
|
117
|
+
} = _ref4;
|
|
118
|
+
(_interval2 = interval) !== null && _interval2 !== void 0 ? _interval2 : interval = _getPollInterval('block', options);
|
|
119
|
+
let currentHeight;
|
|
120
|
+
|
|
121
|
+
do {
|
|
122
|
+
if (currentHeight != null) await pause(interval);
|
|
123
|
+
currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;
|
|
124
|
+
} while (currentHeight < height);
|
|
125
|
+
|
|
126
|
+
return currentHeight;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Wait for transaction confirmation
|
|
130
|
+
* @category chain
|
|
131
|
+
* @param txHash - Transaction hash
|
|
132
|
+
* @param options - Options
|
|
133
|
+
* @param options.confirm - Number of micro blocks to wait for transaction confirmation
|
|
134
|
+
* @param options.onNode - Node to use
|
|
135
|
+
* @returns Current Height
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
export async function waitForTxConfirm(txHash, _ref5) {
|
|
139
|
+
let {
|
|
140
|
+
confirm = 3,
|
|
141
|
+
onNode,
|
|
142
|
+
...options
|
|
143
|
+
} = _ref5;
|
|
144
|
+
const {
|
|
145
|
+
blockHeight
|
|
146
|
+
} = await onNode.getTransactionByHash(txHash);
|
|
147
|
+
const height = await awaitHeight(blockHeight + confirm, {
|
|
148
|
+
onNode,
|
|
149
|
+
...options
|
|
150
|
+
});
|
|
151
|
+
const {
|
|
152
|
+
blockHeight: newBlockHeight
|
|
153
|
+
} = await onNode.getTransactionByHash(txHash);
|
|
154
|
+
|
|
155
|
+
switch (newBlockHeight) {
|
|
156
|
+
case -1:
|
|
157
|
+
throw new TxNotInChainError(txHash);
|
|
158
|
+
|
|
159
|
+
case blockHeight:
|
|
160
|
+
return height;
|
|
161
|
+
|
|
162
|
+
default:
|
|
163
|
+
return waitForTxConfirm(txHash, {
|
|
164
|
+
onNode,
|
|
165
|
+
confirm,
|
|
166
|
+
...options
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Submit a signed transaction for mining
|
|
172
|
+
* @category chain
|
|
173
|
+
* @param tx - Transaction to submit
|
|
174
|
+
* @param options - Options
|
|
175
|
+
* @param options.onNode - Node to use
|
|
176
|
+
* @param options.onAccount - Account to use
|
|
177
|
+
* @param options.verify - Verify transaction before sending
|
|
178
|
+
* @param options.waitMined - Ensure that transaction get into block
|
|
179
|
+
* @param options.confirm - Number of micro blocks that should be mined after tx get included
|
|
180
|
+
* @returns Transaction details
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
export async function sendTransaction(tx, _ref6) {
|
|
184
|
+
let {
|
|
185
|
+
onNode,
|
|
186
|
+
onAccount,
|
|
187
|
+
verify = true,
|
|
188
|
+
waitMined = true,
|
|
189
|
+
confirm,
|
|
190
|
+
...options
|
|
191
|
+
} = _ref6;
|
|
192
|
+
|
|
193
|
+
if (verify) {
|
|
194
|
+
const validation = await verifyTransaction(tx, onNode);
|
|
195
|
+
|
|
196
|
+
if (validation.length > 0) {
|
|
197
|
+
const message = `Transaction verification errors: ${validation.map(v => v.message).join(', ')}`;
|
|
198
|
+
throw new InvalidTxError(message, validation, tx);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
try {
|
|
203
|
+
let __queue;
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
__queue = onAccount != null ? `tx-${await onAccount.address(options)}` : null;
|
|
207
|
+
} catch (error) {
|
|
208
|
+
__queue = null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const {
|
|
212
|
+
txHash
|
|
213
|
+
} = await onNode.postTransaction({
|
|
214
|
+
tx
|
|
215
|
+
}, __queue != null ? {
|
|
216
|
+
requestOptions: {
|
|
217
|
+
customHeaders: {
|
|
218
|
+
__queue
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
} : {});
|
|
222
|
+
|
|
223
|
+
if (waitMined) {
|
|
224
|
+
const pollResult = await poll(txHash, {
|
|
225
|
+
onNode,
|
|
226
|
+
...options
|
|
227
|
+
});
|
|
228
|
+
const txData = { ...pollResult,
|
|
229
|
+
hash: pollResult.hash,
|
|
230
|
+
rawTx: tx
|
|
231
|
+
}; // wait for transaction confirmation
|
|
232
|
+
|
|
233
|
+
if (confirm != null && (confirm === true || confirm > 0)) {
|
|
234
|
+
const c = typeof confirm === 'boolean' ? undefined : confirm;
|
|
235
|
+
return { ...txData,
|
|
236
|
+
confirmationHeight: await waitForTxConfirm(txHash, {
|
|
237
|
+
onNode,
|
|
238
|
+
confirm: c,
|
|
239
|
+
...options
|
|
240
|
+
})
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return txData;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return {
|
|
248
|
+
hash: txHash,
|
|
249
|
+
rawTx: tx
|
|
250
|
+
};
|
|
251
|
+
} catch (error) {
|
|
252
|
+
throw Object.assign(error, {
|
|
253
|
+
rawTx: tx,
|
|
254
|
+
verifyTx: async () => verifyTransaction(tx, onNode)
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Get account by account public key
|
|
261
|
+
* @category chain
|
|
262
|
+
* @param address - Account address (public key)
|
|
263
|
+
* @param options - Options
|
|
264
|
+
* @param options.height - Get account on specific block by block height
|
|
265
|
+
* @param options.hash - Get account on specific block by micro block hash or key block hash
|
|
266
|
+
* @param options.onNode - Node to use
|
|
267
|
+
*/
|
|
268
|
+
export async function getAccount(address, _ref7) {
|
|
269
|
+
let {
|
|
270
|
+
height,
|
|
271
|
+
hash,
|
|
272
|
+
onNode
|
|
273
|
+
} = _ref7;
|
|
274
|
+
if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);
|
|
275
|
+
if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);
|
|
276
|
+
return onNode.getAccountByPubkey(address);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Request the balance of specified account
|
|
280
|
+
* @category chain
|
|
281
|
+
* @param address - The public account address to obtain the balance for
|
|
282
|
+
* @param options - Options
|
|
283
|
+
* @param options.format
|
|
284
|
+
* @param options.height - The chain height at which to obtain the balance for
|
|
285
|
+
* (default: top of chain)
|
|
286
|
+
* @param options.hash - The block hash on which to obtain the balance for (default: top of chain)
|
|
287
|
+
*/
|
|
288
|
+
|
|
289
|
+
export async function getBalance(address, _ref8) {
|
|
290
|
+
let {
|
|
291
|
+
format = AE_AMOUNT_FORMATS.AETTOS,
|
|
292
|
+
...options
|
|
293
|
+
} = _ref8;
|
|
294
|
+
const {
|
|
295
|
+
balance
|
|
296
|
+
} = await getAccount(address, options).catch(() => ({
|
|
297
|
+
balance: 0n
|
|
298
|
+
}));
|
|
299
|
+
return formatAmount(balance, {
|
|
300
|
+
targetDenomination: format
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Obtain current generation
|
|
305
|
+
* @category chain
|
|
306
|
+
* @param options - Options
|
|
307
|
+
* @param options.onNode - Node to use
|
|
308
|
+
* @returns Current Generation
|
|
309
|
+
*/
|
|
310
|
+
|
|
311
|
+
export async function getCurrentGeneration(_ref9) {
|
|
312
|
+
let {
|
|
313
|
+
onNode
|
|
314
|
+
} = _ref9;
|
|
315
|
+
return onNode.getCurrentGeneration();
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Get generation by hash or height
|
|
319
|
+
* @category chain
|
|
320
|
+
* @param hashOrHeight - Generation hash or height
|
|
321
|
+
* @param options - Options
|
|
322
|
+
* @param options.onNode - Node to use
|
|
323
|
+
* @returns Generation
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
export async function getGeneration(hashOrHeight, _ref10) {
|
|
327
|
+
let {
|
|
328
|
+
onNode
|
|
329
|
+
} = _ref10;
|
|
330
|
+
if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);
|
|
331
|
+
return onNode.getGenerationByHash(hashOrHeight);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get micro block transactions
|
|
335
|
+
* @category chain
|
|
336
|
+
* @param hash - Micro block hash
|
|
337
|
+
* @param options - Options
|
|
338
|
+
* @param options.onNode - Node to use
|
|
339
|
+
* @returns Transactions
|
|
340
|
+
*/
|
|
341
|
+
|
|
342
|
+
export async function getMicroBlockTransactions(hash, _ref11) {
|
|
343
|
+
let {
|
|
344
|
+
onNode
|
|
345
|
+
} = _ref11;
|
|
346
|
+
return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Get key block
|
|
350
|
+
* @category chain
|
|
351
|
+
* @param hashOrHeight - Key block hash or height
|
|
352
|
+
* @param options - Options
|
|
353
|
+
* @param options.onNode - Node to use
|
|
354
|
+
* @returns Key Block
|
|
355
|
+
*/
|
|
356
|
+
|
|
357
|
+
export async function getKeyBlock(hashOrHeight, _ref12) {
|
|
358
|
+
let {
|
|
359
|
+
onNode
|
|
360
|
+
} = _ref12;
|
|
361
|
+
if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);
|
|
362
|
+
return onNode.getKeyBlockByHash(hashOrHeight);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Get micro block header
|
|
366
|
+
* @category chain
|
|
367
|
+
* @param hash - Micro block hash
|
|
368
|
+
* @param options - Options
|
|
369
|
+
* @param options.onNode - Node to use
|
|
370
|
+
* @returns Micro block header
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
export async function getMicroBlockHeader(hash, _ref13) {
|
|
374
|
+
let {
|
|
375
|
+
onNode
|
|
376
|
+
} = _ref13;
|
|
377
|
+
return onNode.getMicroBlockHeaderByHash(hash);
|
|
378
|
+
}
|
|
379
|
+
const txDryRunRequests = new Map();
|
|
380
|
+
|
|
381
|
+
async function txDryRunHandler(key, onNode) {
|
|
382
|
+
const rs = txDryRunRequests.get(key);
|
|
383
|
+
txDryRunRequests.delete(key);
|
|
384
|
+
if (rs == null) throw new InternalError('Can\'t get dry-run request');
|
|
385
|
+
let dryRunRes;
|
|
386
|
+
|
|
387
|
+
try {
|
|
388
|
+
dryRunRes = await onNode.protectedDryRunTxs({
|
|
389
|
+
top: rs[0].top,
|
|
390
|
+
txEvents: rs[0].txEvents,
|
|
391
|
+
txs: rs.map(req => ({
|
|
392
|
+
tx: req.tx
|
|
393
|
+
})),
|
|
394
|
+
accounts: Array.from(new Set(rs.map(req => req.accountAddress))).map(pubKey => ({
|
|
395
|
+
pubKey,
|
|
396
|
+
amount: DRY_RUN_ACCOUNT.amount
|
|
397
|
+
}))
|
|
398
|
+
});
|
|
399
|
+
} catch (error) {
|
|
400
|
+
rs.forEach(_ref14 => {
|
|
401
|
+
let {
|
|
402
|
+
reject
|
|
403
|
+
} = _ref14;
|
|
404
|
+
return reject(error);
|
|
405
|
+
});
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const {
|
|
410
|
+
results,
|
|
411
|
+
txEvents
|
|
412
|
+
} = dryRunRes;
|
|
413
|
+
results.forEach((_ref15, idx) => {
|
|
414
|
+
let {
|
|
415
|
+
result,
|
|
416
|
+
reason,
|
|
417
|
+
...resultPayload
|
|
418
|
+
} = _ref15;
|
|
419
|
+
const {
|
|
420
|
+
resolve,
|
|
421
|
+
reject,
|
|
422
|
+
tx,
|
|
423
|
+
accountAddress
|
|
424
|
+
} = rs[idx];
|
|
425
|
+
if (result === 'ok') resolve({ ...resultPayload,
|
|
426
|
+
txEvents
|
|
427
|
+
});else reject(Object.assign(new DryRunError(reason), {
|
|
428
|
+
tx,
|
|
429
|
+
accountAddress
|
|
430
|
+
}));
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Transaction dry-run
|
|
435
|
+
* @category chain
|
|
436
|
+
* @param tx - transaction to execute
|
|
437
|
+
* @param accountAddress - address that will be used to execute transaction
|
|
438
|
+
* @param options - Options
|
|
439
|
+
* @param options.top - hash of block on which to make dry-run
|
|
440
|
+
* @param options.txEvents - collect and return on-chain tx events that would result from the call
|
|
441
|
+
* @param options.combine - Enables combining of similar requests to a single dry-run call
|
|
442
|
+
* @param options.onNode - Node to use
|
|
443
|
+
*/
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
export async function txDryRun(tx, accountAddress, _ref16) {
|
|
447
|
+
var _txDryRunRequests$get;
|
|
448
|
+
|
|
449
|
+
let {
|
|
450
|
+
top,
|
|
451
|
+
txEvents,
|
|
452
|
+
combine,
|
|
453
|
+
onNode
|
|
454
|
+
} = _ref16;
|
|
455
|
+
const key = combine === true ? [top, txEvents].join() : 'immediate';
|
|
456
|
+
const requests = (_txDryRunRequests$get = txDryRunRequests.get(key)) !== null && _txDryRunRequests$get !== void 0 ? _txDryRunRequests$get : [];
|
|
457
|
+
txDryRunRequests.set(key, requests);
|
|
458
|
+
return new Promise((resolve, reject) => {
|
|
459
|
+
var _requests$timeout;
|
|
460
|
+
|
|
461
|
+
requests.push({
|
|
462
|
+
tx,
|
|
463
|
+
accountAddress,
|
|
464
|
+
top,
|
|
465
|
+
txEvents,
|
|
466
|
+
resolve,
|
|
467
|
+
reject
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
if (combine !== true) {
|
|
471
|
+
void txDryRunHandler(key, onNode);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
(_requests$timeout = requests.timeout) !== null && _requests$timeout !== void 0 ? _requests$timeout : requests.timeout = setTimeout(() => {
|
|
476
|
+
void txDryRunHandler(key, onNode);
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Get contract byte code
|
|
482
|
+
* @category contract
|
|
483
|
+
* @param contractId - Contract address
|
|
484
|
+
* @param options - Options
|
|
485
|
+
* @param options.onNode - Node to use
|
|
486
|
+
*/
|
|
487
|
+
|
|
488
|
+
export async function getContractByteCode(contractId, _ref17) {
|
|
489
|
+
let {
|
|
490
|
+
onNode
|
|
491
|
+
} = _ref17;
|
|
492
|
+
return onNode.getContractCode(contractId);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Get contract entry
|
|
496
|
+
* @category contract
|
|
497
|
+
* @param contractId - Contract address
|
|
498
|
+
* @param options - Options
|
|
499
|
+
* @param options.onNode - Node to use
|
|
500
|
+
*/
|
|
501
|
+
|
|
502
|
+
export async function getContract(contractId, _ref18) {
|
|
503
|
+
let {
|
|
504
|
+
onNode
|
|
505
|
+
} = _ref18;
|
|
506
|
+
return onNode.getContract(contractId);
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Get name entry
|
|
510
|
+
* @category AENS
|
|
511
|
+
* @param name - AENS name
|
|
512
|
+
* @param options - Options
|
|
513
|
+
* @param options.onNode - Node to use
|
|
514
|
+
*/
|
|
515
|
+
|
|
516
|
+
export async function getName(name, _ref19) {
|
|
517
|
+
let {
|
|
518
|
+
onNode
|
|
519
|
+
} = _ref19;
|
|
520
|
+
return onNode.getNameEntryByName(name);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Resolve AENS name and return name hash
|
|
524
|
+
* @category AENS
|
|
525
|
+
* @param nameOrId - AENS name or address
|
|
526
|
+
* @param key - in AENS pointers record
|
|
527
|
+
* @param options - Options
|
|
528
|
+
* @param options.verify - To ensure that name exist and have a corresponding pointer
|
|
529
|
+
* // TODO: avoid that to don't trust to current api gateway
|
|
530
|
+
* @param options.resolveByNode - Enables pointer resolving using node
|
|
531
|
+
* @param options.onNode - Node to use
|
|
532
|
+
* @returns Address or AENS name hash
|
|
533
|
+
*/
|
|
534
|
+
|
|
535
|
+
export async function resolveName(nameOrId, key, _ref20) {
|
|
536
|
+
let {
|
|
537
|
+
verify = true,
|
|
538
|
+
resolveByNode = false,
|
|
539
|
+
onNode
|
|
540
|
+
} = _ref20;
|
|
541
|
+
|
|
542
|
+
if (isNameValid(nameOrId)) {
|
|
543
|
+
if (verify || resolveByNode) {
|
|
544
|
+
const name = await onNode.getNameEntryByName(nameOrId);
|
|
545
|
+
const pointer = name.pointers.find(p => p.key === key);
|
|
546
|
+
if (pointer == null) throw new AensPointerContextError(nameOrId, key);
|
|
547
|
+
if (resolveByNode) return pointer.id;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return produceNameId(nameOrId);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
try {
|
|
554
|
+
decode(nameOrId);
|
|
555
|
+
return nameOrId;
|
|
556
|
+
} catch (error) {
|
|
557
|
+
throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
//# sourceMappingURL=chain.mjs.map
|
package/es/chain.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.mjs","names":["AE_AMOUNT_FORMATS","formatAmount","verifyTransaction","pause","isNameValid","produceNameId","DRY_RUN_ACCOUNT","AensPointerContextError","DryRunError","InvalidAensNameError","TransactionError","TxTimedOutError","TxNotInChainError","InternalError","decode","_getPollInterval","type","_expectedMineRate","_microBlockCycle","_maxPollInterval","base","block","microblock","Math","min","InvalidTxError","constructor","message","validation","transaction","name","getHeight","onNode","getCurrentKeyBlockHeight","height","poll","th","blocks","interval","options","max","tx","getTransactionByHash","blockHeight","awaitHeight","currentHeight","waitForTxConfirm","txHash","confirm","newBlockHeight","sendTransaction","onAccount","verify","waitMined","length","map","v","join","__queue","address","error","postTransaction","requestOptions","customHeaders","pollResult","txData","hash","rawTx","c","undefined","confirmationHeight","Object","assign","verifyTx","getAccount","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getAccountByPubkey","getBalance","format","AETTOS","balance","catch","targetDenomination","getCurrentGeneration","getGeneration","hashOrHeight","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","getMicroBlockTransactionsByHash","transactions","getKeyBlock","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","key","rs","get","delete","dryRunRes","protectedDryRunTxs","top","txEvents","txs","req","accounts","Array","from","Set","accountAddress","pubKey","amount","forEach","reject","results","idx","result","reason","resultPayload","resolve","txDryRun","combine","requests","set","Promise","push","timeout","setTimeout","getContractByteCode","contractId","getContractCode","getContract","getName","getNameEntryByName","resolveName","nameOrId","resolveByNode","pointer","pointers","find","p","id"],"sources":["../src/chain.ts"],"sourcesContent":["/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport { decode, Encoded, Encoding } from './utils/encoder';\nimport AccountBase from './account/Base';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 10, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Submit a signed transaction for mining\n * @category chain\n * @param tx - Transaction to submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before sending\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n tx: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${await onAccount.address(options)}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount?: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>;\ninterface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const { balance } = await getAccount(address, options).catch(() => ({ balance: 0n }));\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n dryRunRes = await onNode.protectedDryRunTxs({\n top: rs[0].top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: number; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SACSA,iB,EAAmBC,Y;OACrBC,iB;SACEC,K;SACAC,W,EAAaC,a;SACbC,e;SAGPC,uB,EAAyBC,W,EAAaC,oB,EAAsBC,gB,EAC5DC,e,EAAiBC,iB,EAAmBC,a;SAO7BC,M;;AAGT;AACA;AACA;AACA,OAAO,SAASC,gBAAT,CACLC,IADK,QAIG;EAAA,IAFR;IAAEC,iBAAiB,GAAG,MAAtB;IAA8BC,gBAAgB,GAAG,IAAjD;IAAuDC,gBAAgB,GAAG;EAA1E,CAEQ;EACR,MAAMC,IAAI,GAAG;IACXC,KAAK,EAAEJ,iBADI;I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,GAAGhH,IAAI,CAACiH,QAAL,CAAcC,IAAd,CAAoBC,CAAD,IAAOA,CAAC,CAAC7C,GAAF,KAAUA,GAApC,CAAhB;MACA,IAAI0C,OAAO,IAAI,IAAf,EAAqB,MAAM,IAAIvI,uBAAJ,CAA4BqI,QAA5B,EAAsCxC,GAAtC,CAAN;MACrB,IAAIyC,aAAJ,EAAmB,OAAOC,OAAO,CAACI,EAAf;IACpB;;IACD,OAAO7I,aAAa,CAACuI,QAAD,CAApB;EACD;;EACD,IAAI;IACF9H,MAAM,CAAC8H,QAAD,CAAN;IACA,OAAOA,QAAP;EACD,CAHD,CAGE,OAAOhF,KAAP,EAAc;IACd,MAAM,IAAInD,oBAAJ,CAA0B,4BAA2BmI,QAAS,EAA9D,CAAN;EACD;AACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChannelState, ChannelMessage, ChannelFsm, SignTx } from './internal';
|
|
2
|
+
import { Encoded } from '../utils/encoder';
|
|
3
|
+
import type Channel from '.';
|
|
4
|
+
export declare function appendSignature(tx: Encoded.Transaction, signFn: SignTx): Promise<Encoded.Transaction | number | null>;
|
|
5
|
+
export declare function awaitingConnection(channel: Channel, message: ChannelMessage): ChannelFsm | undefined;
|
|
6
|
+
export declare function awaitingReconnection(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm>;
|
|
7
|
+
export declare function awaitingChannelCreateTx(channel: Channel, message: ChannelMessage): Promise<ChannelFsm | undefined>;
|
|
8
|
+
export declare function awaitingOnChainTx(channel: Channel, message: ChannelMessage): ChannelFsm | undefined;
|
|
9
|
+
export declare function awaitingBlockInclusion(channel: Channel, message: ChannelMessage): ChannelFsm | undefined;
|
|
10
|
+
export declare function awaitingOpenConfirmation(channel: Channel, message: ChannelMessage): ChannelFsm | undefined;
|
|
11
|
+
export declare function awaitingInitialState(channel: Channel, message: ChannelMessage): ChannelFsm | undefined;
|
|
12
|
+
export declare function channelOpen(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
13
|
+
export declare namespace channelOpen {
|
|
14
|
+
var enter: (channel: Channel) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function awaitingOffChainTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm>;
|
|
17
|
+
export declare function awaitingOffChainUpdate(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm | undefined;
|
|
18
|
+
export declare function awaitingTxSignRequest(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
19
|
+
export declare function awaitingUpdateConflict(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
20
|
+
export declare function awaitingShutdownTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
21
|
+
export declare function awaitingShutdownOnChainTx(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
22
|
+
export declare function awaitingLeave(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
23
|
+
export declare function awaitingWithdrawTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
24
|
+
export declare function awaitingWithdrawCompletion(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
25
|
+
export declare function awaitingDepositTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
26
|
+
export declare function awaitingDepositCompletion(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
27
|
+
export declare function awaitingNewContractTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
28
|
+
export declare function awaitingNewContractCompletion(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
29
|
+
export declare function awaitingCallContractUpdateTx(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
30
|
+
export declare function awaitingCallContractForceProgressUpdate(channel: Channel, message: ChannelMessage, state: ChannelState): Promise<ChannelFsm | undefined>;
|
|
31
|
+
export declare function awaitingForceProgressCompletion(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
32
|
+
export declare function awaitingCallContractCompletion(channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
33
|
+
export declare function awaitingCallsPruned(_channels: Channel[], message: ChannelMessage, state: ChannelState): ChannelFsm;
|
|
34
|
+
export declare function channelClosed(_channel: Channel, message: ChannelMessage, state: ChannelState): ChannelFsm;
|