@aeternity/aepp-sdk 12.1.3 → 13.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aesophia_cli +0 -0
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +12031 -11231
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +7 -3
- package/es/AeSdk.mjs +17 -22
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +6 -5
- package/es/AeSdkAepp.mjs +7 -30
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.d.ts +18 -140
- package/es/AeSdkBase.mjs +30 -184
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +123 -0
- package/es/AeSdkMethods.mjs +122 -0
- package/es/AeSdkMethods.mjs.map +1 -0
- package/es/AeSdkWallet.d.ts +7 -21
- package/es/AeSdkWallet.mjs +38 -86
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +11 -15
- package/es/Node.mjs +35 -48
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +24 -40
- package/es/account/Base.mjs +1 -101
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.d.ts +16 -0
- package/es/account/Generalized.mjs +113 -0
- package/es/account/Generalized.mjs.map +1 -0
- package/es/account/Ledger.d.ts +28 -0
- package/es/account/Ledger.mjs +102 -0
- package/es/account/Ledger.mjs.map +1 -0
- package/es/account/LedgerFactory.d.ts +39 -0
- package/es/account/LedgerFactory.mjs +81 -0
- package/es/account/LedgerFactory.mjs.map +1 -0
- package/es/account/Memory.d.ts +13 -17
- package/es/account/Memory.mjs +43 -64
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +6 -8
- package/es/account/Rpc.mjs +14 -32
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +4 -4
- package/es/aens.mjs +46 -41
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +9 -13
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +22 -11
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -31
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +3 -3
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -42
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +7 -1
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.mjs +14 -68
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -3
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.d.ts +23 -29
- package/es/apis/compiler/compiler.mjs +128 -189
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/index.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +82 -135
- package/es/apis/compiler/models/index.mjs +1 -47
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +8 -8
- package/es/apis/compiler/models/mappers.mjs +165 -183
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/compiler/models/parameters.d.ts +0 -1
- package/es/apis/compiler/models/parameters.mjs +5 -9
- package/es/apis/compiler/models/parameters.mjs.map +1 -1
- package/es/apis/node/index.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +48 -48
- package/es/apis/node/models/mappers.mjs +12 -6
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/parameters.mjs.map +1 -1
- package/es/apis/node/node.mjs +43 -84
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +10 -2
- package/es/chain.mjs +37 -59
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +200 -0
- package/es/channel/Base.mjs +293 -0
- package/es/channel/Base.mjs.map +1 -0
- package/es/channel/Contract.d.ts +248 -0
- package/es/channel/Contract.mjs +420 -0
- package/es/channel/Contract.mjs.map +1 -0
- package/es/channel/Spend.d.ts +219 -0
- package/es/channel/Spend.mjs +385 -0
- package/es/channel/Spend.mjs.map +1 -0
- package/es/channel/handlers.d.ts +8 -21
- package/es/channel/handlers.mjs +151 -899
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +27 -21
- package/es/channel/internal.mjs +101 -191
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +210 -0
- package/es/contract/Contract.mjs +551 -0
- package/es/contract/Contract.mjs.map +1 -0
- package/es/contract/compiler/Base.d.ts +81 -0
- package/es/contract/compiler/Base.mjs +5 -0
- package/es/contract/compiler/Base.mjs.map +1 -0
- package/es/contract/compiler/Cli.d.ts +23 -0
- package/es/contract/compiler/Cli.mjs +155 -0
- package/es/contract/compiler/Cli.mjs.map +1 -0
- package/es/contract/compiler/Http.d.ts +32 -0
- package/es/contract/compiler/Http.mjs +118 -0
- package/es/contract/compiler/Http.mjs.map +1 -0
- package/es/contract/compiler/HttpNode.d.ts +17 -0
- package/es/contract/compiler/HttpNode.mjs +26 -0
- package/es/contract/compiler/HttpNode.mjs.map +1 -0
- package/es/contract/compiler/getFileSystem.d.ts +6 -0
- package/es/contract/compiler/getFileSystem.mjs +40 -0
- package/es/contract/compiler/getFileSystem.mjs.map +1 -0
- package/es/contract/ga.d.ts +9 -34
- package/es/contract/ga.mjs +29 -112
- package/es/contract/ga.mjs.map +1 -1
- package/es/index-browser.d.ts +39 -0
- package/es/index-browser.mjs +55 -0
- package/es/index-browser.mjs.map +1 -0
- package/es/index.d.ts +4 -35
- package/es/index.mjs +4 -51
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +5 -5
- package/es/oracle.mjs +34 -40
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +3 -3
- package/es/spend.mjs +18 -23
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/constants.d.ts +30 -2
- package/es/tx/builder/constants.mjs +43 -14
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/abi-version.d.ts +10 -0
- package/es/tx/builder/field-types/abi-version.mjs +20 -0
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -0
- package/es/tx/builder/field-types/address.d.ts +14 -0
- package/es/tx/builder/field-types/address.mjs +51 -0
- package/es/tx/builder/field-types/address.mjs.map +1 -0
- package/es/tx/builder/field-types/array.d.ts +7 -0
- package/es/tx/builder/field-types/array.mjs +11 -0
- package/es/tx/builder/field-types/array.mjs.map +1 -0
- package/es/tx/builder/field-types/boolean.d.ts +6 -0
- package/es/tx/builder/field-types/boolean.mjs +13 -0
- package/es/tx/builder/field-types/boolean.mjs.map +1 -0
- package/es/tx/builder/field-types/coin-amount.d.ts +2 -3
- package/es/tx/builder/field-types/coin-amount.mjs +4 -12
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +30 -0
- package/es/tx/builder/field-types/ct-version.mjs +48 -0
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -0
- package/es/tx/builder/field-types/deposit.d.ts +1 -2
- package/es/tx/builder/field-types/deposit.mjs +2 -4
- package/es/tx/builder/field-types/deposit.mjs.map +1 -1
- package/es/tx/builder/field-types/encoded.d.ts +6 -0
- package/es/tx/builder/field-types/encoded.mjs +21 -0
- package/es/tx/builder/field-types/encoded.mjs.map +1 -0
- package/es/tx/builder/field-types/entry.d.ts +11 -0
- package/es/tx/builder/field-types/entry.mjs +31 -0
- package/es/tx/builder/field-types/entry.mjs.map +1 -0
- package/es/tx/builder/field-types/enumeration.d.ts +7 -0
- package/es/tx/builder/field-types/enumeration.mjs +30 -0
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +10 -15
- package/es/tx/builder/field-types/fee.mjs +31 -43
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/field.mjs +0 -2
- package/es/tx/builder/field-types/field.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.d.ts +5 -2
- package/es/tx/builder/field-types/gas-limit.mjs +12 -14
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +1 -2
- package/es/tx/builder/field-types/gas-price.mjs +3 -7
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +80 -30
- package/es/tx/builder/field-types/index.mjs +34 -9
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/mptree.d.ts +37 -0
- package/es/tx/builder/field-types/mptree.mjs +268 -0
- package/es/tx/builder/field-types/mptree.mjs.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +1 -3
- package/es/tx/builder/field-types/name-fee.mjs +3 -5
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/name-id.d.ts +1 -4
- package/es/tx/builder/field-types/name-id.mjs +5 -10
- package/es/tx/builder/field-types/name-id.mjs.map +1 -1
- package/es/tx/builder/field-types/name.mjs +0 -2
- package/es/tx/builder/field-types/name.mjs.map +1 -1
- package/es/tx/builder/field-types/pointers.d.ts +23 -0
- package/es/tx/builder/field-types/pointers.mjs +36 -0
- package/es/tx/builder/field-types/pointers.mjs.map +1 -0
- package/es/tx/builder/field-types/raw.d.ts +6 -0
- package/es/tx/builder/field-types/raw.mjs +13 -0
- package/es/tx/builder/field-types/raw.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int-const.d.ts +5 -0
- package/es/tx/builder/field-types/short-u-int-const.mjs +16 -0
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.mjs +0 -2
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/string.d.ts +6 -0
- package/es/tx/builder/field-types/string.mjs +10 -0
- package/es/tx/builder/field-types/string.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.d.ts +1 -2
- package/es/tx/builder/field-types/u-int.mjs +3 -4
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/tx/builder/helpers.d.ts +2 -32
- package/es/tx/builder/helpers.mjs +19 -71
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +11 -49
- package/es/tx/builder/index.mjs +57 -337
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +2367 -667
- package/es/tx/builder/schema.mjs +70 -145
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/index.d.ts +4 -49
- package/es/tx/index.mjs +38 -112
- package/es/tx/index.mjs.map +1 -1
- package/es/tx/validator.d.ts +4 -6
- package/es/tx/validator.mjs +104 -90
- package/es/tx/validator.mjs.map +1 -1
- package/es/typings/{@aeternity__argon2-browser → @aeternity__aepp-calldata}/index.d.mjs +0 -0
- package/es/typings/@aeternity__aepp-calldata/index.d.mjs.map +1 -0
- package/es/utils/amount-formatter.mjs +4 -10
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +1 -0
- package/es/utils/autorest.mjs +17 -19
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bignumber.mjs +4 -7
- package/es/utils/bignumber.mjs.map +1 -1
- package/es/utils/bytes.d.ts +0 -17
- package/es/utils/bytes.mjs +6 -35
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +15 -8
- package/es/utils/crypto.mjs +40 -40
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder-types.d.ts +28 -28
- package/es/utils/encoder-types.mjs +0 -1
- package/es/utils/encoder-types.mjs.map +1 -1
- package/es/utils/encoder.d.ts +0 -1
- package/es/utils/encoder.mjs +7 -15
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +15 -14
- package/es/utils/errors.mjs +86 -172
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +27 -19
- package/es/utils/hd-wallet.mjs +42 -26
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs +0 -8
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.d.ts +2 -0
- package/es/utils/keystore.mjs +37 -36
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/other.d.ts +4 -2
- package/es/utils/other.mjs +11 -7
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.mjs +0 -3
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.d.ts +0 -12
- package/es/utils/string.mjs +1 -21
- package/es/utils/string.mjs.map +1 -1
- package/package.json +98 -51
- package/src/AeSdk.ts +15 -11
- package/src/AeSdkAepp.ts +9 -7
- package/src/AeSdkBase.ts +31 -202
- package/src/AeSdkMethods.ts +169 -0
- package/src/AeSdkWallet.ts +16 -47
- package/src/Node.ts +17 -18
- package/src/account/Base.ts +29 -75
- package/src/account/Generalized.ts +98 -0
- package/src/account/Ledger.ts +131 -0
- package/src/account/LedgerFactory.ts +86 -0
- package/src/account/Memory.ts +46 -60
- package/src/account/Rpc.ts +17 -26
- package/src/aens.ts +13 -11
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +21 -9
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +3 -3
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +4 -4
- package/src/aepp-wallet-communication/rpc/types.ts +11 -1
- package/src/aepp-wallet-communication/schema.ts +18 -18
- package/src/apis/compiler/code-model-v4.yaml +681 -888
- package/src/apis/compiler/compiler.ts +113 -154
- package/src/apis/compiler/models/index.ts +80 -140
- package/src/apis/compiler/models/mappers.ts +165 -183
- package/src/apis/compiler/models/parameters.ts +6 -12
- package/src/chain.ts +11 -6
- package/src/channel/Base.ts +335 -0
- package/src/channel/Contract.ts +488 -0
- package/src/channel/Spend.ts +408 -0
- package/src/channel/handlers.ts +164 -582
- package/src/channel/internal.ts +114 -143
- package/src/contract/Contract.ts +610 -0
- package/src/contract/compiler/Base.ts +94 -0
- package/src/contract/compiler/Cli.ts +134 -0
- package/src/contract/compiler/Http.ts +124 -0
- package/src/contract/compiler/HttpNode.ts +26 -0
- package/src/contract/compiler/getFileSystem.ts +42 -0
- package/src/contract/ga.ts +23 -106
- package/src/index-browser.ts +58 -0
- package/src/index.ts +4 -55
- package/src/oracle.ts +8 -8
- package/src/spend.ts +6 -14
- package/src/tx/builder/constants.ts +33 -3
- package/src/tx/builder/field-types/abi-version.ts +21 -0
- package/src/tx/builder/field-types/address.ts +62 -0
- package/src/tx/builder/field-types/array.ts +19 -0
- package/src/tx/builder/field-types/boolean.ts +9 -0
- package/src/tx/builder/field-types/coin-amount.ts +4 -9
- package/src/tx/builder/field-types/ct-version.ts +50 -0
- package/src/tx/builder/field-types/deposit.ts +1 -1
- package/src/tx/builder/field-types/encoded.ts +27 -0
- package/src/tx/builder/field-types/entry.ts +31 -0
- package/src/tx/builder/field-types/enumeration.ts +32 -0
- package/src/tx/builder/field-types/fee.ts +39 -21
- package/src/tx/builder/field-types/gas-limit.ts +13 -8
- package/src/tx/builder/field-types/gas-price.ts +0 -2
- package/src/tx/builder/field-types/index.ts +54 -15
- package/src/tx/builder/field-types/mptree.ts +242 -0
- package/src/tx/builder/field-types/name-fee.ts +2 -3
- package/src/tx/builder/field-types/name-id.ts +7 -10
- package/src/tx/builder/field-types/pointers.ts +41 -0
- package/src/tx/builder/field-types/raw.ts +9 -0
- package/src/tx/builder/field-types/short-u-int-const.ts +20 -0
- package/src/tx/builder/field-types/string.ts +11 -0
- package/src/tx/builder/field-types/u-int.ts +4 -5
- package/src/tx/builder/helpers.ts +10 -60
- package/src/tx/builder/index.ts +65 -308
- package/src/tx/builder/schema.ts +280 -341
- package/src/tx/index.ts +40 -103
- package/src/tx/validator.ts +91 -96
- package/src/typings/@aeternity__aepp-calldata/index.d.ts +20 -0
- package/src/utils/autorest.ts +16 -1
- package/src/utils/bytes.ts +6 -34
- package/src/utils/crypto.ts +23 -16
- package/src/utils/encoder.ts +0 -1
- package/src/utils/errors.ts +22 -25
- package/src/utils/hd-wallet.ts +30 -9
- package/src/utils/keystore.ts +24 -21
- package/src/utils/other.ts +16 -1
- package/src/utils/string.ts +0 -20
- package/types-legacy/ts4.2/AeSdk.d.ts +41 -0
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +71 -0
- package/types-legacy/ts4.2/AeSdkBase.d.ts +91 -0
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +140 -0
- package/types-legacy/ts4.2/AeSdkWallet.d.ts +90 -0
- package/types-legacy/ts4.2/Node.d.ts +78 -0
- package/types-legacy/ts4.2/account/Base.d.ts +52 -0
- package/types-legacy/ts4.2/account/Generalized.d.ts +16 -0
- package/types-legacy/ts4.2/account/Ledger.d.ts +28 -0
- package/types-legacy/ts4.2/account/LedgerFactory.d.ts +39 -0
- package/types-legacy/ts4.2/account/Memory.d.ts +22 -0
- package/types-legacy/ts4.2/account/Rpc.d.ts +25 -0
- package/types-legacy/ts4.2/aens.d.ts +222 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/Browser.d.ts +33 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +19 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection-proxy.d.ts +11 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +83 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +133 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +25 -0
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +86 -0
- package/types-legacy/ts4.2/apis/compiler/index.d.ts +2 -0
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +195 -0
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +23 -0
- package/types-legacy/ts4.2/apis/compiler/models/parameters.d.ts +12 -0
- package/types-legacy/ts4.2/apis/node/index.d.ts +2 -0
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +1065 -0
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +95 -0
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +17 -0
- package/types-legacy/ts4.2/apis/node/node.d.ts +215 -0
- package/types-legacy/ts4.2/chain.d.ts +256 -0
- package/types-legacy/ts4.2/channel/Base.d.ts +199 -0
- package/types-legacy/ts4.2/channel/Contract.d.ts +248 -0
- package/types-legacy/ts4.2/channel/Spend.d.ts +219 -0
- package/types-legacy/ts4.2/channel/handlers.d.ts +21 -0
- package/types-legacy/ts4.2/channel/internal.d.ts +107 -0
- package/types-legacy/ts4.2/contract/Contract.d.ts +212 -0
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +81 -0
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +23 -0
- package/types-legacy/ts4.2/contract/compiler/Http.d.ts +32 -0
- package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +17 -0
- package/types-legacy/ts4.2/contract/compiler/getFileSystem.d.ts +6 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +44 -0
- package/types-legacy/ts4.2/globals.d.ts +16 -0
- package/types-legacy/ts4.2/index-browser.d.ts +39 -0
- package/types-legacy/ts4.2/index.d.ts +5 -0
- package/types-legacy/ts4.2/oracle.d.ts +161 -0
- package/types-legacy/ts4.2/spend.d.ts +62 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +98 -0
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +10 -0
- package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +21 -0
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/boolean.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +12 -0
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +42 -0
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/entry.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +20 -0
- package/types-legacy/ts4.2/tx/builder/field-types/field.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +15 -0
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +129 -0
- package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +43 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +18 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name-id.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name.d.ts +13 -0
- package/types-legacy/ts4.2/tx/builder/field-types/pointers.d.ts +26 -0
- package/types-legacy/ts4.2/tx/builder/field-types/raw.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +5 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/string.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/helpers.d.ts +112 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +50 -0
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +4675 -0
- package/types-legacy/ts4.2/tx/index.d.ts +19 -0
- package/types-legacy/ts4.2/tx/validator.d.ts +18 -0
- package/types-legacy/ts4.2/utils/amount-formatter.d.ts +42 -0
- package/types-legacy/ts4.2/utils/autorest.d.ts +7 -0
- package/types-legacy/ts4.2/utils/bignumber.d.ts +13 -0
- package/types-legacy/ts4.2/utils/bytes.d.ts +9 -0
- package/types-legacy/ts4.2/utils/crypto.d.ts +95 -0
- package/types-legacy/ts4.2/utils/encoder-types.d.ts +61 -0
- package/types-legacy/ts4.2/utils/encoder.d.ts +24 -0
- package/types-legacy/ts4.2/utils/errors.d.ts +475 -0
- package/types-legacy/ts4.2/utils/hd-wallet.d.ts +65 -0
- package/types-legacy/ts4.2/utils/json-big.d.ts +5 -0
- package/types-legacy/ts4.2/utils/keystore.d.ts +53 -0
- package/types-legacy/ts4.2/utils/other.d.ts +31 -0
- package/types-legacy/ts4.2/utils/semver-satisfies.d.ts +1 -0
- package/types-legacy/ts4.2/utils/string.d.ts +12 -0
- package/types-legacy/ts4.5/AeSdk.d.ts +41 -0
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +71 -0
- package/types-legacy/ts4.5/AeSdkBase.d.ts +91 -0
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +140 -0
- package/types-legacy/ts4.5/AeSdkWallet.d.ts +90 -0
- package/types-legacy/ts4.5/Node.d.ts +78 -0
- package/types-legacy/ts4.5/account/Base.d.ts +52 -0
- package/types-legacy/ts4.5/account/Generalized.d.ts +16 -0
- package/types-legacy/ts4.5/account/Ledger.d.ts +28 -0
- package/types-legacy/ts4.5/account/LedgerFactory.d.ts +39 -0
- package/types-legacy/ts4.5/account/Memory.d.ts +22 -0
- package/types-legacy/ts4.5/account/Rpc.d.ts +25 -0
- package/types-legacy/ts4.5/aens.d.ts +222 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/Browser.d.ts +33 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +19 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection-proxy.d.ts +11 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +83 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +133 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +25 -0
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +86 -0
- package/types-legacy/ts4.5/apis/compiler/index.d.ts +2 -0
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +195 -0
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +23 -0
- package/types-legacy/ts4.5/apis/compiler/models/parameters.d.ts +12 -0
- package/types-legacy/ts4.5/apis/node/index.d.ts +2 -0
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +1065 -0
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +95 -0
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +17 -0
- package/types-legacy/ts4.5/apis/node/node.d.ts +215 -0
- package/types-legacy/ts4.5/chain.d.ts +256 -0
- package/types-legacy/ts4.5/channel/Base.d.ts +199 -0
- package/types-legacy/ts4.5/channel/Contract.d.ts +248 -0
- package/types-legacy/ts4.5/channel/Spend.d.ts +219 -0
- package/types-legacy/ts4.5/channel/handlers.d.ts +21 -0
- package/types-legacy/ts4.5/channel/internal.d.ts +107 -0
- package/types-legacy/ts4.5/contract/Contract.d.ts +212 -0
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +81 -0
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +23 -0
- package/types-legacy/ts4.5/contract/compiler/Http.d.ts +32 -0
- package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +17 -0
- package/types-legacy/ts4.5/contract/compiler/getFileSystem.d.ts +6 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +44 -0
- package/types-legacy/ts4.5/index-browser.d.ts +39 -0
- package/types-legacy/ts4.5/index.d.ts +4 -0
- package/types-legacy/ts4.5/oracle.d.ts +161 -0
- package/types-legacy/ts4.5/spend.d.ts +62 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +98 -0
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +10 -0
- package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +21 -0
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/boolean.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +12 -0
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +42 -0
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/entry.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +20 -0
- package/types-legacy/ts4.5/tx/builder/field-types/field.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +15 -0
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +129 -0
- package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +43 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +18 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name-id.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name.d.ts +13 -0
- package/types-legacy/ts4.5/tx/builder/field-types/pointers.d.ts +26 -0
- package/types-legacy/ts4.5/tx/builder/field-types/raw.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +5 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/string.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/helpers.d.ts +112 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +50 -0
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +4675 -0
- package/types-legacy/ts4.5/tx/index.d.ts +19 -0
- package/types-legacy/ts4.5/tx/validator.d.ts +18 -0
- package/types-legacy/ts4.5/utils/amount-formatter.d.ts +42 -0
- package/types-legacy/ts4.5/utils/autorest.d.ts +7 -0
- package/types-legacy/ts4.5/utils/bignumber.d.ts +13 -0
- package/types-legacy/ts4.5/utils/bytes.d.ts +9 -0
- package/types-legacy/ts4.5/utils/crypto.d.ts +95 -0
- package/types-legacy/ts4.5/utils/encoder-types.d.ts +61 -0
- package/types-legacy/ts4.5/utils/encoder.d.ts +24 -0
- package/types-legacy/ts4.5/utils/errors.d.ts +475 -0
- package/types-legacy/ts4.5/utils/hd-wallet.d.ts +65 -0
- package/types-legacy/ts4.5/utils/json-big.d.ts +5 -0
- package/types-legacy/ts4.5/utils/keystore.d.ts +53 -0
- package/types-legacy/ts4.5/utils/other.d.ts +31 -0
- package/types-legacy/ts4.5/utils/semver-satisfies.d.ts +1 -0
- package/types-legacy/ts4.5/utils/string.d.ts +12 -0
- package/es/channel/index.d.ts +0 -625
- package/es/channel/index.mjs +0 -975
- package/es/channel/index.mjs.map +0 -1
- package/es/contract/Compiler.d.ts +0 -18
- package/es/contract/Compiler.mjs +0 -68
- package/es/contract/Compiler.mjs.map +0 -1
- package/es/contract/aci.d.ts +0 -127
- package/es/contract/aci.mjs +0 -508
- package/es/contract/aci.mjs.map +0 -1
- package/es/contract/methods.d.ts +0 -71
- package/es/contract/methods.mjs +0 -104
- package/es/contract/methods.mjs.map +0 -1
- package/es/deprecated/index.d.ts +0 -143
- package/es/deprecated/index.mjs +0 -162
- package/es/deprecated/index.mjs.map +0 -1
- package/es/deprecated/methods.d.ts +0 -18
- package/es/deprecated/methods.mjs +0 -26
- package/es/deprecated/methods.mjs.map +0 -1
- package/es/tx/builder/address.d.ts +0 -25
- package/es/tx/builder/address.mjs +0 -45
- package/es/tx/builder/address.mjs.map +0 -1
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +0 -1
- package/es/utils/mptree.d.ts +0 -26
- package/es/utils/mptree.mjs +0 -165
- package/es/utils/mptree.mjs.map +0 -1
- package/src/channel/index.ts +0 -1025
- package/src/contract/Compiler.ts +0 -67
- package/src/contract/aci.ts +0 -537
- package/src/contract/methods.ts +0 -123
- package/src/deprecated/index.ts +0 -172
- package/src/deprecated/methods.ts +0 -25
- package/src/tx/builder/address.ts +0 -50
- package/src/typings/@aeternity__argon2-browser/index.d.ts +0 -3
- package/src/utils/mptree.ts +0 -145
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type Transport from '@ledgerhq/hw-transport';
|
|
2
|
+
import AccountBase from './Base';
|
|
3
|
+
import { ArgumentError, NotImplementedError } from '../utils/errors';
|
|
4
|
+
import { decode, Encoded } from '../utils/encoder';
|
|
5
|
+
import { buildTx } from '../tx/builder';
|
|
6
|
+
import { Tag } from '../tx/builder/constants';
|
|
7
|
+
|
|
8
|
+
export const CLA = 0xe0;
|
|
9
|
+
export const GET_ADDRESS = 0x02;
|
|
10
|
+
export const SIGN_TRANSACTION = 0x04;
|
|
11
|
+
export const GET_APP_CONFIGURATION = 0x06;
|
|
12
|
+
export const SIGN_PERSONAL_MESSAGE = 0x08;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Ledger wallet account class
|
|
16
|
+
*/
|
|
17
|
+
export default class AccountLedger extends AccountBase {
|
|
18
|
+
readonly transport: Transport;
|
|
19
|
+
|
|
20
|
+
override readonly address: Encoded.AccountAddress;
|
|
21
|
+
|
|
22
|
+
readonly index: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param transport - Connection to Ledger to use
|
|
26
|
+
* @param index - Index of account
|
|
27
|
+
* @param address - Address of account
|
|
28
|
+
*/
|
|
29
|
+
constructor(transport: Transport, index: number, address: Encoded.AccountAddress) {
|
|
30
|
+
super();
|
|
31
|
+
this.transport = transport;
|
|
32
|
+
this.index = index;
|
|
33
|
+
this.address = address;
|
|
34
|
+
const scrambleKey = 'w0w';
|
|
35
|
+
transport.decorateAppAPIMethods(this, ['signTransaction', 'signMessage'], scrambleKey);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line class-methods-use-this
|
|
39
|
+
override async sign(): Promise<Uint8Array> {
|
|
40
|
+
throw new NotImplementedError('RAW signing using Ledger HW');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override async signTransaction(
|
|
44
|
+
tx: Encoded.Transaction,
|
|
45
|
+
{ innerTx, networkId }: { innerTx?: boolean; networkId?: string } = {},
|
|
46
|
+
): Promise<Encoded.Transaction> {
|
|
47
|
+
if (innerTx != null) throw new NotImplementedError('innerTx option in AccountLedger');
|
|
48
|
+
if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);
|
|
49
|
+
|
|
50
|
+
const rawTx = decode(tx);
|
|
51
|
+
let offset = 0;
|
|
52
|
+
const headerLength = 4 + 1 + 4;
|
|
53
|
+
const networkIdBuffer = Buffer.from(networkId);
|
|
54
|
+
const toSend = [];
|
|
55
|
+
while (offset !== rawTx.length) {
|
|
56
|
+
const maxChunkSize = offset === 0 ? 150 - headerLength - networkIdBuffer.length : 150;
|
|
57
|
+
const chunkSize = offset + maxChunkSize > rawTx.length
|
|
58
|
+
? rawTx.length - offset : maxChunkSize;
|
|
59
|
+
const buffer = Buffer.alloc(
|
|
60
|
+
offset === 0 ? headerLength + networkIdBuffer.length + chunkSize : chunkSize,
|
|
61
|
+
);
|
|
62
|
+
if (offset === 0) {
|
|
63
|
+
let bufferOffset = buffer.writeUInt32BE(this.index, 0);
|
|
64
|
+
bufferOffset = buffer.writeUInt32BE(rawTx.length, bufferOffset);
|
|
65
|
+
bufferOffset = buffer.writeUInt8(networkIdBuffer.length, bufferOffset);
|
|
66
|
+
bufferOffset += networkIdBuffer.copy(
|
|
67
|
+
buffer,
|
|
68
|
+
bufferOffset,
|
|
69
|
+
0,
|
|
70
|
+
networkIdBuffer.length,
|
|
71
|
+
);
|
|
72
|
+
rawTx.copy(buffer, bufferOffset, 0, 150 - bufferOffset);
|
|
73
|
+
} else {
|
|
74
|
+
rawTx.copy(buffer, 0, offset, offset + chunkSize);
|
|
75
|
+
}
|
|
76
|
+
toSend.push(buffer);
|
|
77
|
+
offset += chunkSize;
|
|
78
|
+
}
|
|
79
|
+
const response = await toSend.reduce(
|
|
80
|
+
async (previous, data, i) => {
|
|
81
|
+
await previous;
|
|
82
|
+
return this.transport.send(
|
|
83
|
+
CLA,
|
|
84
|
+
SIGN_TRANSACTION,
|
|
85
|
+
i === 0 ? 0x00 : 0x80,
|
|
86
|
+
0x00,
|
|
87
|
+
data,
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
Promise.resolve(Buffer.alloc(0)),
|
|
91
|
+
);
|
|
92
|
+
const signatures = [response.subarray(0, 64)];
|
|
93
|
+
|
|
94
|
+
return buildTx({ tag: Tag.SignedTx, encodedTx: rawTx, signatures });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
override async signMessage(messageStr: string): Promise<Uint8Array> {
|
|
98
|
+
let offset = 0;
|
|
99
|
+
const message = Buffer.from(messageStr);
|
|
100
|
+
const toSend = [];
|
|
101
|
+
while (offset !== message.length) {
|
|
102
|
+
const maxChunkSize = offset === 0 ? 150 - 4 - 4 : 150;
|
|
103
|
+
const chunkSize = offset + maxChunkSize > message.length
|
|
104
|
+
? message.length - offset : maxChunkSize;
|
|
105
|
+
const buffer = Buffer.alloc(offset === 0 ? 4 + 4 + chunkSize : chunkSize);
|
|
106
|
+
if (offset === 0) {
|
|
107
|
+
buffer.writeUInt32BE(this.index, 0);
|
|
108
|
+
buffer.writeUInt32BE(message.length, 4);
|
|
109
|
+
message.copy(buffer, 4 + 4, offset, offset + chunkSize);
|
|
110
|
+
} else {
|
|
111
|
+
message.copy(buffer, 0, offset, offset + chunkSize);
|
|
112
|
+
}
|
|
113
|
+
toSend.push(buffer);
|
|
114
|
+
offset += chunkSize;
|
|
115
|
+
}
|
|
116
|
+
const response = await toSend.reduce(
|
|
117
|
+
async (previous, data, i) => {
|
|
118
|
+
await previous;
|
|
119
|
+
return this.transport.send(
|
|
120
|
+
CLA,
|
|
121
|
+
SIGN_PERSONAL_MESSAGE,
|
|
122
|
+
i === 0 ? 0x00 : 0x80,
|
|
123
|
+
0x00,
|
|
124
|
+
data,
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
Promise.resolve(Buffer.alloc(0)),
|
|
128
|
+
);
|
|
129
|
+
return response.subarray(0, 64);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type Transport from '@ledgerhq/hw-transport';
|
|
2
|
+
import AccountLedger, { CLA, GET_ADDRESS, GET_APP_CONFIGURATION } from './Ledger';
|
|
3
|
+
import { UnsupportedVersionError } from '../utils/errors';
|
|
4
|
+
import { Encoded } from '../utils/encoder';
|
|
5
|
+
import semverSatisfies from '../utils/semver-satisfies';
|
|
6
|
+
import Node from '../Node';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A factory class that generates instances of AccountLedger based on provided transport.
|
|
10
|
+
*/
|
|
11
|
+
export default class AccountLedgerFactory {
|
|
12
|
+
readonly transport: Transport;
|
|
13
|
+
|
|
14
|
+
private readonly versionCheckPromise: Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param transport - Connection to Ledger to use
|
|
18
|
+
*/
|
|
19
|
+
constructor(transport: Transport) {
|
|
20
|
+
this.transport = transport;
|
|
21
|
+
this.versionCheckPromise = this.getAppConfiguration().then(({ version }) => {
|
|
22
|
+
const args = [version, '0.4.4', '0.5.0'] as const;
|
|
23
|
+
if (!semverSatisfies(...args)) throw new UnsupportedVersionError('app on ledger', ...args);
|
|
24
|
+
});
|
|
25
|
+
const scrambleKey = 'w0w';
|
|
26
|
+
transport.decorateAppAPIMethods(this, ['getAddress', 'getAppConfiguration'], scrambleKey);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @returns the version of app installed on Ledger wallet
|
|
31
|
+
*/
|
|
32
|
+
async getAppConfiguration(): Promise<{ version: string }> {
|
|
33
|
+
await this.versionCheckPromise;
|
|
34
|
+
const response = await this.transport.send(CLA, GET_APP_CONFIGURATION, 0x00, 0x00);
|
|
35
|
+
return {
|
|
36
|
+
version: [response[1], response[2], response[3]].join('.'),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get `ak_`-prefixed address for a given account index.
|
|
42
|
+
* @param accountIndex - Index of account
|
|
43
|
+
* @param verify - Ask user to confirm address by showing it on the device screen
|
|
44
|
+
*/
|
|
45
|
+
async getAddress(accountIndex: number, verify = false): Promise<Encoded.AccountAddress> {
|
|
46
|
+
await this.versionCheckPromise;
|
|
47
|
+
const buffer = Buffer.alloc(4);
|
|
48
|
+
buffer.writeUInt32BE(accountIndex, 0);
|
|
49
|
+
const response = await this.transport.send(
|
|
50
|
+
CLA,
|
|
51
|
+
GET_ADDRESS,
|
|
52
|
+
verify ? 0x01 : 0x00,
|
|
53
|
+
0x00,
|
|
54
|
+
buffer,
|
|
55
|
+
);
|
|
56
|
+
const addressLength = response[0];
|
|
57
|
+
return response.subarray(1, 1 + addressLength).toString('ascii') as Encoded.AccountAddress;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get an instance of AccountLedger for a given account index.
|
|
62
|
+
* @param accountIndex - Index of account
|
|
63
|
+
*/
|
|
64
|
+
async initialize(accountIndex: number): Promise<AccountLedger> {
|
|
65
|
+
await this.versionCheckPromise;
|
|
66
|
+
return new AccountLedger(this.transport, accountIndex, await this.getAddress(accountIndex));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Discovers accounts on Ledger that already have been used (has any on-chain transactions).
|
|
71
|
+
* It returns an empty array if none of accounts been used.
|
|
72
|
+
* If a used account is preceded by an unused account then it would be ignored.
|
|
73
|
+
* @param node - Instance of Node to get account information from
|
|
74
|
+
*/
|
|
75
|
+
async discover(node: Node): Promise<AccountLedger[]> {
|
|
76
|
+
let index = 0;
|
|
77
|
+
const result = [];
|
|
78
|
+
let account;
|
|
79
|
+
do {
|
|
80
|
+
if (account != null) result.push(account);
|
|
81
|
+
account = await this.initialize(index);
|
|
82
|
+
index += 1;
|
|
83
|
+
} while (await node.getAccountByPubkey(account.address).then(() => true, () => false));
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/account/Memory.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ISC License (ISC)
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2022 aeternity developers
|
|
4
4
|
*
|
|
5
5
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
6
|
* purpose with or without fee is hereby granted, provided that the above
|
|
@@ -15,84 +15,70 @@
|
|
|
15
15
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
*/
|
|
17
17
|
import AccountBase from './Base';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
generateKeyPairFromSecret, sign, generateKeyPair, hash, messageToHash,
|
|
20
|
+
} from '../utils/crypto';
|
|
21
|
+
import { ArgumentError } from '../utils/errors';
|
|
22
|
+
import {
|
|
23
|
+
decode, encode, Encoded, Encoding,
|
|
24
|
+
} from '../utils/encoder';
|
|
25
|
+
import { concatBuffers } from '../utils/other';
|
|
26
|
+
import { buildTx } from '../tx/builder';
|
|
27
|
+
import { Tag } from '../tx/builder/constants';
|
|
23
28
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
export interface Keypair {
|
|
27
|
-
publicKey: Encoded.AccountAddress;
|
|
28
|
-
secretKey: string | Uint8Array;
|
|
29
|
-
}
|
|
29
|
+
const secretKeys = new WeakMap();
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* In-memory account class
|
|
33
33
|
*/
|
|
34
34
|
export default class AccountMemory extends AccountBase {
|
|
35
|
-
|
|
35
|
+
override readonly address: Encoded.AccountAddress;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @param
|
|
39
|
-
* @param options.keypair - Key pair to use
|
|
40
|
-
* @param options.keypair.publicKey - Public key
|
|
41
|
-
* @param options.keypair.secretKey - Private key
|
|
42
|
-
* @param options.gaId - Address of generalized account
|
|
38
|
+
* @param secretKey - Secret key
|
|
43
39
|
*/
|
|
44
|
-
constructor(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.isGa = gaId != null;
|
|
51
|
-
if (this.isGa && gaId != null) {
|
|
52
|
-
decode(gaId);
|
|
53
|
-
secrets.set(this, { publicKey: gaId });
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (keypair == null) throw new MissingParamError('Either gaId or keypair is required');
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
!Buffer.isBuffer(keypair.secretKey)
|
|
61
|
-
&& typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey)
|
|
62
|
-
) throw new InvalidKeypairError('Secret key must be hex string or Buffer');
|
|
63
|
-
const secretKey = typeof keypair.secretKey === 'string'
|
|
64
|
-
? Buffer.from(keypair.secretKey, 'hex')
|
|
65
|
-
: keypair.secretKey;
|
|
66
|
-
if (!isValidKeypair(secretKey, decode(keypair.publicKey))) {
|
|
67
|
-
throw new InvalidKeypairError('Invalid Key Pair');
|
|
40
|
+
constructor(secretKey: string | Uint8Array) {
|
|
41
|
+
super();
|
|
42
|
+
secretKey = typeof secretKey === 'string' ? Buffer.from(secretKey, 'hex') : secretKey;
|
|
43
|
+
if (secretKey.length !== 64) {
|
|
44
|
+
throw new ArgumentError('secretKey', '64 bytes', secretKey.length);
|
|
68
45
|
}
|
|
46
|
+
secretKeys.set(this, secretKey);
|
|
47
|
+
this.address = encode(
|
|
48
|
+
generateKeyPairFromSecret(secretKeys.get(this)).publicKey,
|
|
49
|
+
Encoding.AccountAddress,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
69
52
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Generates a new AccountMemory using a random secret key
|
|
55
|
+
*/
|
|
56
|
+
static generate(): AccountMemory {
|
|
57
|
+
return new AccountMemory(generateKeyPair().secretKey);
|
|
74
58
|
}
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return sign(data,
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
|
+
override async sign(data: string | Uint8Array, options?: any): Promise<Uint8Array> {
|
|
62
|
+
return sign(data, secretKeys.get(this));
|
|
79
63
|
}
|
|
80
64
|
|
|
81
|
-
async signTransaction(
|
|
65
|
+
override async signTransaction(
|
|
82
66
|
tx: Encoded.Transaction,
|
|
83
|
-
options:
|
|
67
|
+
{ innerTx, networkId, ...options }: { innerTx?: boolean; networkId?: string } = {},
|
|
84
68
|
): Promise<Encoded.Transaction> {
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
authData, authFun, onCompiler, onNode,
|
|
88
|
-
} = options;
|
|
89
|
-
if (authFun == null || authData == null || onCompiler == null || onNode == null) {
|
|
90
|
-
throw new ArgumentError('authData, authFun, onCompiler, onNode', 'provided', null);
|
|
69
|
+
if (networkId == null) {
|
|
70
|
+
throw new ArgumentError('networkId', 'provided', networkId);
|
|
91
71
|
}
|
|
92
|
-
|
|
72
|
+
const prefixes = [networkId];
|
|
73
|
+
if (innerTx === true) prefixes.push('inner_tx');
|
|
74
|
+
const rlpBinaryTx = decode(tx);
|
|
75
|
+
const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
|
|
76
|
+
|
|
77
|
+
const signatures = [await this.sign(txWithNetworkId, options)];
|
|
78
|
+
return buildTx({ tag: Tag.SignedTx, encodedTx: rlpBinaryTx, signatures });
|
|
93
79
|
}
|
|
94
80
|
|
|
95
|
-
async
|
|
96
|
-
return
|
|
81
|
+
override async signMessage(message: string, options?: any): Promise<Uint8Array> {
|
|
82
|
+
return this.sign(messageToHash(message), options);
|
|
97
83
|
}
|
|
98
84
|
}
|
package/src/account/Rpc.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import AccountBase from './Base';
|
|
2
2
|
import { METHODS } from '../aepp-wallet-communication/schema';
|
|
3
|
-
import { NotImplementedError } from '../utils/errors';
|
|
3
|
+
import { ArgumentError, NotImplementedError, UnsupportedProtocolError } from '../utils/errors';
|
|
4
4
|
import { Encoded } from '../utils/encoder';
|
|
5
|
+
import RpcClient from '../aepp-wallet-communication/rpc/RpcClient';
|
|
6
|
+
import { AeppApi, WalletApi } from '../aepp-wallet-communication/rpc/types';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Account provided by wallet
|
|
@@ -11,17 +13,14 @@ import { Encoded } from '../utils/encoder';
|
|
|
11
13
|
* @returns AccountRpc instance
|
|
12
14
|
*/
|
|
13
15
|
export default class AccountRpc extends AccountBase {
|
|
14
|
-
_rpcClient:
|
|
16
|
+
_rpcClient: RpcClient<WalletApi, AeppApi>;
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
override readonly address: Encoded.AccountAddress;
|
|
17
19
|
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
20
|
-
& ConstructorParameters<typeof AccountBase>[0],
|
|
21
|
-
) {
|
|
22
|
-
super(options);
|
|
20
|
+
constructor(rpcClient: RpcClient<WalletApi, AeppApi>, address: Encoded.AccountAddress) {
|
|
21
|
+
super();
|
|
23
22
|
this._rpcClient = rpcClient;
|
|
24
|
-
this.
|
|
23
|
+
this.address = address;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -29,41 +28,33 @@ export default class AccountRpc extends AccountBase {
|
|
|
29
28
|
throw new NotImplementedError('RAW signing using wallet');
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
async address(): Promise<Encoded.AccountAddress> {
|
|
33
|
-
return this._address;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
31
|
/**
|
|
37
32
|
* @returns Signed transaction
|
|
38
33
|
*/
|
|
39
|
-
async signTransaction(
|
|
34
|
+
override async signTransaction(
|
|
40
35
|
tx: Encoded.Transaction,
|
|
41
36
|
{ innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},
|
|
42
37
|
): Promise<Encoded.Transaction> {
|
|
43
38
|
if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');
|
|
39
|
+
if (networkId == null) throw new ArgumentError('networkId', 'provided', networkId);
|
|
44
40
|
const res = await this._rpcClient.request(METHODS.sign, {
|
|
45
|
-
onAccount: this.
|
|
41
|
+
onAccount: this.address,
|
|
46
42
|
tx,
|
|
47
43
|
returnSigned: true,
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Wallet provided networkId will be used (current network)
|
|
50
|
-
* required to maintain backward compatibility with wallets using SDK v11.0.1 and below
|
|
51
|
-
* @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}
|
|
52
|
-
*/
|
|
53
44
|
networkId,
|
|
54
45
|
});
|
|
46
|
+
if (res.signedTransaction == null) {
|
|
47
|
+
throw new UnsupportedProtocolError('signedTransaction is missed in wallet response');
|
|
48
|
+
}
|
|
55
49
|
return res.signedTransaction;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
/**
|
|
59
53
|
* @returns Signed message
|
|
60
54
|
*/
|
|
61
|
-
async signMessage(
|
|
62
|
-
message: string,
|
|
63
|
-
{ returnHex = false }: Parameters<AccountBase['signMessage']>[1] = {},
|
|
64
|
-
): Promise<string | Uint8Array> {
|
|
55
|
+
override async signMessage(message: string): Promise<Uint8Array> {
|
|
65
56
|
const { signature } = await this._rpcClient
|
|
66
|
-
.request(METHODS.signMessage, { onAccount: this.
|
|
67
|
-
return
|
|
57
|
+
.request(METHODS.signMessage, { onAccount: this.address, message });
|
|
58
|
+
return Buffer.from(signature, 'hex');
|
|
68
59
|
}
|
|
69
60
|
}
|
package/src/aens.ts
CHANGED
|
@@ -37,9 +37,10 @@ import { _buildTx, BuildTxOptions } from './tx';
|
|
|
37
37
|
import { TransformNodeType } from './Node';
|
|
38
38
|
import { NameEntry, NamePointer } from './apis/node';
|
|
39
39
|
import AccountBase from './account/Base';
|
|
40
|
+
import { AddressEncodings } from './tx/builder/field-types/address';
|
|
40
41
|
|
|
41
42
|
interface KeyPointers {
|
|
42
|
-
[key: string]:
|
|
43
|
+
[key: string]: Encoded.Generic<AddressEncodings>;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -70,7 +71,7 @@ export async function aensRevoke(
|
|
|
70
71
|
const nameRevokeTx = await _buildTx(Tag.NameRevokeTx, {
|
|
71
72
|
...options,
|
|
72
73
|
nameId: name,
|
|
73
|
-
accountId:
|
|
74
|
+
accountId: options.onAccount.address,
|
|
74
75
|
});
|
|
75
76
|
return send(nameRevokeTx, options);
|
|
76
77
|
}
|
|
@@ -115,8 +116,7 @@ export async function aensUpdate(
|
|
|
115
116
|
): ReturnType<typeof send> {
|
|
116
117
|
const allPointers = {
|
|
117
118
|
...extendPointers === true && Object.fromEntries(
|
|
118
|
-
(await getName(name, options)).pointers
|
|
119
|
-
.map(({ key, id }: { key: string; id: string }) => [key, id]),
|
|
119
|
+
(await getName(name, options)).pointers.map(({ key, id }) => [key, id]),
|
|
120
120
|
),
|
|
121
121
|
...pointers,
|
|
122
122
|
};
|
|
@@ -126,8 +126,9 @@ export async function aensUpdate(
|
|
|
126
126
|
nameTtl: NAME_TTL,
|
|
127
127
|
...options,
|
|
128
128
|
nameId: name,
|
|
129
|
-
accountId:
|
|
130
|
-
pointers: Object.entries(allPointers)
|
|
129
|
+
accountId: options.onAccount.address,
|
|
130
|
+
pointers: Object.entries(allPointers)
|
|
131
|
+
.map(([key, id]: [string, Encoded.Generic<AddressEncodings>]) => ({ key, id })),
|
|
131
132
|
});
|
|
132
133
|
|
|
133
134
|
return send(nameUpdateTx, options);
|
|
@@ -172,7 +173,7 @@ export async function aensTransfer(
|
|
|
172
173
|
const nameTransferTx = await _buildTx(Tag.NameTransferTx, {
|
|
173
174
|
...options,
|
|
174
175
|
nameId: name,
|
|
175
|
-
accountId:
|
|
176
|
+
accountId: options.onAccount.address,
|
|
176
177
|
recipientId: account,
|
|
177
178
|
});
|
|
178
179
|
|
|
@@ -298,7 +299,7 @@ export async function aensClaim(
|
|
|
298
299
|
): Promise<AensClaimReturnType> {
|
|
299
300
|
const claimTx = await _buildTx(Tag.NameClaimTx, {
|
|
300
301
|
...options,
|
|
301
|
-
accountId:
|
|
302
|
+
accountId: options.onAccount.address,
|
|
302
303
|
nameSalt: salt,
|
|
303
304
|
name,
|
|
304
305
|
});
|
|
@@ -358,7 +359,7 @@ Awaited<ReturnType<typeof send>> & {
|
|
|
358
359
|
|
|
359
360
|
const preclaimTx = await _buildTx(Tag.NamePreclaimTx, {
|
|
360
361
|
...options,
|
|
361
|
-
accountId:
|
|
362
|
+
accountId: options.onAccount.address,
|
|
362
363
|
commitmentId,
|
|
363
364
|
});
|
|
364
365
|
|
|
@@ -368,7 +369,8 @@ Awaited<ReturnType<typeof send>> & {
|
|
|
368
369
|
salt,
|
|
369
370
|
commitmentId,
|
|
370
371
|
async claim(opts?: Parameters<typeof aensClaim>[2]) {
|
|
371
|
-
|
|
372
|
+
const { version, ...otherOptions } = options;
|
|
373
|
+
return aensClaim(name, salt, { ...otherOptions, ...opts });
|
|
372
374
|
},
|
|
373
375
|
});
|
|
374
376
|
}
|
|
@@ -376,7 +378,7 @@ Awaited<ReturnType<typeof send>> & {
|
|
|
376
378
|
interface AensPreclaimOptions extends
|
|
377
379
|
BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId'>,
|
|
378
380
|
SendOptions,
|
|
379
|
-
AensClaimOptions {}
|
|
381
|
+
Omit<AensClaimOptions, 'version'> {}
|
|
380
382
|
|
|
381
383
|
/**
|
|
382
384
|
* Bid to name auction
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { Runtime } from 'webextension-polyfill';
|
|
19
19
|
import BrowserConnection from './Browser';
|
|
20
|
+
import { UnexpectedTsError } from '../../utils/errors';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* BrowserRuntimeConnection
|
|
@@ -26,34 +27,45 @@ import BrowserConnection from './Browser';
|
|
|
26
27
|
export default class BrowserRuntimeConnection extends BrowserConnection {
|
|
27
28
|
port: Runtime.Port;
|
|
28
29
|
|
|
30
|
+
#listeners?: [(message: any, port: Runtime.Port) => void, () => void];
|
|
31
|
+
|
|
29
32
|
constructor({ port, ...options }: { port: Runtime.Port; debug: boolean }) {
|
|
30
33
|
super(options);
|
|
31
34
|
this.port = port;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
disconnect(): void {
|
|
37
|
+
override disconnect(): void {
|
|
35
38
|
super.disconnect();
|
|
36
39
|
this.port.disconnect();
|
|
40
|
+
if (this.#listeners == null) throw new UnexpectedTsError();
|
|
41
|
+
this.port.onMessage.removeListener(this.#listeners[0]);
|
|
42
|
+
this.port.onDisconnect.removeListener(this.#listeners[1]);
|
|
43
|
+
this.#listeners = undefined;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
connect(
|
|
46
|
+
override connect(
|
|
40
47
|
onMessage: (message: any, origin: string, source: Runtime.Port) => void,
|
|
41
48
|
onDisconnect: () => void,
|
|
42
49
|
): void {
|
|
43
50
|
super.connect(onMessage, onDisconnect);
|
|
44
|
-
this
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
this.#listeners = [
|
|
52
|
+
(message, port) => {
|
|
53
|
+
this.receiveMessage(message);
|
|
54
|
+
// TODO: make `origin` optional because sender url is not available on aepp side
|
|
55
|
+
onMessage(message, port.sender?.url ?? '', port);
|
|
56
|
+
},
|
|
57
|
+
onDisconnect,
|
|
58
|
+
];
|
|
59
|
+
this.port.onMessage.addListener(this.#listeners[0]);
|
|
60
|
+
this.port.onDisconnect.addListener(this.#listeners[1]);
|
|
49
61
|
}
|
|
50
62
|
|
|
51
|
-
sendMessage(message: any): void {
|
|
63
|
+
override sendMessage(message: any): void {
|
|
52
64
|
super.sendMessage(message);
|
|
53
65
|
this.port.postMessage(message);
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
isConnected(): boolean {
|
|
57
|
-
return this
|
|
69
|
+
return this.#listeners != null;
|
|
58
70
|
}
|
|
59
71
|
}
|
|
@@ -77,7 +77,7 @@ export default class BrowserWindowMessageConnection extends BrowserConnection {
|
|
|
77
77
|
return this.listener != null;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
connect(
|
|
80
|
+
override connect(
|
|
81
81
|
onMessage: (message: any, origin: string, source: MessageEventSource | null) => void,
|
|
82
82
|
onDisconnect: () => void,
|
|
83
83
|
): void {
|
|
@@ -102,7 +102,7 @@ export default class BrowserWindowMessageConnection extends BrowserConnection {
|
|
|
102
102
|
this.#onDisconnect = onDisconnect;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
disconnect(): void {
|
|
105
|
+
override disconnect(): void {
|
|
106
106
|
super.disconnect();
|
|
107
107
|
if (this.listener == null || this.#onDisconnect == null) {
|
|
108
108
|
throw new InternalError('Expected to not happen, required for TS');
|
|
@@ -113,7 +113,7 @@ export default class BrowserWindowMessageConnection extends BrowserConnection {
|
|
|
113
113
|
this.#onDisconnect = undefined;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
sendMessage(msg: any): void {
|
|
116
|
+
override sendMessage(msg: any): void {
|
|
117
117
|
if (this.#target == null) throw new RpcConnectionError('Can\'t send messages without target');
|
|
118
118
|
const message = this.sendDirection != null ? { type: this.sendDirection, data: msg } : msg;
|
|
119
119
|
super.sendMessage(message);
|
|
@@ -63,8 +63,8 @@ export default class RpcClient <
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const request = msg as JsonRpcRequest;
|
|
66
|
-
let result;
|
|
67
|
-
|
|
66
|
+
let result;
|
|
67
|
+
let error;
|
|
68
68
|
try {
|
|
69
69
|
if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError();
|
|
70
70
|
const methodName = request.method as keyof LocalApi;
|
|
@@ -94,13 +94,13 @@ export default class RpcClient <
|
|
|
94
94
|
id: number,
|
|
95
95
|
method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC
|
|
96
96
|
result?: any,
|
|
97
|
-
error?:
|
|
97
|
+
error?: RpcError,
|
|
98
98
|
): void {
|
|
99
99
|
this.connection.sendMessage({
|
|
100
100
|
jsonrpc: '2.0',
|
|
101
101
|
id,
|
|
102
102
|
method,
|
|
103
|
-
...error != null ? { error } : { result },
|
|
103
|
+
...error != null ? { error: error.toJSON() } : { result },
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -43,7 +43,17 @@ export interface WalletApi {
|
|
|
43
43
|
[METHODS.address]: () => Promise<Encoded.AccountAddress[]>;
|
|
44
44
|
|
|
45
45
|
[METHODS.sign]: ((
|
|
46
|
-
p: {
|
|
46
|
+
p: {
|
|
47
|
+
tx: Encoded.Transaction;
|
|
48
|
+
onAccount: Encoded.AccountAddress;
|
|
49
|
+
returnSigned: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Wallet provided networkId will be used (current network)
|
|
52
|
+
* required to maintain backward compatibility with wallets using SDK v11.0.1 and below
|
|
53
|
+
* @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}
|
|
54
|
+
*/
|
|
55
|
+
networkId: string;
|
|
56
|
+
}
|
|
47
57
|
) => Promise<{
|
|
48
58
|
/**
|
|
49
59
|
* @deprecated this is not a hash at all, will be removed later at the same time
|