@aeternity/aepp-sdk 13.3.3 → 14.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/README.md +15 -21
- package/bin/aesophia_cli +0 -0
- package/dist/aepp-sdk.browser-script.cjs +3 -0
- package/dist/aepp-sdk.browser-script.cjs.LICENSE.txt +12 -0
- package/dist/aepp-sdk.browser-script.cjs.map +1 -0
- package/dist/aepp-sdk.browser.cjs +3 -0
- package/dist/aepp-sdk.browser.cjs.map +1 -0
- package/dist/aepp-sdk.cjs +38244 -0
- package/dist/aepp-sdk.cjs.map +1 -0
- package/es/AeSdk.d.ts +4 -4
- package/es/AeSdk.js +76 -0
- package/es/AeSdk.js.map +1 -0
- package/es/AeSdkAepp.d.ts +13 -8
- package/es/AeSdkAepp.js +153 -0
- package/es/AeSdkAepp.js.map +1 -0
- package/es/AeSdkBase.d.ts +15 -41
- package/es/AeSdkBase.js +235 -0
- package/es/AeSdkBase.js.map +1 -0
- package/es/AeSdkMethods.d.ts +11 -34
- package/es/AeSdkMethods.js +81 -0
- package/es/AeSdkMethods.js.map +1 -0
- package/es/AeSdkWallet.d.ts +13 -8
- package/es/AeSdkWallet.js +347 -0
- package/es/AeSdkWallet.js.map +1 -0
- package/es/Middleware.d.ts +14 -26
- package/es/Middleware.js +102 -0
- package/es/Middleware.js.map +1 -0
- package/es/MiddlewareSubscriber.d.ts +5 -3
- package/es/MiddlewareSubscriber.js +169 -0
- package/es/MiddlewareSubscriber.js.map +1 -0
- package/es/Node.d.ts +11 -22
- package/es/Node.js +121 -0
- package/es/Node.js.map +1 -0
- package/es/account/Base.d.ts +14 -66
- package/es/account/Base.js +7 -0
- package/es/account/Base.js.map +1 -0
- package/es/account/BaseFactory.d.ts +20 -0
- package/es/account/BaseFactory.js +29 -0
- package/es/account/BaseFactory.js.map +1 -0
- package/es/account/Generalized.d.ts +7 -6
- package/es/account/Generalized.js +117 -0
- package/es/account/Generalized.js.map +1 -0
- package/es/account/Ledger.d.ts +8 -7
- package/es/account/Ledger.js +116 -0
- package/es/account/Ledger.js.map +1 -0
- package/es/account/LedgerFactory.d.ts +18 -16
- package/es/account/LedgerFactory.js +86 -0
- package/es/account/LedgerFactory.js.map +1 -0
- package/es/account/Memory.d.ts +11 -22
- package/es/account/Memory.js +106 -0
- package/es/account/Memory.js.map +1 -0
- package/es/account/Metamask.d.ts +34 -0
- package/es/account/Metamask.js +89 -0
- package/es/account/Metamask.js.map +1 -0
- package/es/account/MetamaskFactory.d.ts +58 -0
- package/es/account/MetamaskFactory.js +164 -0
- package/es/account/MetamaskFactory.js.map +1 -0
- package/es/account/MnemonicFactory.d.ts +45 -0
- package/es/account/MnemonicFactory.js +112 -0
- package/es/account/MnemonicFactory.js.map +1 -0
- package/es/account/Rpc.d.ts +10 -19
- package/es/account/Rpc.js +94 -0
- package/es/account/Rpc.js.map +1 -0
- package/es/aens.d.ts +144 -165
- package/es/aens.js +292 -0
- package/es/aens.js.map +1 -0
- package/es/aepp-wallet-communication/WalletConnectorFrame.d.ts +25 -0
- package/es/aepp-wallet-communication/WalletConnectorFrame.js +39 -0
- package/es/aepp-wallet-communication/WalletConnectorFrame.js.map +1 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameBase.d.ts +43 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameBase.js +110 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameBase.js.map +1 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameWithNode.d.ts +27 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameWithNode.js +43 -0
- package/es/aepp-wallet-communication/WalletConnectorFrameWithNode.js.map +1 -0
- package/es/aepp-wallet-communication/connection/Browser.js +53 -0
- package/es/aepp-wallet-communication/connection/Browser.js.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +2 -2
- package/es/aepp-wallet-communication/connection/BrowserRuntime.js +54 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.js.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +2 -2
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.js +90 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.js.map +1 -0
- package/es/aepp-wallet-communication/connection-proxy.d.ts +2 -2
- package/es/aepp-wallet-communication/connection-proxy.js +17 -0
- package/es/aepp-wallet-communication/connection-proxy.js.map +1 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.js +119 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.js.map +1 -0
- package/es/aepp-wallet-communication/rpc/types.d.ts +13 -19
- package/es/aepp-wallet-communication/rpc/types.js +3 -0
- package/es/aepp-wallet-communication/rpc/types.js.map +1 -0
- package/es/aepp-wallet-communication/schema.d.ts +10 -3
- package/es/aepp-wallet-communication/schema.js +202 -0
- package/es/aepp-wallet-communication/schema.js.map +1 -0
- package/es/aepp-wallet-communication/wallet-detector.d.ts +4 -4
- package/es/aepp-wallet-communication/wallet-detector.js +44 -0
- package/es/aepp-wallet-communication/wallet-detector.js.map +1 -0
- package/es/apis/compiler/compiler.d.ts +2 -2
- package/es/apis/compiler/compiler.js +513 -0
- package/es/apis/compiler/compiler.js.map +1 -0
- package/es/apis/compiler/index.d.ts +2 -2
- package/es/apis/compiler/index.js +3 -0
- package/es/apis/compiler/index.js.map +1 -0
- package/es/apis/compiler/models/index.js +2 -0
- package/es/apis/compiler/models/index.js.map +1 -0
- package/es/apis/compiler/models/mappers.js +554 -0
- package/es/apis/compiler/models/mappers.js.map +1 -0
- package/es/apis/compiler/models/parameters.js +67 -0
- package/es/apis/compiler/models/parameters.js.map +1 -0
- package/es/apis/middleware/index.d.ts +2 -2
- package/es/apis/middleware/index.js +3 -0
- package/es/apis/middleware/index.js.map +1 -0
- package/es/apis/middleware/middleware.d.ts +222 -124
- package/es/apis/middleware/middleware.js +2146 -0
- package/es/apis/middleware/middleware.js.map +1 -0
- package/es/apis/middleware/models/index.d.ts +2062 -1198
- package/es/apis/middleware/models/index.js +2 -0
- package/es/apis/middleware/models/index.js.map +1 -0
- package/es/apis/middleware/models/mappers.d.ts +206 -81
- package/es/apis/middleware/models/mappers.js +9315 -0
- package/es/apis/middleware/models/mappers.js.map +1 -0
- package/es/apis/middleware/models/parameters.d.ts +78 -13
- package/es/apis/middleware/models/parameters.js +1164 -0
- package/es/apis/middleware/models/parameters.js.map +1 -0
- package/es/apis/node/index.d.ts +2 -2
- package/es/apis/node/index.js +3 -0
- package/es/apis/node/index.js.map +1 -0
- package/es/apis/node/models/index.d.ts +683 -631
- package/es/apis/node/models/index.js +2 -0
- package/es/apis/node/models/index.js.map +1 -0
- package/es/apis/node/models/mappers.d.ts +58 -55
- package/es/apis/node/models/mappers.js +5450 -0
- package/es/apis/node/models/mappers.js.map +1 -0
- package/es/apis/node/models/parameters.d.ts +5 -5
- package/es/apis/node/models/parameters.js +165 -0
- package/es/apis/node/models/parameters.js.map +1 -0
- package/es/apis/node/node.d.ts +113 -96
- package/es/apis/node/node.js +1292 -0
- package/es/apis/node/node.js.map +1 -0
- package/es/chain.d.ts +39 -26
- package/es/chain.js +448 -0
- package/es/chain.js.map +1 -0
- package/es/channel/Base.d.ts +12 -14
- package/es/channel/Base.js +246 -0
- package/es/channel/Base.js.map +1 -0
- package/es/channel/Contract.d.ts +12 -9
- package/es/channel/Contract.js +385 -0
- package/es/channel/Contract.js.map +1 -0
- package/es/channel/Spend.d.ts +10 -10
- package/es/channel/Spend.js +357 -0
- package/es/channel/Spend.js.map +1 -0
- package/es/channel/handlers.d.ts +4 -3
- package/es/channel/handlers.js +394 -0
- package/es/channel/handlers.js.map +1 -0
- package/es/channel/internal.d.ts +11 -10
- package/es/channel/internal.js +224 -0
- package/es/channel/internal.js.map +1 -0
- package/es/contract/Contract.d.ts +30 -21
- package/es/contract/Contract.js +535 -0
- package/es/contract/Contract.js.map +1 -0
- package/es/contract/compiler/Base.d.ts +2 -1
- package/es/contract/compiler/Base.js +6 -0
- package/es/contract/compiler/Base.js.map +1 -0
- package/es/contract/compiler/Cli.d.ts +4 -3
- package/es/contract/compiler/Cli.js +169 -0
- package/es/contract/compiler/Cli.js.map +1 -0
- package/es/contract/compiler/Http.d.ts +5 -4
- package/es/contract/compiler/Http.js +125 -0
- package/es/contract/compiler/Http.js.map +1 -0
- package/es/contract/compiler/HttpNode.d.ts +3 -3
- package/es/contract/compiler/HttpNode.js +29 -0
- package/es/contract/compiler/HttpNode.js.map +1 -0
- package/es/contract/compiler/getFileSystem.d.ts +1 -0
- package/es/contract/compiler/getFileSystem.js +33 -0
- package/es/contract/compiler/getFileSystem.js.map +1 -0
- package/es/contract/ga.d.ts +11 -15
- package/es/contract/ga.js +136 -0
- package/es/contract/ga.js.map +1 -0
- package/es/index-browser.d.ts +86 -51
- package/es/index-browser.js +85 -0
- package/es/index-browser.js.map +1 -0
- package/es/index.d.ts +4 -5
- package/es/index.js +5 -0
- package/es/index.js.map +1 -0
- package/es/oracle/Oracle.d.ts +79 -0
- package/es/oracle/Oracle.js +183 -0
- package/es/oracle/Oracle.js.map +1 -0
- package/es/oracle/OracleBase.d.ts +54 -0
- package/es/oracle/OracleBase.js +74 -0
- package/es/oracle/OracleBase.js.map +1 -0
- package/es/oracle/OracleClient.d.ts +60 -0
- package/es/oracle/OracleClient.js +105 -0
- package/es/oracle/OracleClient.js.map +1 -0
- package/es/send-transaction.d.ts +8 -8
- package/es/send-transaction.js +110 -0
- package/es/send-transaction.js.map +1 -0
- package/es/spend.d.ts +8 -13
- package/es/spend.js +93 -0
- package/es/spend.js.map +1 -0
- package/es/tx/builder/SchemaTypes.d.ts +3 -3
- package/es/tx/builder/SchemaTypes.js +2 -0
- package/es/tx/builder/SchemaTypes.js.map +1 -0
- package/es/tx/builder/common.d.ts +2 -2
- package/es/tx/builder/common.js +41 -0
- package/es/tx/builder/common.js.map +1 -0
- package/es/tx/builder/constants.d.ts +53 -27
- package/es/tx/builder/constants.js +170 -0
- package/es/tx/builder/constants.js.map +1 -0
- package/es/tx/builder/delegation/index.d.ts +3 -3
- package/es/tx/builder/delegation/index.js +24 -0
- package/es/tx/builder/delegation/index.js.map +1 -0
- package/es/tx/builder/delegation/schema.d.ts +21 -4
- package/es/tx/builder/delegation/schema.generated.d.ts +2 -2
- package/es/tx/builder/delegation/schema.generated.js +2 -0
- package/es/tx/builder/delegation/schema.generated.js.map +1 -0
- package/es/tx/builder/delegation/schema.js +83 -0
- package/es/tx/builder/delegation/schema.js.map +1 -0
- package/es/tx/builder/entry/constants.d.ts +35 -0
- package/es/tx/builder/entry/constants.js +45 -0
- package/es/tx/builder/entry/constants.js.map +1 -0
- package/es/tx/builder/entry/index.d.ts +38 -0
- package/es/tx/builder/entry/index.js +36 -0
- package/es/tx/builder/entry/index.js.map +1 -0
- package/es/tx/builder/entry/schema.d.ts +1030 -0
- package/es/tx/builder/entry/schema.generated.d.ts +607 -0
- package/es/tx/builder/entry/schema.generated.js +2 -0
- package/es/tx/builder/entry/schema.generated.js.map +1 -0
- package/es/tx/builder/entry/schema.js +204 -0
- package/es/tx/builder/entry/schema.js.map +1 -0
- package/es/tx/builder/field-types/abi-version.d.ts +4 -5
- package/es/tx/builder/field-types/abi-version.js +34 -0
- package/es/tx/builder/field-types/abi-version.js.map +1 -0
- package/es/tx/builder/field-types/address.d.ts +2 -3
- package/es/tx/builder/field-types/address.js +46 -0
- package/es/tx/builder/field-types/address.js.map +1 -0
- package/es/tx/builder/field-types/array.js +11 -0
- package/es/tx/builder/field-types/array.js.map +1 -0
- package/es/tx/builder/field-types/boolean.d.ts +0 -1
- package/es/tx/builder/field-types/boolean.js +10 -0
- package/es/tx/builder/field-types/boolean.js.map +1 -0
- package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/es/tx/builder/field-types/coin-amount.js +18 -0
- package/es/tx/builder/field-types/coin-amount.js.map +1 -0
- package/es/tx/builder/field-types/ct-version.d.ts +4 -19
- package/es/tx/builder/field-types/ct-version.js +57 -0
- package/es/tx/builder/field-types/ct-version.js.map +1 -0
- package/es/tx/builder/field-types/encoded.d.ts +1 -2
- package/es/tx/builder/field-types/encoded.js +18 -0
- package/es/tx/builder/field-types/encoded.js.map +1 -0
- package/es/tx/builder/field-types/entry.d.ts +5 -6
- package/es/tx/builder/field-types/entry.js +26 -0
- package/es/tx/builder/field-types/entry.js.map +1 -0
- package/es/tx/builder/field-types/enumeration.d.ts +0 -1
- package/es/tx/builder/field-types/enumeration.js +27 -0
- package/es/tx/builder/field-types/enumeration.js.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +8 -9
- package/es/tx/builder/field-types/fee.js +160 -0
- package/es/tx/builder/field-types/fee.js.map +1 -0
- package/es/tx/builder/field-types/field.d.ts +0 -1
- package/es/tx/builder/field-types/field.js +10 -0
- package/es/tx/builder/field-types/field.js.map +1 -0
- package/es/tx/builder/field-types/gas-limit.d.ts +4 -5
- package/es/tx/builder/field-types/gas-limit.js +31 -0
- package/es/tx/builder/field-types/gas-limit.js.map +1 -0
- package/es/tx/builder/field-types/gas-price.d.ts +10 -8
- package/es/tx/builder/field-types/gas-price.js +53 -0
- package/es/tx/builder/field-types/gas-price.js.map +1 -0
- package/es/tx/builder/field-types/interface.d.ts +7 -0
- package/es/tx/builder/field-types/interface.js +2 -0
- package/es/tx/builder/field-types/interface.js.map +1 -0
- package/es/tx/builder/field-types/map.d.ts +6 -7
- package/es/tx/builder/field-types/map.js +38 -0
- package/es/tx/builder/field-types/map.js.map +1 -0
- package/es/tx/builder/field-types/mptree.d.ts +12 -13
- package/es/tx/builder/field-types/mptree.js +223 -0
- package/es/tx/builder/field-types/mptree.js.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +3 -4
- package/es/tx/builder/field-types/name-fee.js +22 -0
- package/es/tx/builder/field-types/name-fee.js.map +1 -0
- package/es/tx/builder/field-types/name-id.d.ts +2 -3
- package/es/tx/builder/field-types/name-id.js +14 -0
- package/es/tx/builder/field-types/name-id.js.map +1 -0
- package/es/tx/builder/field-types/name.d.ts +1 -2
- package/es/tx/builder/field-types/name.js +16 -0
- package/es/tx/builder/field-types/name.js.map +1 -0
- package/es/tx/builder/field-types/nonce.d.ts +6 -4
- package/es/tx/builder/field-types/nonce.js +40 -0
- package/es/tx/builder/field-types/nonce.js.map +1 -0
- package/es/tx/builder/field-types/pointers.d.ts +9 -18
- package/es/tx/builder/field-types/pointers.js +69 -0
- package/es/tx/builder/field-types/pointers.js.map +1 -0
- package/es/tx/builder/field-types/query-fee.d.ts +4 -5
- package/es/tx/builder/field-types/query-fee.js +21 -0
- package/es/tx/builder/field-types/query-fee.js.map +1 -0
- package/es/tx/builder/field-types/raw.d.ts +0 -1
- package/es/tx/builder/field-types/raw.js +10 -0
- package/es/tx/builder/field-types/raw.js.map +1 -0
- package/es/tx/builder/field-types/short-u-int-const.d.ts +0 -1
- package/es/tx/builder/field-types/short-u-int-const.js +20 -0
- package/es/tx/builder/field-types/short-u-int-const.js.map +1 -0
- package/es/tx/builder/field-types/short-u-int.d.ts +0 -1
- package/es/tx/builder/field-types/short-u-int.js +10 -0
- package/es/tx/builder/field-types/short-u-int.js.map +1 -0
- package/es/tx/builder/field-types/string.d.ts +0 -1
- package/es/tx/builder/field-types/string.js +10 -0
- package/es/tx/builder/field-types/string.js.map +1 -0
- package/es/tx/builder/field-types/transaction.d.ts +10 -0
- package/es/tx/builder/field-types/transaction.js +26 -0
- package/es/tx/builder/field-types/transaction.js.map +1 -0
- package/es/tx/builder/field-types/ttl.d.ts +6 -11
- package/es/tx/builder/field-types/ttl.js +32 -0
- package/es/tx/builder/field-types/ttl.js.map +1 -0
- package/es/tx/builder/field-types/u-int.d.ts +1 -2
- package/es/tx/builder/field-types/u-int.js +13 -0
- package/es/tx/builder/field-types/u-int.js.map +1 -0
- package/es/tx/builder/field-types/with-default.js +9 -0
- package/es/tx/builder/field-types/with-default.js.map +1 -0
- package/es/tx/builder/field-types/with-formatting.js +9 -0
- package/es/tx/builder/field-types/with-formatting.js.map +1 -0
- package/es/tx/builder/field-types/wrapped.d.ts +5 -6
- package/es/tx/builder/field-types/wrapped.js +20 -0
- package/es/tx/builder/field-types/wrapped.js.map +1 -0
- package/es/tx/builder/helpers.d.ts +21 -16
- package/es/tx/builder/helpers.js +215 -0
- package/es/tx/builder/helpers.js.map +1 -0
- package/es/tx/builder/index.d.ts +4 -13
- package/es/tx/builder/index.js +91 -0
- package/es/tx/builder/index.js.map +1 -0
- package/es/tx/builder/schema.d.ts +587 -1724
- package/es/tx/builder/schema.generated.d.ts +45 -1001
- package/es/tx/builder/schema.generated.js +2 -0
- package/es/tx/builder/schema.generated.js.map +1 -0
- package/es/tx/builder/schema.js +357 -0
- package/es/tx/builder/schema.js.map +1 -0
- package/es/tx/execution-cost.d.ts +5 -2
- package/es/tx/execution-cost.js +143 -0
- package/es/tx/execution-cost.js.map +1 -0
- package/es/tx/transaction-signer.d.ts +2 -1
- package/es/tx/transaction-signer.js +25 -0
- package/es/tx/transaction-signer.js.map +1 -0
- package/es/tx/validator.d.ts +2 -2
- package/es/tx/validator.js +207 -0
- package/es/tx/validator.js.map +1 -0
- package/es/typings/blakejs/index.d.js +2 -0
- package/es/typings/blakejs/index.d.js.map +1 -0
- package/es/typings/sha-js/index.d.js +2 -0
- package/es/typings/sha-js/index.d.js.map +1 -0
- package/es/typings/tweetnacl-auth/index.d.js +2 -0
- package/es/typings/tweetnacl-auth/index.d.js.map +1 -0
- package/es/utils/MiddlewarePage.d.ts +37 -0
- package/es/utils/MiddlewarePage.js +57 -0
- package/es/utils/MiddlewarePage.js.map +1 -0
- package/es/utils/amount-formatter.d.ts +19 -5
- package/es/utils/amount-formatter.js +113 -0
- package/es/utils/amount-formatter.js.map +1 -0
- package/es/utils/autorest.d.ts +7 -2
- package/es/utils/autorest.js +212 -0
- package/es/utils/autorest.js.map +1 -0
- package/es/utils/bignumber.js +21 -0
- package/es/utils/bignumber.js.map +1 -0
- package/es/utils/bytes.d.ts +2 -1
- package/es/utils/bytes.js +32 -0
- package/es/utils/bytes.js.map +1 -0
- package/es/utils/crypto.d.ts +48 -59
- package/es/utils/crypto.js +162 -0
- package/es/utils/crypto.js.map +1 -0
- package/es/utils/encoder-types.d.ts +3 -1
- package/es/utils/encoder-types.js +36 -0
- package/es/utils/encoder-types.js.map +1 -0
- package/es/utils/encoder.d.ts +4 -3
- package/es/utils/encoder.js +106 -0
- package/es/utils/encoder.js.map +1 -0
- package/es/utils/errors.d.ts +4 -10
- package/es/utils/errors.js +746 -0
- package/es/utils/errors.js.map +1 -0
- package/es/utils/json-big.d.ts +1 -1
- package/es/utils/json-big.js +25 -0
- package/es/utils/json-big.js.map +1 -0
- package/es/utils/jwt.d.ts +2 -2
- package/es/utils/jwt.js +112 -0
- package/es/utils/jwt.js.map +1 -0
- package/es/utils/other.d.ts +4 -4
- package/es/utils/other.js +48 -0
- package/es/utils/other.js.map +1 -0
- package/es/utils/semver-satisfies.js +12 -0
- package/es/utils/semver-satisfies.js.map +1 -0
- package/es/utils/string.js +18 -0
- package/es/utils/string.js.map +1 -0
- package/es/utils/typed-data.d.ts +6 -2
- package/es/utils/typed-data.js +58 -0
- package/es/utils/typed-data.js.map +1 -0
- package/es/utils/wrap-proxy.js +15 -0
- package/es/utils/wrap-proxy.js.map +1 -0
- package/package.json +91 -113
- package/bin/aesophia_cli_8 +0 -0
- package/dist/aepp-sdk.browser-script.js +0 -3
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -12
- package/dist/aepp-sdk.browser-script.js.map +0 -1
- package/dist/aepp-sdk.browser.js +0 -3
- package/dist/aepp-sdk.browser.js.map +0 -1
- package/dist/aepp-sdk.js +0 -30486
- package/dist/aepp-sdk.js.map +0 -1
- package/es/AeSdk.mjs +0 -76
- package/es/AeSdk.mjs.map +0 -1
- package/es/AeSdkAepp.mjs +0 -145
- package/es/AeSdkAepp.mjs.map +0 -1
- package/es/AeSdkBase.mjs +0 -289
- package/es/AeSdkBase.mjs.map +0 -1
- package/es/AeSdkMethods.mjs +0 -92
- package/es/AeSdkMethods.mjs.map +0 -1
- package/es/AeSdkWallet.mjs +0 -368
- package/es/AeSdkWallet.mjs.map +0 -1
- package/es/Middleware.mjs +0 -94
- package/es/Middleware.mjs.map +0 -1
- package/es/MiddlewareSubscriber.mjs +0 -189
- package/es/MiddlewareSubscriber.mjs.map +0 -1
- package/es/Node.mjs +0 -148
- package/es/Node.mjs.map +0 -1
- package/es/account/Base.mjs +0 -134
- package/es/account/Base.mjs.map +0 -1
- package/es/account/Generalized.mjs +0 -129
- package/es/account/Generalized.mjs.map +0 -1
- package/es/account/Ledger.mjs +0 -131
- package/es/account/Ledger.mjs.map +0 -1
- package/es/account/LedgerFactory.mjs +0 -79
- package/es/account/LedgerFactory.mjs.map +0 -1
- package/es/account/Memory.mjs +0 -187
- package/es/account/Memory.mjs.map +0 -1
- package/es/account/Rpc.mjs +0 -178
- package/es/account/Rpc.mjs.map +0 -1
- package/es/aens.mjs +0 -290
- package/es/aens.mjs.map +0 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +0 -52
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +0 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -55
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +0 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -98
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +0 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +0 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +0 -134
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +0 -1
- package/es/aepp-wallet-communication/rpc/types.mjs +0 -3
- package/es/aepp-wallet-communication/rpc/types.mjs.map +0 -1
- package/es/aepp-wallet-communication/schema.mjs +0 -187
- package/es/aepp-wallet-communication/schema.mjs.map +0 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -44
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +0 -1
- package/es/apis/compiler/compiler.mjs +0 -513
- package/es/apis/compiler/compiler.mjs.map +0 -1
- package/es/apis/compiler/index.mjs +0 -3
- package/es/apis/compiler/index.mjs.map +0 -1
- package/es/apis/compiler/models/index.mjs +0 -2
- package/es/apis/compiler/models/index.mjs.map +0 -1
- package/es/apis/compiler/models/mappers.mjs +0 -554
- package/es/apis/compiler/models/mappers.mjs.map +0 -1
- package/es/apis/compiler/models/parameters.mjs +0 -67
- package/es/apis/compiler/models/parameters.mjs.map +0 -1
- package/es/apis/middleware/index.mjs +0 -3
- package/es/apis/middleware/index.mjs.map +0 -1
- package/es/apis/middleware/middleware.mjs +0 -1623
- package/es/apis/middleware/middleware.mjs.map +0 -1
- package/es/apis/middleware/models/index.mjs +0 -630
- package/es/apis/middleware/models/index.mjs.map +0 -1
- package/es/apis/middleware/models/mappers.mjs +0 -3707
- package/es/apis/middleware/models/mappers.mjs.map +0 -1
- package/es/apis/middleware/models/parameters.mjs +0 -444
- package/es/apis/middleware/models/parameters.mjs.map +0 -1
- package/es/apis/node/index.mjs +0 -3
- package/es/apis/node/index.mjs.map +0 -1
- package/es/apis/node/models/index.mjs +0 -2
- package/es/apis/node/models/index.mjs.map +0 -1
- package/es/apis/node/models/mappers.mjs +0 -4395
- package/es/apis/node/models/mappers.mjs.map +0 -1
- package/es/apis/node/models/parameters.mjs +0 -165
- package/es/apis/node/models/parameters.mjs.map +0 -1
- package/es/apis/node/node.mjs +0 -1240
- package/es/apis/node/node.mjs.map +0 -1
- package/es/chain.mjs +0 -441
- package/es/chain.mjs.map +0 -1
- package/es/channel/Base.mjs +0 -254
- package/es/channel/Base.mjs.map +0 -1
- package/es/channel/Contract.mjs +0 -383
- package/es/channel/Contract.mjs.map +0 -1
- package/es/channel/Spend.mjs +0 -357
- package/es/channel/Spend.mjs.map +0 -1
- package/es/channel/handlers.mjs +0 -383
- package/es/channel/handlers.mjs.map +0 -1
- package/es/channel/internal.mjs +0 -237
- package/es/channel/internal.mjs.map +0 -1
- package/es/contract/Contract.mjs +0 -540
- package/es/contract/Contract.mjs.map +0 -1
- package/es/contract/compiler/Base.mjs +0 -5
- package/es/contract/compiler/Base.mjs.map +0 -1
- package/es/contract/compiler/Cli.mjs +0 -197
- package/es/contract/compiler/Cli.mjs.map +0 -1
- package/es/contract/compiler/Cli8.d.ts +0 -13
- package/es/contract/compiler/Cli8.mjs +0 -22
- package/es/contract/compiler/Cli8.mjs.map +0 -1
- package/es/contract/compiler/Http.mjs +0 -126
- package/es/contract/compiler/Http.mjs.map +0 -1
- package/es/contract/compiler/HttpNode.mjs +0 -31
- package/es/contract/compiler/HttpNode.mjs.map +0 -1
- package/es/contract/compiler/getFileSystem.mjs +0 -40
- package/es/contract/compiler/getFileSystem.mjs.map +0 -1
- package/es/contract/delegation-signature.d.ts +0 -45
- package/es/contract/delegation-signature.mjs +0 -80
- package/es/contract/delegation-signature.mjs.map +0 -1
- package/es/contract/ga.mjs +0 -135
- package/es/contract/ga.mjs.map +0 -1
- package/es/deprecated.d.ts +0 -62
- package/es/deprecated.mjs +0 -87
- package/es/deprecated.mjs.map +0 -1
- package/es/index-browser.mjs +0 -49
- package/es/index-browser.mjs.map +0 -1
- package/es/index.mjs +0 -6
- package/es/index.mjs.map +0 -1
- package/es/oracle.d.ts +0 -125
- package/es/oracle.mjs +0 -242
- package/es/oracle.mjs.map +0 -1
- package/es/send-transaction.mjs +0 -109
- package/es/send-transaction.mjs.map +0 -1
- package/es/spend.mjs +0 -90
- package/es/spend.mjs.map +0 -1
- package/es/tx/builder/SchemaTypes.mjs +0 -2
- package/es/tx/builder/SchemaTypes.mjs.map +0 -1
- package/es/tx/builder/common.mjs +0 -42
- package/es/tx/builder/common.mjs.map +0 -1
- package/es/tx/builder/constants.mjs +0 -147
- package/es/tx/builder/constants.mjs.map +0 -1
- package/es/tx/builder/delegation/index.mjs +0 -24
- package/es/tx/builder/delegation/index.mjs.map +0 -1
- package/es/tx/builder/delegation/schema.generated.mjs +0 -2
- package/es/tx/builder/delegation/schema.generated.mjs.map +0 -1
- package/es/tx/builder/delegation/schema.mjs +0 -54
- package/es/tx/builder/delegation/schema.mjs.map +0 -1
- package/es/tx/builder/field-types/abi-version.mjs +0 -37
- package/es/tx/builder/field-types/abi-version.mjs.map +0 -1
- package/es/tx/builder/field-types/address.mjs +0 -48
- package/es/tx/builder/field-types/address.mjs.map +0 -1
- package/es/tx/builder/field-types/array.mjs +0 -11
- package/es/tx/builder/field-types/array.mjs.map +0 -1
- package/es/tx/builder/field-types/boolean.mjs +0 -13
- package/es/tx/builder/field-types/boolean.mjs.map +0 -1
- package/es/tx/builder/field-types/coin-amount.mjs +0 -18
- package/es/tx/builder/field-types/coin-amount.mjs.map +0 -1
- package/es/tx/builder/field-types/ct-version.mjs +0 -75
- package/es/tx/builder/field-types/ct-version.mjs.map +0 -1
- package/es/tx/builder/field-types/encoded.mjs +0 -21
- package/es/tx/builder/field-types/encoded.mjs.map +0 -1
- package/es/tx/builder/field-types/entry.mjs +0 -29
- package/es/tx/builder/field-types/entry.mjs.map +0 -1
- package/es/tx/builder/field-types/enumeration.mjs +0 -30
- package/es/tx/builder/field-types/enumeration.mjs.map +0 -1
- package/es/tx/builder/field-types/fee.mjs +0 -160
- package/es/tx/builder/field-types/fee.mjs.map +0 -1
- package/es/tx/builder/field-types/field.mjs +0 -13
- package/es/tx/builder/field-types/field.mjs.map +0 -1
- package/es/tx/builder/field-types/gas-limit.mjs +0 -31
- package/es/tx/builder/field-types/gas-limit.mjs.map +0 -1
- package/es/tx/builder/field-types/gas-price.mjs +0 -60
- package/es/tx/builder/field-types/gas-price.mjs.map +0 -1
- package/es/tx/builder/field-types/index.d.ts +0 -39
- package/es/tx/builder/field-types/index.mjs +0 -32
- package/es/tx/builder/field-types/index.mjs.map +0 -1
- package/es/tx/builder/field-types/map.mjs +0 -38
- package/es/tx/builder/field-types/map.mjs.map +0 -1
- package/es/tx/builder/field-types/mptree.mjs +0 -251
- package/es/tx/builder/field-types/mptree.mjs.map +0 -1
- package/es/tx/builder/field-types/name-fee.mjs +0 -22
- package/es/tx/builder/field-types/name-fee.mjs.map +0 -1
- package/es/tx/builder/field-types/name-id.mjs +0 -14
- package/es/tx/builder/field-types/name-id.mjs.map +0 -1
- package/es/tx/builder/field-types/name.mjs +0 -16
- package/es/tx/builder/field-types/name.mjs.map +0 -1
- package/es/tx/builder/field-types/nonce.mjs +0 -31
- package/es/tx/builder/field-types/nonce.mjs.map +0 -1
- package/es/tx/builder/field-types/pointers.mjs +0 -33
- package/es/tx/builder/field-types/pointers.mjs.map +0 -1
- package/es/tx/builder/field-types/pointers2.d.ts +0 -23
- package/es/tx/builder/field-types/pointers2.mjs +0 -65
- package/es/tx/builder/field-types/pointers2.mjs.map +0 -1
- package/es/tx/builder/field-types/query-fee.mjs +0 -20
- package/es/tx/builder/field-types/query-fee.mjs.map +0 -1
- package/es/tx/builder/field-types/raw.mjs +0 -13
- package/es/tx/builder/field-types/raw.mjs.map +0 -1
- package/es/tx/builder/field-types/short-u-int-const.mjs +0 -20
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +0 -1
- package/es/tx/builder/field-types/short-u-int.mjs +0 -10
- package/es/tx/builder/field-types/short-u-int.mjs.map +0 -1
- package/es/tx/builder/field-types/string.mjs +0 -10
- package/es/tx/builder/field-types/string.mjs.map +0 -1
- package/es/tx/builder/field-types/ttl.mjs +0 -32
- package/es/tx/builder/field-types/ttl.mjs.map +0 -1
- package/es/tx/builder/field-types/u-int.mjs +0 -13
- package/es/tx/builder/field-types/u-int.mjs.map +0 -1
- package/es/tx/builder/field-types/with-default.mjs +0 -9
- package/es/tx/builder/field-types/with-default.mjs.map +0 -1
- package/es/tx/builder/field-types/with-formatting.mjs +0 -9
- package/es/tx/builder/field-types/with-formatting.mjs.map +0 -1
- package/es/tx/builder/field-types/wrapped.mjs +0 -20
- package/es/tx/builder/field-types/wrapped.mjs.map +0 -1
- package/es/tx/builder/helpers.mjs +0 -209
- package/es/tx/builder/helpers.mjs.map +0 -1
- package/es/tx/builder/index.mjs +0 -98
- package/es/tx/builder/index.mjs.map +0 -1
- package/es/tx/builder/schema.generated.mjs +0 -2
- package/es/tx/builder/schema.generated.mjs.map +0 -1
- package/es/tx/builder/schema.mjs +0 -513
- package/es/tx/builder/schema.mjs.map +0 -1
- package/es/tx/execution-cost.mjs +0 -139
- package/es/tx/execution-cost.mjs.map +0 -1
- package/es/tx/transaction-signer.mjs +0 -24
- package/es/tx/transaction-signer.mjs.map +0 -1
- package/es/tx/validator.mjs +0 -214
- package/es/tx/validator.mjs.map +0 -1
- package/es/typings/@aeternity__uuid/index.d.mjs +0 -2
- package/es/typings/@aeternity__uuid/index.d.mjs.map +0 -1
- package/es/typings/bip32-path/index.d.mjs +0 -2
- package/es/typings/bip32-path/index.d.mjs.map +0 -1
- package/es/typings/blakejs/index.d.mjs +0 -2
- package/es/typings/blakejs/index.d.mjs.map +0 -1
- package/es/typings/sha-js/index.d.mjs +0 -2
- package/es/typings/sha-js/index.d.mjs.map +0 -1
- package/es/typings/tweetnacl-auth/index.d.mjs +0 -2
- package/es/typings/tweetnacl-auth/index.d.mjs.map +0 -1
- package/es/utils/amount-formatter.mjs +0 -97
- package/es/utils/amount-formatter.mjs.map +0 -1
- package/es/utils/autorest.mjs +0 -141
- package/es/utils/autorest.mjs.map +0 -1
- package/es/utils/bignumber.mjs +0 -21
- package/es/utils/bignumber.mjs.map +0 -1
- package/es/utils/bytes.mjs +0 -32
- package/es/utils/bytes.mjs.map +0 -1
- package/es/utils/crypto.mjs +0 -193
- package/es/utils/crypto.mjs.map +0 -1
- package/es/utils/encoder-types.mjs +0 -35
- package/es/utils/encoder-types.mjs.map +0 -1
- package/es/utils/encoder.mjs +0 -110
- package/es/utils/encoder.mjs.map +0 -1
- package/es/utils/errors.mjs +0 -756
- package/es/utils/errors.mjs.map +0 -1
- package/es/utils/hd-wallet.d.ts +0 -61
- package/es/utils/hd-wallet.mjs +0 -169
- package/es/utils/hd-wallet.mjs.map +0 -1
- package/es/utils/json-big.mjs +0 -25
- package/es/utils/json-big.mjs.map +0 -1
- package/es/utils/jwt.mjs +0 -120
- package/es/utils/jwt.mjs.map +0 -1
- package/es/utils/keystore.d.ts +0 -57
- package/es/utils/keystore.mjs +0 -140
- package/es/utils/keystore.mjs.map +0 -1
- package/es/utils/other.mjs +0 -49
- package/es/utils/other.mjs.map +0 -1
- package/es/utils/semver-satisfies.mjs +0 -12
- package/es/utils/semver-satisfies.mjs.map +0 -1
- package/es/utils/string.mjs +0 -18
- package/es/utils/string.mjs.map +0 -1
- package/es/utils/typed-data.mjs +0 -55
- package/es/utils/typed-data.mjs.map +0 -1
- package/es/utils/wrap-proxy.mjs +0 -15
- package/es/utils/wrap-proxy.mjs.map +0 -1
- package/src/AeSdk.ts +0 -75
- package/src/AeSdkAepp.ts +0 -179
- package/src/AeSdkBase.ts +0 -315
- package/src/AeSdkMethods.ts +0 -149
- package/src/AeSdkWallet.ts +0 -383
- package/src/Middleware.ts +0 -149
- package/src/MiddlewareSubscriber.ts +0 -207
- package/src/Node.ts +0 -213
- package/src/account/Base.ts +0 -224
- package/src/account/Generalized.ts +0 -113
- package/src/account/Ledger.ts +0 -161
- package/src/account/LedgerFactory.ts +0 -86
- package/src/account/Memory.ts +0 -218
- package/src/account/Rpc.ts +0 -170
- package/src/aens.ts +0 -372
- package/src/aepp-wallet-communication/connection/Browser.ts +0 -54
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -57
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -105
- package/src/aepp-wallet-communication/connection-proxy.ts +0 -19
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +0 -153
- package/src/aepp-wallet-communication/rpc/types.ts +0 -115
- package/src/aepp-wallet-communication/schema.ts +0 -212
- package/src/aepp-wallet-communication/wallet-detector.ts +0 -54
- package/src/apis/compiler/compiler.ts +0 -527
- package/src/apis/compiler/index.ts +0 -2
- package/src/apis/compiler/models/index.ts +0 -236
- package/src/apis/compiler/models/mappers.ts +0 -555
- package/src/apis/compiler/models/parameters.ts +0 -87
- package/src/apis/middleware/index.ts +0 -2
- package/src/apis/middleware/middleware.ts +0 -1928
- package/src/apis/middleware/models/index.ts +0 -1949
- package/src/apis/middleware/models/mappers.ts +0 -3808
- package/src/apis/middleware/models/parameters.ts +0 -493
- package/src/apis/node/index.ts +0 -2
- package/src/apis/node/models/index.ts +0 -1335
- package/src/apis/node/models/mappers.ts +0 -4508
- package/src/apis/node/models/parameters.ts +0 -188
- package/src/apis/node/node.ts +0 -1420
- package/src/chain.ts +0 -433
- package/src/channel/Base.ts +0 -302
- package/src/channel/Contract.ts +0 -465
- package/src/channel/Spend.ts +0 -385
- package/src/channel/handlers.ts +0 -386
- package/src/channel/internal.ts +0 -461
- package/src/contract/Contract.ts +0 -629
- package/src/contract/compiler/Base.ts +0 -123
- package/src/contract/compiler/Cli.ts +0 -173
- package/src/contract/compiler/Cli8.ts +0 -17
- package/src/contract/compiler/Http.ts +0 -134
- package/src/contract/compiler/HttpNode.ts +0 -32
- package/src/contract/compiler/getFileSystem.ts +0 -42
- package/src/contract/delegation-signature.ts +0 -88
- package/src/contract/ga.ts +0 -138
- package/src/deprecated.ts +0 -77
- package/src/index-browser.ts +0 -121
- package/src/index.ts +0 -6
- package/src/oracle.ts +0 -311
- package/src/send-transaction.ts +0 -136
- package/src/spend.ts +0 -136
- package/src/tx/builder/SchemaTypes.ts +0 -79
- package/src/tx/builder/common.ts +0 -74
- package/src/tx/builder/constants.ts +0 -155
- package/src/tx/builder/delegation/index.ts +0 -28
- package/src/tx/builder/delegation/schema.generated.ts +0 -143
- package/src/tx/builder/delegation/schema.ts +0 -61
- package/src/tx/builder/field-types/abi-version.ts +0 -44
- package/src/tx/builder/field-types/address.ts +0 -62
- package/src/tx/builder/field-types/array.ts +0 -19
- package/src/tx/builder/field-types/boolean.ts +0 -9
- package/src/tx/builder/field-types/coin-amount.ts +0 -26
- package/src/tx/builder/field-types/ct-version.ts +0 -83
- package/src/tx/builder/field-types/encoded.ts +0 -27
- package/src/tx/builder/field-types/entry.ts +0 -33
- package/src/tx/builder/field-types/enumeration.ts +0 -32
- package/src/tx/builder/field-types/fee.ts +0 -191
- package/src/tx/builder/field-types/field.ts +0 -9
- package/src/tx/builder/field-types/gas-limit.ts +0 -46
- package/src/tx/builder/field-types/gas-price.ts +0 -67
- package/src/tx/builder/field-types/index.ts +0 -40
- package/src/tx/builder/field-types/map.ts +0 -45
- package/src/tx/builder/field-types/mptree.ts +0 -243
- package/src/tx/builder/field-types/name-fee.ts +0 -32
- package/src/tx/builder/field-types/name-id.ts +0 -17
- package/src/tx/builder/field-types/name.ts +0 -18
- package/src/tx/builder/field-types/nonce.ts +0 -46
- package/src/tx/builder/field-types/pointers.ts +0 -41
- package/src/tx/builder/field-types/pointers2.ts +0 -62
- package/src/tx/builder/field-types/query-fee.ts +0 -25
- package/src/tx/builder/field-types/raw.ts +0 -9
- package/src/tx/builder/field-types/short-u-int-const.ts +0 -30
- package/src/tx/builder/field-types/short-u-int.ts +0 -11
- package/src/tx/builder/field-types/string.ts +0 -11
- package/src/tx/builder/field-types/ttl.ts +0 -34
- package/src/tx/builder/field-types/u-int.ts +0 -15
- package/src/tx/builder/field-types/with-default.ts +0 -18
- package/src/tx/builder/field-types/with-formatting.ts +0 -18
- package/src/tx/builder/field-types/wrapped.ts +0 -32
- package/src/tx/builder/helpers.ts +0 -252
- package/src/tx/builder/index.ts +0 -123
- package/src/tx/builder/schema.generated.ts +0 -2049
- package/src/tx/builder/schema.ts +0 -612
- package/src/tx/execution-cost.ts +0 -164
- package/src/tx/transaction-signer.ts +0 -27
- package/src/tx/validator.ts +0 -222
- package/src/typings/@aeternity__uuid/index.d.ts +0 -5
- package/src/typings/bip32-path/index.d.ts +0 -33
- package/src/typings/blakejs/index.d.ts +0 -5
- package/src/typings/sha-js/index.d.ts +0 -5
- package/src/typings/tweetnacl-auth/index.d.ts +0 -14
- package/src/utils/amount-formatter.ts +0 -98
- package/src/utils/autorest.ts +0 -153
- package/src/utils/bignumber.ts +0 -21
- package/src/utils/bytes.ts +0 -28
- package/src/utils/crypto.ts +0 -216
- package/src/utils/encoder-types.ts +0 -63
- package/src/utils/encoder.ts +0 -145
- package/src/utils/errors.ts +0 -777
- package/src/utils/hd-wallet.ts +0 -191
- package/src/utils/json-big.ts +0 -27
- package/src/utils/jwt.ts +0 -126
- package/src/utils/keystore.ts +0 -189
- package/src/utils/other.ts +0 -64
- package/src/utils/semver-satisfies.ts +0 -22
- package/src/utils/string.ts +0 -17
- package/src/utils/typed-data.ts +0 -69
- package/src/utils/wrap-proxy.ts +0 -24
- package/types-legacy/ts4.2/AeSdk.d.ts +0 -44
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +0 -71
- package/types-legacy/ts4.2/AeSdkBase.d.ts +0 -164
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +0 -146
- package/types-legacy/ts4.2/AeSdkWallet.d.ts +0 -90
- package/types-legacy/ts4.2/Middleware.d.ts +0 -46
- package/types-legacy/ts4.2/MiddlewareSubscriber.d.ts +0 -30
- package/types-legacy/ts4.2/Node.d.ts +0 -95
- package/types-legacy/ts4.2/account/Base.d.ts +0 -147
- package/types-legacy/ts4.2/account/Generalized.d.ts +0 -22
- package/types-legacy/ts4.2/account/Ledger.d.ts +0 -34
- package/types-legacy/ts4.2/account/LedgerFactory.d.ts +0 -39
- package/types-legacy/ts4.2/account/Memory.d.ts +0 -46
- package/types-legacy/ts4.2/account/Rpc.d.ts +0 -35
- package/types-legacy/ts4.2/aens.d.ts +0 -193
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/Browser.d.ts +0 -33
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +0 -22
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +0 -36
- package/types-legacy/ts4.2/aepp-wallet-communication/connection-proxy.d.ts +0 -11
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/RpcClient.d.ts +0 -34
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +0 -120
- package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +0 -129
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +0 -22
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +0 -86
- package/types-legacy/ts4.2/apis/compiler/index.d.ts +0 -2
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +0 -191
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +0 -22
- package/types-legacy/ts4.2/apis/compiler/models/parameters.d.ts +0 -12
- package/types-legacy/ts4.2/apis/middleware/index.d.ts +0 -2
- package/types-legacy/ts4.2/apis/middleware/middleware.d.ts +0 -327
- package/types-legacy/ts4.2/apis/middleware/models/index.d.ts +0 -1645
- package/types-legacy/ts4.2/apis/middleware/models/mappers.d.ts +0 -109
- package/types-legacy/ts4.2/apis/middleware/models/parameters.d.ts +0 -46
- package/types-legacy/ts4.2/apis/node/index.d.ts +0 -2
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +0 -1129
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +0 -99
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +0 -17
- package/types-legacy/ts4.2/apis/node/node.d.ts +0 -236
- package/types-legacy/ts4.2/chain.d.ts +0 -227
- package/types-legacy/ts4.2/channel/Base.d.ts +0 -168
- package/types-legacy/ts4.2/channel/Contract.d.ts +0 -239
- package/types-legacy/ts4.2/channel/Spend.d.ts +0 -213
- package/types-legacy/ts4.2/channel/handlers.d.ts +0 -21
- package/types-legacy/ts4.2/channel/internal.d.ts +0 -232
- package/types-legacy/ts4.2/contract/Contract.d.ts +0 -164
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +0 -104
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +0 -26
- package/types-legacy/ts4.2/contract/compiler/Cli8.d.ts +0 -13
- package/types-legacy/ts4.2/contract/compiler/Http.d.ts +0 -28
- package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +0 -15
- package/types-legacy/ts4.2/contract/compiler/getFileSystem.d.ts +0 -6
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +0 -45
- package/types-legacy/ts4.2/contract/ga.d.ts +0 -59
- package/types-legacy/ts4.2/deprecated.d.ts +0 -62
- package/types-legacy/ts4.2/globals.d.ts +0 -16
- package/types-legacy/ts4.2/index-browser.d.ts +0 -51
- package/types-legacy/ts4.2/index.d.ts +0 -6
- package/types-legacy/ts4.2/oracle.d.ts +0 -125
- package/types-legacy/ts4.2/send-transaction.d.ts +0 -53
- package/types-legacy/ts4.2/spend.d.ts +0 -56
- package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +0 -37
- package/types-legacy/ts4.2/tx/builder/common.d.ts +0 -32
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +0 -100
- package/types-legacy/ts4.2/tx/builder/delegation/index.d.ts +0 -20
- package/types-legacy/ts4.2/tx/builder/delegation/schema.d.ts +0 -136
- package/types-legacy/ts4.2/tx/builder/delegation/schema.generated.d.ts +0 -141
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +0 -19
- package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +0 -21
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/boolean.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +0 -11
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +0 -72
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/entry.d.ts +0 -11
- package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +0 -30
- package/types-legacy/ts4.2/tx/builder/field-types/field.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +0 -16
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +0 -17
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +0 -45
- package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +0 -13
- package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +0 -48
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +0 -18
- package/types-legacy/ts4.2/tx/builder/field-types/name-id.d.ts +0 -11
- package/types-legacy/ts4.2/tx/builder/field-types/name.d.ts +0 -13
- package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +0 -15
- package/types-legacy/ts4.2/tx/builder/field-types/pointers.d.ts +0 -26
- package/types-legacy/ts4.2/tx/builder/field-types/pointers2.d.ts +0 -26
- package/types-legacy/ts4.2/tx/builder/field-types/query-fee.d.ts +0 -19
- package/types-legacy/ts4.2/tx/builder/field-types/raw.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/string.d.ts +0 -6
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +0 -20
- package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/with-default.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/with-formatting.d.ts +0 -7
- package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +0 -14
- package/types-legacy/ts4.2/tx/builder/helpers.d.ts +0 -119
- package/types-legacy/ts4.2/tx/builder/index.d.ts +0 -62
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +0 -3256
- package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +0 -2047
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +0 -53
- package/types-legacy/ts4.2/tx/transaction-signer.d.ts +0 -6
- package/types-legacy/ts4.2/tx/validator.d.ts +0 -18
- package/types-legacy/ts4.2/utils/amount-formatter.d.ts +0 -41
- package/types-legacy/ts4.2/utils/autorest.d.ts +0 -7
- package/types-legacy/ts4.2/utils/bignumber.d.ts +0 -13
- package/types-legacy/ts4.2/utils/bytes.d.ts +0 -9
- package/types-legacy/ts4.2/utils/crypto.d.ts +0 -100
- package/types-legacy/ts4.2/utils/encoder-types.d.ts +0 -61
- package/types-legacy/ts4.2/utils/encoder.d.ts +0 -24
- package/types-legacy/ts4.2/utils/errors.d.ts +0 -464
- package/types-legacy/ts4.2/utils/hd-wallet.d.ts +0 -68
- package/types-legacy/ts4.2/utils/json-big.d.ts +0 -5
- package/types-legacy/ts4.2/utils/jwt.d.ts +0 -53
- package/types-legacy/ts4.2/utils/keystore.d.ts +0 -57
- package/types-legacy/ts4.2/utils/other.d.ts +0 -32
- package/types-legacy/ts4.2/utils/semver-satisfies.d.ts +0 -1
- package/types-legacy/ts4.2/utils/string.d.ts +0 -12
- package/types-legacy/ts4.2/utils/typed-data.d.ts +0 -58
- package/types-legacy/ts4.2/utils/wrap-proxy.d.ts +0 -2
- package/types-legacy/ts4.5/AeSdk.d.ts +0 -44
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +0 -71
- package/types-legacy/ts4.5/AeSdkBase.d.ts +0 -164
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +0 -146
- package/types-legacy/ts4.5/AeSdkWallet.d.ts +0 -90
- package/types-legacy/ts4.5/Middleware.d.ts +0 -46
- package/types-legacy/ts4.5/MiddlewareSubscriber.d.ts +0 -30
- package/types-legacy/ts4.5/Node.d.ts +0 -95
- package/types-legacy/ts4.5/account/Base.d.ts +0 -147
- package/types-legacy/ts4.5/account/Generalized.d.ts +0 -22
- package/types-legacy/ts4.5/account/Ledger.d.ts +0 -34
- package/types-legacy/ts4.5/account/LedgerFactory.d.ts +0 -39
- package/types-legacy/ts4.5/account/Memory.d.ts +0 -46
- package/types-legacy/ts4.5/account/Rpc.d.ts +0 -35
- package/types-legacy/ts4.5/aens.d.ts +0 -193
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/Browser.d.ts +0 -33
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +0 -22
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +0 -36
- package/types-legacy/ts4.5/aepp-wallet-communication/connection-proxy.d.ts +0 -11
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/RpcClient.d.ts +0 -34
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +0 -120
- package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +0 -129
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +0 -22
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +0 -86
- package/types-legacy/ts4.5/apis/compiler/index.d.ts +0 -2
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +0 -191
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +0 -22
- package/types-legacy/ts4.5/apis/compiler/models/parameters.d.ts +0 -12
- package/types-legacy/ts4.5/apis/middleware/index.d.ts +0 -2
- package/types-legacy/ts4.5/apis/middleware/middleware.d.ts +0 -327
- package/types-legacy/ts4.5/apis/middleware/models/index.d.ts +0 -1645
- package/types-legacy/ts4.5/apis/middleware/models/mappers.d.ts +0 -109
- package/types-legacy/ts4.5/apis/middleware/models/parameters.d.ts +0 -46
- package/types-legacy/ts4.5/apis/node/index.d.ts +0 -2
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +0 -1129
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +0 -99
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +0 -17
- package/types-legacy/ts4.5/apis/node/node.d.ts +0 -236
- package/types-legacy/ts4.5/chain.d.ts +0 -227
- package/types-legacy/ts4.5/channel/Base.d.ts +0 -168
- package/types-legacy/ts4.5/channel/Contract.d.ts +0 -239
- package/types-legacy/ts4.5/channel/Spend.d.ts +0 -213
- package/types-legacy/ts4.5/channel/handlers.d.ts +0 -21
- package/types-legacy/ts4.5/channel/internal.d.ts +0 -232
- package/types-legacy/ts4.5/contract/Contract.d.ts +0 -164
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +0 -104
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +0 -26
- package/types-legacy/ts4.5/contract/compiler/Cli8.d.ts +0 -13
- package/types-legacy/ts4.5/contract/compiler/Http.d.ts +0 -28
- package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +0 -15
- package/types-legacy/ts4.5/contract/compiler/getFileSystem.d.ts +0 -6
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +0 -45
- package/types-legacy/ts4.5/contract/ga.d.ts +0 -59
- package/types-legacy/ts4.5/deprecated.d.ts +0 -62
- package/types-legacy/ts4.5/index-browser.d.ts +0 -51
- package/types-legacy/ts4.5/index.d.ts +0 -5
- package/types-legacy/ts4.5/oracle.d.ts +0 -125
- package/types-legacy/ts4.5/send-transaction.d.ts +0 -53
- package/types-legacy/ts4.5/spend.d.ts +0 -56
- package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +0 -37
- package/types-legacy/ts4.5/tx/builder/common.d.ts +0 -32
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +0 -100
- package/types-legacy/ts4.5/tx/builder/delegation/index.d.ts +0 -20
- package/types-legacy/ts4.5/tx/builder/delegation/schema.d.ts +0 -136
- package/types-legacy/ts4.5/tx/builder/delegation/schema.generated.d.ts +0 -141
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +0 -19
- package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +0 -21
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/boolean.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +0 -11
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +0 -72
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/entry.d.ts +0 -11
- package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +0 -30
- package/types-legacy/ts4.5/tx/builder/field-types/field.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +0 -16
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +0 -17
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +0 -45
- package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +0 -13
- package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +0 -48
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +0 -18
- package/types-legacy/ts4.5/tx/builder/field-types/name-id.d.ts +0 -11
- package/types-legacy/ts4.5/tx/builder/field-types/name.d.ts +0 -13
- package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +0 -15
- package/types-legacy/ts4.5/tx/builder/field-types/pointers.d.ts +0 -26
- package/types-legacy/ts4.5/tx/builder/field-types/pointers2.d.ts +0 -26
- package/types-legacy/ts4.5/tx/builder/field-types/query-fee.d.ts +0 -19
- package/types-legacy/ts4.5/tx/builder/field-types/raw.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/string.d.ts +0 -6
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +0 -20
- package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/with-default.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/with-formatting.d.ts +0 -7
- package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +0 -14
- package/types-legacy/ts4.5/tx/builder/helpers.d.ts +0 -119
- package/types-legacy/ts4.5/tx/builder/index.d.ts +0 -62
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +0 -3256
- package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +0 -2047
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +0 -53
- package/types-legacy/ts4.5/tx/transaction-signer.d.ts +0 -6
- package/types-legacy/ts4.5/tx/validator.d.ts +0 -18
- package/types-legacy/ts4.5/utils/amount-formatter.d.ts +0 -41
- package/types-legacy/ts4.5/utils/autorest.d.ts +0 -7
- package/types-legacy/ts4.5/utils/bignumber.d.ts +0 -13
- package/types-legacy/ts4.5/utils/bytes.d.ts +0 -9
- package/types-legacy/ts4.5/utils/crypto.d.ts +0 -100
- package/types-legacy/ts4.5/utils/encoder-types.d.ts +0 -61
- package/types-legacy/ts4.5/utils/encoder.d.ts +0 -24
- package/types-legacy/ts4.5/utils/errors.d.ts +0 -464
- package/types-legacy/ts4.5/utils/hd-wallet.d.ts +0 -68
- package/types-legacy/ts4.5/utils/json-big.d.ts +0 -5
- package/types-legacy/ts4.5/utils/jwt.d.ts +0 -53
- package/types-legacy/ts4.5/utils/keystore.d.ts +0 -57
- package/types-legacy/ts4.5/utils/other.d.ts +0 -32
- package/types-legacy/ts4.5/utils/semver-satisfies.d.ts +0 -1
- package/types-legacy/ts4.5/utils/string.d.ts +0 -12
- package/types-legacy/ts4.5/utils/typed-data.d.ts +0 -58
- package/types-legacy/ts4.5/utils/wrap-proxy.d.ts +0 -2
- /package/dist/{aepp-sdk.browser.js.LICENSE.txt → aepp-sdk.browser.cjs.LICENSE.txt} +0 -0
package/es/chain.js
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter.js';
|
|
2
|
+
import { isAccountNotFoundError, pause } from './utils/other.js';
|
|
3
|
+
import { unwrapProxy } from './utils/wrap-proxy.js';
|
|
4
|
+
import { isName, produceNameId } from './tx/builder/helpers.js';
|
|
5
|
+
import { DRY_RUN_ACCOUNT } from './tx/builder/constants.js';
|
|
6
|
+
import { AensPointerContextError, DryRunError, InvalidAensNameError, TxTimedOutError, TxNotInChainError, InternalError } from './utils/errors.js';
|
|
7
|
+
import { decode, encode, Encoding } from './utils/encoder.js';
|
|
8
|
+
async function getEventInterval(type, {
|
|
9
|
+
_expectedMineRate,
|
|
10
|
+
_microBlockCycle,
|
|
11
|
+
onNode
|
|
12
|
+
}) {
|
|
13
|
+
if (_expectedMineRate != null && type === 'key-block') return _expectedMineRate;
|
|
14
|
+
if (_microBlockCycle != null && type === 'micro-block') return _microBlockCycle;
|
|
15
|
+
const networkId = await onNode.getNetworkId();
|
|
16
|
+
if (networkId === 'ae_dev') return 0;
|
|
17
|
+
if (!['ae_mainnet', 'ae_uat'].includes(networkId) && (await onNode._isHyperchain())) return 3000;
|
|
18
|
+
if (type === 'key-block') return 180000;else return 3000;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @category chain
|
|
23
|
+
* @param type - Type
|
|
24
|
+
* @param options - Options
|
|
25
|
+
*/
|
|
26
|
+
export async function _getPollInterval(type, options) {
|
|
27
|
+
return Math.floor((await getEventInterval(type, options)) / 3);
|
|
28
|
+
}
|
|
29
|
+
const heightCache = new WeakMap();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Obtain current height of the chain
|
|
33
|
+
* @category chain
|
|
34
|
+
* @param options - Options
|
|
35
|
+
* @param options.cached - Get height from the cache. The lag behind the actual height shouldn't
|
|
36
|
+
* be more than 1 block. Use if needed to reduce requests count, and approximate value can be used.
|
|
37
|
+
* For example, for timeout check in transaction status polling.
|
|
38
|
+
* @returns Current chain height
|
|
39
|
+
*/
|
|
40
|
+
export async function getHeight({
|
|
41
|
+
cached = false,
|
|
42
|
+
...options
|
|
43
|
+
}) {
|
|
44
|
+
const onNode = unwrapProxy(options.onNode);
|
|
45
|
+
if (cached) {
|
|
46
|
+
const cache = heightCache.get(onNode);
|
|
47
|
+
if (cache != null && cache.time > Date.now() - (await _getPollInterval('key-block', options))) {
|
|
48
|
+
return cache.height;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const {
|
|
52
|
+
height
|
|
53
|
+
} = await onNode.getCurrentKeyBlockHeight();
|
|
54
|
+
heightCache.set(onNode, {
|
|
55
|
+
height,
|
|
56
|
+
time: Date.now()
|
|
57
|
+
});
|
|
58
|
+
return height;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Return transaction details if it is mined, fail otherwise.
|
|
63
|
+
* If the transaction has ttl specified then would wait till it leaves the mempool.
|
|
64
|
+
* Otherwise would fail if a specified amount of blocks were mined.
|
|
65
|
+
* @category chain
|
|
66
|
+
* @param th - The hash of transaction to poll
|
|
67
|
+
* @param options - Options
|
|
68
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
69
|
+
* @param options.blocks - Number of blocks mined after which to fail if transaction ttl is not set
|
|
70
|
+
* @param options.onNode - Node to use
|
|
71
|
+
* @returns The transaction as it was mined
|
|
72
|
+
*/
|
|
73
|
+
export async function poll(th, {
|
|
74
|
+
blocks = 5,
|
|
75
|
+
interval,
|
|
76
|
+
...options
|
|
77
|
+
}) {
|
|
78
|
+
interval !== null && interval !== void 0 ? interval : interval = await _getPollInterval('micro-block', options);
|
|
79
|
+
let max;
|
|
80
|
+
do {
|
|
81
|
+
const tx = await options.onNode.getTransactionByHash(th);
|
|
82
|
+
if (tx.blockHeight !== -1) return tx;
|
|
83
|
+
if (max == null) {
|
|
84
|
+
max = tx.tx.ttl !== 0 ? -1 : (await getHeight({
|
|
85
|
+
...options,
|
|
86
|
+
cached: true
|
|
87
|
+
})) + blocks;
|
|
88
|
+
}
|
|
89
|
+
await pause(interval);
|
|
90
|
+
} while (max === -1 ? true : (await getHeight({
|
|
91
|
+
...options,
|
|
92
|
+
cached: true
|
|
93
|
+
})) < max);
|
|
94
|
+
throw new TxTimedOutError(blocks, th);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Wait for the chain to reach a specific height
|
|
99
|
+
* @category chain
|
|
100
|
+
* @param height - Height to wait for
|
|
101
|
+
* @param options - Options
|
|
102
|
+
* @param options.interval - Interval (in ms) at which to poll the chain
|
|
103
|
+
* @param options.onNode - Node to use
|
|
104
|
+
* @returns Current chain height
|
|
105
|
+
*/
|
|
106
|
+
export async function awaitHeight(height, {
|
|
107
|
+
interval,
|
|
108
|
+
...options
|
|
109
|
+
}) {
|
|
110
|
+
interval !== null && interval !== void 0 ? interval : interval = Math.min(await _getPollInterval('key-block', options), 5000);
|
|
111
|
+
let currentHeight;
|
|
112
|
+
do {
|
|
113
|
+
if (currentHeight != null) await pause(interval);
|
|
114
|
+
currentHeight = await getHeight(options);
|
|
115
|
+
} while (currentHeight < height);
|
|
116
|
+
return currentHeight;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Wait for transaction confirmation
|
|
121
|
+
* @category chain
|
|
122
|
+
* @param txHash - Transaction hash
|
|
123
|
+
* @param options - Options
|
|
124
|
+
* @param options.confirm - Number of micro blocks to wait for transaction confirmation
|
|
125
|
+
* @param options.onNode - Node to use
|
|
126
|
+
* @returns Current Height
|
|
127
|
+
*/
|
|
128
|
+
export async function waitForTxConfirm(txHash, {
|
|
129
|
+
confirm = 3,
|
|
130
|
+
onNode,
|
|
131
|
+
...options
|
|
132
|
+
}) {
|
|
133
|
+
const {
|
|
134
|
+
blockHeight
|
|
135
|
+
} = await onNode.getTransactionByHash(txHash);
|
|
136
|
+
const height = await awaitHeight(blockHeight + confirm, {
|
|
137
|
+
onNode,
|
|
138
|
+
...options
|
|
139
|
+
});
|
|
140
|
+
const {
|
|
141
|
+
blockHeight: newBlockHeight
|
|
142
|
+
} = await onNode.getTransactionByHash(txHash);
|
|
143
|
+
switch (newBlockHeight) {
|
|
144
|
+
case -1:
|
|
145
|
+
throw new TxNotInChainError(txHash);
|
|
146
|
+
case blockHeight:
|
|
147
|
+
return height;
|
|
148
|
+
default:
|
|
149
|
+
return waitForTxConfirm(txHash, {
|
|
150
|
+
onNode,
|
|
151
|
+
confirm,
|
|
152
|
+
...options
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get account by account public key
|
|
159
|
+
* @category chain
|
|
160
|
+
* @param address - Account address (public key)
|
|
161
|
+
* @param options - Options
|
|
162
|
+
* @param options.height - Get account on specific block by block height
|
|
163
|
+
* @param options.hash - Get account on specific block by micro block hash or key block hash
|
|
164
|
+
* @param options.onNode - Node to use
|
|
165
|
+
*/
|
|
166
|
+
export async function getAccount(address, {
|
|
167
|
+
height,
|
|
168
|
+
hash,
|
|
169
|
+
onNode
|
|
170
|
+
}) {
|
|
171
|
+
if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);
|
|
172
|
+
if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);
|
|
173
|
+
return onNode.getAccountByPubkey(address);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Request the balance of specified account
|
|
178
|
+
* @category chain
|
|
179
|
+
* @param address - The public account address to obtain the balance for
|
|
180
|
+
* @param options - Options
|
|
181
|
+
* @param options.format
|
|
182
|
+
* @param options.height - The chain height at which to obtain the balance for
|
|
183
|
+
* (default: top of chain)
|
|
184
|
+
* @param options.hash - The block hash on which to obtain the balance for (default: top of chain)
|
|
185
|
+
*/
|
|
186
|
+
export async function getBalance(address, {
|
|
187
|
+
/**
|
|
188
|
+
* @deprecated no replacement implemented yet
|
|
189
|
+
*/
|
|
190
|
+
format = AE_AMOUNT_FORMATS.AETTOS,
|
|
191
|
+
...options
|
|
192
|
+
}) {
|
|
193
|
+
const addr = address.startsWith('ok_') ? encode(decode(address), Encoding.AccountAddress) : address;
|
|
194
|
+
const {
|
|
195
|
+
balance
|
|
196
|
+
} = await getAccount(addr, options).catch(error => {
|
|
197
|
+
if (!isAccountNotFoundError(error)) throw error;
|
|
198
|
+
return {
|
|
199
|
+
balance: 0n
|
|
200
|
+
};
|
|
201
|
+
});
|
|
202
|
+
return formatAmount(balance, {
|
|
203
|
+
targetDenomination: format
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Obtain current generation
|
|
209
|
+
* @category chain
|
|
210
|
+
* @param options - Options
|
|
211
|
+
* @param options.onNode - Node to use
|
|
212
|
+
* @returns Current Generation
|
|
213
|
+
* @deprecated Use {@link Node.getCurrentGeneration} instead
|
|
214
|
+
*/
|
|
215
|
+
export async function getCurrentGeneration({
|
|
216
|
+
onNode
|
|
217
|
+
}) {
|
|
218
|
+
return onNode.getCurrentGeneration();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Get generation by hash or height
|
|
223
|
+
* @category chain
|
|
224
|
+
* @param hashOrHeight - Generation hash or height
|
|
225
|
+
* @param options - Options
|
|
226
|
+
* @param options.onNode - Node to use
|
|
227
|
+
* @returns Generation
|
|
228
|
+
* @deprecated Use {@link Node.getGenerationByHash} or {@link Node.getGenerationByHeight} instead
|
|
229
|
+
*/
|
|
230
|
+
export async function getGeneration(hashOrHeight, {
|
|
231
|
+
onNode
|
|
232
|
+
}) {
|
|
233
|
+
if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);
|
|
234
|
+
return onNode.getGenerationByHash(hashOrHeight);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get micro block transactions
|
|
239
|
+
* @category chain
|
|
240
|
+
* @param hash - Micro block hash
|
|
241
|
+
* @param options - Options
|
|
242
|
+
* @param options.onNode - Node to use
|
|
243
|
+
* @returns Transactions
|
|
244
|
+
* @deprecated Use {@link Node.getMicroBlockTransactionsByHash} instead
|
|
245
|
+
*/
|
|
246
|
+
export async function getMicroBlockTransactions(hash, {
|
|
247
|
+
onNode
|
|
248
|
+
}) {
|
|
249
|
+
return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get key block
|
|
254
|
+
* @category chain
|
|
255
|
+
* @param hashOrHeight - Key block hash or height
|
|
256
|
+
* @param options - Options
|
|
257
|
+
* @param options.onNode - Node to use
|
|
258
|
+
* @returns Key Block
|
|
259
|
+
* @deprecated Use {@link Node.getKeyBlockByHeight} or {@link Node.getKeyBlockByHash} instead
|
|
260
|
+
*/
|
|
261
|
+
export async function getKeyBlock(hashOrHeight, {
|
|
262
|
+
onNode
|
|
263
|
+
}) {
|
|
264
|
+
if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);
|
|
265
|
+
return onNode.getKeyBlockByHash(hashOrHeight);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Get micro block header
|
|
270
|
+
* @category chain
|
|
271
|
+
* @param hash - Micro block hash
|
|
272
|
+
* @param options - Options
|
|
273
|
+
* @param options.onNode - Node to use
|
|
274
|
+
* @returns Micro block header
|
|
275
|
+
* @deprecated Use {@link Node.getMicroBlockHeaderByHash} instead
|
|
276
|
+
*/
|
|
277
|
+
export async function getMicroBlockHeader(hash, {
|
|
278
|
+
onNode
|
|
279
|
+
}) {
|
|
280
|
+
return onNode.getMicroBlockHeaderByHash(hash);
|
|
281
|
+
}
|
|
282
|
+
const txDryRunRequests = new Map();
|
|
283
|
+
async function txDryRunHandler(key, onNode) {
|
|
284
|
+
const rs = txDryRunRequests.get(key);
|
|
285
|
+
txDryRunRequests.delete(key);
|
|
286
|
+
if (rs == null) throw new InternalError("Can't get dry-run request");
|
|
287
|
+
let dryRunRes;
|
|
288
|
+
try {
|
|
289
|
+
const top = typeof rs[0].top === 'number' ? (await onNode.getKeyBlockByHeight(rs[0].top)).hash : rs[0].top;
|
|
290
|
+
dryRunRes = await onNode.protectedDryRunTxs({
|
|
291
|
+
top,
|
|
292
|
+
txEvents: rs[0].txEvents,
|
|
293
|
+
txs: rs.map(req => ({
|
|
294
|
+
tx: req.tx
|
|
295
|
+
})),
|
|
296
|
+
accounts: Array.from(new Set(rs.map(req => req.accountAddress))).map(pubKey => ({
|
|
297
|
+
pubKey,
|
|
298
|
+
amount: DRY_RUN_ACCOUNT.amount
|
|
299
|
+
}))
|
|
300
|
+
});
|
|
301
|
+
} catch (error) {
|
|
302
|
+
rs.forEach(({
|
|
303
|
+
reject
|
|
304
|
+
}) => reject(error));
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const {
|
|
308
|
+
results,
|
|
309
|
+
txEvents
|
|
310
|
+
} = dryRunRes;
|
|
311
|
+
results.forEach(({
|
|
312
|
+
result,
|
|
313
|
+
reason,
|
|
314
|
+
...resultPayload
|
|
315
|
+
}, idx) => {
|
|
316
|
+
const {
|
|
317
|
+
resolve,
|
|
318
|
+
reject,
|
|
319
|
+
tx,
|
|
320
|
+
accountAddress
|
|
321
|
+
} = rs[idx];
|
|
322
|
+
if (result === 'ok') resolve({
|
|
323
|
+
...resultPayload,
|
|
324
|
+
txEvents
|
|
325
|
+
});else reject(Object.assign(new DryRunError(reason), {
|
|
326
|
+
tx,
|
|
327
|
+
accountAddress
|
|
328
|
+
}));
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Transaction dry-run
|
|
334
|
+
* @category chain
|
|
335
|
+
* @param tx - transaction to execute
|
|
336
|
+
* @param accountAddress - address that will be used to execute transaction
|
|
337
|
+
* @param options - Options
|
|
338
|
+
* @param options.top - hash of block on which to make dry-run
|
|
339
|
+
* @param options.txEvents - collect and return on-chain tx events that would result from the call
|
|
340
|
+
* @param options.combine - Enables combining of similar requests to a single dry-run call
|
|
341
|
+
* @param options.onNode - Node to use
|
|
342
|
+
*/
|
|
343
|
+
export async function txDryRun(tx, accountAddress, {
|
|
344
|
+
top,
|
|
345
|
+
txEvents,
|
|
346
|
+
combine,
|
|
347
|
+
onNode
|
|
348
|
+
}) {
|
|
349
|
+
var _txDryRunRequests$get;
|
|
350
|
+
const key = combine === true ? [top, txEvents].join() : 'immediate';
|
|
351
|
+
const requests = (_txDryRunRequests$get = txDryRunRequests.get(key)) !== null && _txDryRunRequests$get !== void 0 ? _txDryRunRequests$get : [];
|
|
352
|
+
txDryRunRequests.set(key, requests);
|
|
353
|
+
return new Promise((resolve, reject) => {
|
|
354
|
+
var _requests$timeout;
|
|
355
|
+
requests.push({
|
|
356
|
+
tx,
|
|
357
|
+
accountAddress,
|
|
358
|
+
top,
|
|
359
|
+
txEvents,
|
|
360
|
+
resolve,
|
|
361
|
+
reject
|
|
362
|
+
});
|
|
363
|
+
if (combine !== true) {
|
|
364
|
+
void txDryRunHandler(key, onNode);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
(_requests$timeout = requests.timeout) !== null && _requests$timeout !== void 0 ? _requests$timeout : requests.timeout = setTimeout(() => {
|
|
368
|
+
void txDryRunHandler(key, onNode);
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Get contract byte code
|
|
375
|
+
* @category contract
|
|
376
|
+
* @param contractId - Contract address
|
|
377
|
+
* @param options - Options
|
|
378
|
+
* @param options.onNode - Node to use
|
|
379
|
+
* @deprecated Use {@link Node.getContractCode} instead
|
|
380
|
+
*/
|
|
381
|
+
export async function getContractByteCode(contractId, {
|
|
382
|
+
onNode
|
|
383
|
+
}) {
|
|
384
|
+
return onNode.getContractCode(contractId);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Get contract entry
|
|
389
|
+
* @category contract
|
|
390
|
+
* @param contractId - Contract address
|
|
391
|
+
* @param options - Options
|
|
392
|
+
* @param options.onNode - Node to use
|
|
393
|
+
* @deprecated Use {@link Node.getContract} instead
|
|
394
|
+
*/
|
|
395
|
+
export async function getContract(contractId, {
|
|
396
|
+
onNode
|
|
397
|
+
}) {
|
|
398
|
+
return onNode.getContract(contractId);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Get name entry
|
|
403
|
+
* @category AENS
|
|
404
|
+
* @param name - AENS name
|
|
405
|
+
* @param options - Options
|
|
406
|
+
* @param options.onNode - Node to use
|
|
407
|
+
* @deprecated Use {@link Node.getNameEntryByName} or {@link Name.getState} instead
|
|
408
|
+
*/
|
|
409
|
+
export async function getName(name, {
|
|
410
|
+
onNode
|
|
411
|
+
}) {
|
|
412
|
+
return onNode.getNameEntryByName(name);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Resolve AENS name and return name hash
|
|
417
|
+
* @category AENS
|
|
418
|
+
* @param nameOrId - AENS name or address
|
|
419
|
+
* @param key - in AENS pointers record
|
|
420
|
+
* @param options - Options
|
|
421
|
+
* @param options.verify - To ensure that name exist and have a corresponding pointer
|
|
422
|
+
* // TODO: avoid that to don't trust to current api gateway
|
|
423
|
+
* @param options.resolveByNode - Enables pointer resolving using node
|
|
424
|
+
* @param options.onNode - Node to use
|
|
425
|
+
* @returns Address or AENS name hash
|
|
426
|
+
*/
|
|
427
|
+
export async function resolveName(nameOrId, key, {
|
|
428
|
+
verify = true,
|
|
429
|
+
resolveByNode = false,
|
|
430
|
+
onNode
|
|
431
|
+
}) {
|
|
432
|
+
if (isName(nameOrId)) {
|
|
433
|
+
if (verify || resolveByNode) {
|
|
434
|
+
const name = await onNode.getNameEntryByName(nameOrId);
|
|
435
|
+
const pointer = name.pointers.find(p => p.key === key);
|
|
436
|
+
if (pointer == null) throw new AensPointerContextError(nameOrId, key);
|
|
437
|
+
if (resolveByNode) return pointer.id;
|
|
438
|
+
}
|
|
439
|
+
return produceNameId(nameOrId);
|
|
440
|
+
}
|
|
441
|
+
try {
|
|
442
|
+
decode(nameOrId);
|
|
443
|
+
return nameOrId;
|
|
444
|
+
} catch (error) {
|
|
445
|
+
throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
//# sourceMappingURL=chain.js.map
|
package/es/chain.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","names":["AE_AMOUNT_FORMATS","formatAmount","isAccountNotFoundError","pause","unwrapProxy","isName","produceNameId","DRY_RUN_ACCOUNT","AensPointerContextError","DryRunError","InvalidAensNameError","TxTimedOutError","TxNotInChainError","InternalError","decode","encode","Encoding","getEventInterval","type","_expectedMineRate","_microBlockCycle","onNode","networkId","getNetworkId","includes","_isHyperchain","_getPollInterval","options","Math","floor","heightCache","WeakMap","getHeight","cached","cache","get","time","Date","now","height","getCurrentKeyBlockHeight","set","poll","th","blocks","interval","max","tx","getTransactionByHash","blockHeight","ttl","awaitHeight","min","currentHeight","waitForTxConfirm","txHash","confirm","newBlockHeight","getAccount","address","hash","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getAccountByPubkey","getBalance","format","AETTOS","addr","startsWith","AccountAddress","balance","catch","error","targetDenomination","getCurrentGeneration","getGeneration","hashOrHeight","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","getMicroBlockTransactionsByHash","transactions","getKeyBlock","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","key","rs","delete","dryRunRes","top","protectedDryRunTxs","txEvents","txs","map","req","accounts","Array","from","Set","accountAddress","pubKey","amount","forEach","reject","results","result","reason","resultPayload","idx","resolve","Object","assign","txDryRun","combine","_txDryRunRequests$get","join","requests","Promise","_requests$timeout","push","timeout","setTimeout","getContractByteCode","contractId","getContractCode","getContract","getName","name","getNameEntryByName","resolveName","nameOrId","verify","resolveByNode","pointer","pointers","find","p","id"],"sources":["../src/chain.ts"],"sourcesContent":["import { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter.js';\nimport { isAccountNotFoundError, pause } from './utils/other.js';\nimport { unwrapProxy } from './utils/wrap-proxy.js';\nimport { isName, produceNameId } from './tx/builder/helpers.js';\nimport { AensName, DRY_RUN_ACCOUNT } from './tx/builder/constants.js';\nimport {\n AensPointerContextError,\n DryRunError,\n InvalidAensNameError,\n TxTimedOutError,\n TxNotInChainError,\n InternalError,\n} from './utils/errors.js';\nimport Node from './Node.js';\nimport { DryRunResult, DryRunResults, SignedTx } from './apis/node/index.js';\nimport { decode, encode, Encoded, Encoding } from './utils/encoder.js';\n\nasync function getEventInterval(\n type: 'key-block' | 'micro-block',\n {\n _expectedMineRate,\n _microBlockCycle,\n onNode,\n }: { _expectedMineRate?: number; _microBlockCycle?: number; onNode: Node },\n): Promise<number> {\n if (_expectedMineRate != null && type === 'key-block') return _expectedMineRate;\n if (_microBlockCycle != null && type === 'micro-block') return _microBlockCycle;\n\n const networkId = await onNode.getNetworkId();\n if (networkId === 'ae_dev') return 0;\n if (!['ae_mainnet', 'ae_uat'].includes(networkId) && (await onNode._isHyperchain())) return 3000;\n\n if (type === 'key-block') return 180000;\n else return 3000;\n}\n\n/**\n * @category chain\n * @param type - Type\n * @param options - Options\n */\nexport async function _getPollInterval(\n type: Parameters<typeof getEventInterval>[0],\n options: Parameters<typeof getEventInterval>[1],\n): Promise<number> {\n return Math.floor((await getEventInterval(type, options)) / 3);\n}\n\nconst heightCache: WeakMap<Node, { time: number; height: number }> = new WeakMap();\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @param options - Options\n * @param options.cached - Get height from the cache. The lag behind the actual height shouldn't\n * be more than 1 block. Use if needed to reduce requests count, and approximate value can be used.\n * For example, for timeout check in transaction status polling.\n * @returns Current chain height\n */\nexport async function getHeight({\n cached = false,\n ...options\n}: {\n onNode: Node;\n cached?: boolean;\n} & Parameters<typeof _getPollInterval>[1]): Promise<number> {\n const onNode = unwrapProxy(options.onNode);\n if (cached) {\n const cache = heightCache.get(onNode);\n if (cache != null && cache.time > Date.now() - (await _getPollInterval('key-block', options))) {\n return cache.height;\n }\n }\n const { height } = await onNode.getCurrentKeyBlockHeight();\n heightCache.set(onNode, { height, time: Date.now() });\n return height;\n}\n\n/**\n * Return transaction details if it is mined, fail otherwise.\n * If the transaction has ttl specified then would wait till it leaves the mempool.\n * Otherwise would fail if a specified amount of blocks were 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 if transaction ttl is not set\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 = 5,\n interval,\n ...options\n }: { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): ReturnType<Node['getTransactionByHash']> {\n interval ??= await _getPollInterval('micro-block', options);\n let max;\n do {\n const tx = await options.onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n if (max == null) {\n max = tx.tx.ttl !== 0 ? -1 : (await getHeight({ ...options, cached: true })) + blocks;\n }\n await pause(interval);\n } while (max === -1 ? true : (await getHeight({ ...options, cached: true })) < 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 {\n interval,\n ...options\n }: { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= Math.min(await _getPollInterval('key-block', options), 5000);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = await getHeight(options);\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 {\n confirm = 3,\n onNode,\n ...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 * 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 {\n height,\n hash,\n onNode,\n }: { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): ReturnType<Node['getAccountByPubkey']> {\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 | Encoded.OracleAddress,\n {\n /**\n * @deprecated no replacement implemented yet\n */\n format = AE_AMOUNT_FORMATS.AETTOS,\n ...options\n }: { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const addr = address.startsWith('ok_')\n ? encode(decode(address), Encoding.AccountAddress)\n : (address as Encoded.AccountAddress | Encoded.ContractAddress);\n\n const { balance } = await getAccount(addr, options).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { balance: 0n };\n });\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 * @deprecated Use {@link Node.getCurrentGeneration} instead\n */\nexport async function getCurrentGeneration({\n onNode,\n}: {\n onNode: Node;\n}): ReturnType<Node['getCurrentGeneration']> {\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 * @deprecated Use {@link Node.getGenerationByHash} or {@link Node.getGenerationByHeight} instead\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getGenerationByHash']> {\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 * @deprecated Use {@link Node.getMicroBlockTransactionsByHash} instead\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<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 * @deprecated Use {@link Node.getKeyBlockByHeight} or {@link Node.getKeyBlockByHash} instead\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getKeyBlockByHash']> {\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 * @deprecated Use {@link Node.getMicroBlockHeaderByHash} instead\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getMicroBlockHeaderByHash']> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number | Encoded.KeyBlockHash | Encoded.MicroBlockHash;\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 const top =\n typeof rs[0].top === 'number'\n ? (await onNode.getKeyBlockByHeight(rs[0].top)).hash\n : rs[0].top;\n dryRunRes = await onNode.protectedDryRunTxs({\n 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))).map((pubKey) => ({\n pubKey,\n amount: DRY_RUN_ACCOUNT.amount,\n })),\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 { resolve, reject, tx, accountAddress } = 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,\n txEvents,\n combine,\n onNode,\n }: { top?: TxDryRunArguments['top']; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{ txEvents?: DryRunResults['txEvents'] } & 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,\n accountAddress,\n top,\n txEvents,\n resolve,\n reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => {\n void txDryRunHandler(key, onNode);\n });\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 * @deprecated Use {@link Node.getContractCode} instead\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getContractCode']> {\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 * @deprecated Use {@link Node.getContract} instead\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getContract']> {\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 * @deprecated Use {@link Node.getNameEntryByName} or {@link Name.getState} instead\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): ReturnType<Node['getNameEntryByName']> {\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<Type extends Encoding.AccountAddress | Encoding.ContractAddress>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n {\n verify = true,\n resolveByNode = false,\n onNode,\n }: { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isName(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,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,6BAA6B;AAC7E,SAASC,sBAAsB,EAAEC,KAAK,QAAQ,kBAAkB;AAChE,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,MAAM,EAAEC,aAAa,QAAQ,yBAAyB;AAC/D,SAAmBC,eAAe,QAAQ,2BAA2B;AACrE,SACEC,uBAAuB,EACvBC,WAAW,EACXC,oBAAoB,EACpBC,eAAe,EACfC,iBAAiB,EACjBC,aAAa,QACR,mBAAmB;AAG1B,SAASC,MAAM,EAAEC,MAAM,EAAWC,QAAQ,QAAQ,oBAAoB;AAEtE,eAAeC,gBAAgBA,CAC7BC,IAAiC,EACjC;EACEC,iBAAiB;EACjBC,gBAAgB;EAChBC;AACuE,CAAC,EACzD;EACjB,IAAIF,iBAAiB,IAAI,IAAI,IAAID,IAAI,KAAK,WAAW,EAAE,OAAOC,iBAAiB;EAC/E,IAAIC,gBAAgB,IAAI,IAAI,IAAIF,IAAI,KAAK,aAAa,EAAE,OAAOE,gBAAgB;EAE/E,MAAME,SAAS,GAA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List":[]}
|
package/es/channel/Base.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import EventEmitter from 'events';
|
|
4
2
|
import { w3cwebsocket as W3CWebSocket } from 'websocket';
|
|
5
|
-
import { Tag } from '../tx/builder/constants';
|
|
6
|
-
import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm, ChannelMessage, ChannelEvents } from './internal';
|
|
7
|
-
import { Encoded } from '../utils/encoder';
|
|
8
|
-
import { TxUnpacked } from '../tx/builder/schema.generated';
|
|
3
|
+
import { Tag } from '../tx/builder/constants.js';
|
|
4
|
+
import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm, ChannelMessage, ChannelEvents } from './internal.js';
|
|
5
|
+
import { Encoded } from '../utils/encoder.js';
|
|
6
|
+
import { TxUnpacked } from '../tx/builder/schema.generated.js';
|
|
7
|
+
import { EntryTag } from '../tx/builder/entry/constants.js';
|
|
8
|
+
import { EntUnpacked } from '../tx/builder/entry/schema.generated.js';
|
|
9
9
|
/**
|
|
10
10
|
* Channel
|
|
11
11
|
* @example
|
|
@@ -29,7 +29,7 @@ import { TxUnpacked } from '../tx/builder/schema.generated';
|
|
|
29
29
|
*/
|
|
30
30
|
export default class Channel {
|
|
31
31
|
#private;
|
|
32
|
-
_eventEmitter: EventEmitter
|
|
32
|
+
_eventEmitter: EventEmitter<[never]>;
|
|
33
33
|
_pingTimeoutId: NodeJS.Timeout;
|
|
34
34
|
_nextRpcMessageId: number;
|
|
35
35
|
_rpcCallbacks: Map<number, (message: object) => void>;
|
|
@@ -92,8 +92,8 @@ export default class Channel {
|
|
|
92
92
|
* Get current state
|
|
93
93
|
*/
|
|
94
94
|
state(): Promise<{
|
|
95
|
-
calls:
|
|
96
|
-
tag:
|
|
95
|
+
calls: EntUnpacked & {
|
|
96
|
+
tag: EntryTag.CallsMtree;
|
|
97
97
|
};
|
|
98
98
|
halfSignedTx?: TxUnpacked & {
|
|
99
99
|
tag: Tag.SignedTx;
|
|
@@ -101,8 +101,8 @@ export default class Channel {
|
|
|
101
101
|
signedTx?: TxUnpacked & {
|
|
102
102
|
tag: Tag.SignedTx;
|
|
103
103
|
};
|
|
104
|
-
trees:
|
|
105
|
-
tag:
|
|
104
|
+
trees: EntUnpacked & {
|
|
105
|
+
tag: EntryTag.StateTrees;
|
|
106
106
|
};
|
|
107
107
|
}>;
|
|
108
108
|
/**
|
|
@@ -135,8 +135,7 @@ export default class Channel {
|
|
|
135
135
|
* signed state and then terminates.
|
|
136
136
|
*
|
|
137
137
|
* The channel can be reestablished by instantiating another Channel instance
|
|
138
|
-
* with two extra params: existingChannelId and
|
|
139
|
-
* method as channelId and signedTx respectively).
|
|
138
|
+
* with two extra params: existingChannelId and existingFsmId.
|
|
140
139
|
*
|
|
141
140
|
* @example
|
|
142
141
|
* ```js
|
|
@@ -165,5 +164,4 @@ export default class Channel {
|
|
|
165
164
|
* ```
|
|
166
165
|
*/
|
|
167
166
|
shutdown(sign: SignTx): Promise<Encoded.Transaction>;
|
|
168
|
-
static reconnect(options: ChannelOptions, txParams: any): Promise<Channel>;
|
|
169
167
|
}
|