@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
package/src/tx/builder/schema.ts
CHANGED
|
@@ -8,10 +8,12 @@ import BigNumber from 'bignumber.js';
|
|
|
8
8
|
import { Tag } from './constants';
|
|
9
9
|
import {
|
|
10
10
|
Field, uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,
|
|
11
|
+
address, pointers, entry, enumeration, mptree, shortUIntConst, string, encoded, raw,
|
|
12
|
+
array, boolean, ctVersion, abiVersion,
|
|
11
13
|
} from './field-types';
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
14
|
+
import { Encoding } from '../../utils/encoder';
|
|
15
|
+
import { UnionToIntersection } from '../../utils/other';
|
|
16
|
+
import { idTagToEncoding } from './field-types/address';
|
|
15
17
|
|
|
16
18
|
export enum ORACLE_TTL_TYPES {
|
|
17
19
|
delta = 0,
|
|
@@ -26,8 +28,6 @@ export const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };
|
|
|
26
28
|
export const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
|
|
27
29
|
export const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
|
|
28
30
|
// # CONTRACT
|
|
29
|
-
export const AMOUNT = 0;
|
|
30
|
-
export const MAX_AUTH_FUN_GAS = 50000;
|
|
31
31
|
export const DRY_RUN_ACCOUNT = {
|
|
32
32
|
pub: 'ak_11111111111111111111111111111111273Yts',
|
|
33
33
|
amount: 100000000000000000000000000000000000n,
|
|
@@ -35,141 +35,18 @@ export const DRY_RUN_ACCOUNT = {
|
|
|
35
35
|
|
|
36
36
|
export type TxField = [
|
|
37
37
|
name: string,
|
|
38
|
-
type:
|
|
39
|
-
prefix?: Encoding | Encoding[],
|
|
38
|
+
type: Field,
|
|
40
39
|
];
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export enum VM_VERSIONS {
|
|
47
|
-
NO_VM = 0,
|
|
48
|
-
SOPHIA = 1,
|
|
49
|
-
SOPHIA_IMPROVEMENTS_MINERVA = 3,
|
|
50
|
-
SOPHIA_IMPROVEMENTS_FORTUNA = 4,
|
|
51
|
-
FATE = 5,
|
|
52
|
-
SOPHIA_IMPROVEMENTS_LIMA = 6,
|
|
53
|
-
FATE_2 = 7,
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @category transaction builder
|
|
58
|
-
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
|
|
59
|
-
*/
|
|
60
|
-
export enum ABI_VERSIONS {
|
|
61
|
-
NO_ABI = 0,
|
|
62
|
-
SOPHIA = 1,
|
|
63
|
-
FATE = 3,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @category transaction builder
|
|
68
|
-
*/
|
|
69
|
-
export enum PROTOCOL_VERSIONS {
|
|
70
|
-
IRIS = 5,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// First abi/vm by default
|
|
74
|
-
export const PROTOCOL_VM_ABI = {
|
|
75
|
-
[PROTOCOL_VERSIONS.IRIS]: {
|
|
76
|
-
[Tag.ContractCreateTx]: {
|
|
77
|
-
vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE],
|
|
78
|
-
},
|
|
79
|
-
// TODO: Ensure that AEVM (SOPHIA?) is still available here
|
|
80
|
-
[Tag.ContractCallTx]: {
|
|
81
|
-
vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA],
|
|
82
|
-
},
|
|
83
|
-
[Tag.OracleRegisterTx]: {
|
|
84
|
-
vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
} as const;
|
|
88
|
-
|
|
89
|
-
type PrefixType<Prefix> = Prefix extends Encoding
|
|
90
|
-
? Encoded.Generic<Prefix>
|
|
91
|
-
: Prefix extends readonly Encoding[]
|
|
92
|
-
? Encoded.Generic<Prefix[number]>
|
|
93
|
-
: Encoded.Generic<any>;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @category transaction builder
|
|
97
|
-
*/
|
|
98
|
-
export interface CtVersion {
|
|
99
|
-
vmVersion: VM_VERSIONS;
|
|
100
|
-
abiVersion: ABI_VERSIONS;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @category transaction builder
|
|
105
|
-
*/
|
|
106
|
-
export enum FIELD_TYPES {
|
|
107
|
-
id,
|
|
108
|
-
ids,
|
|
109
|
-
string,
|
|
110
|
-
binary,
|
|
111
|
-
bool,
|
|
112
|
-
hex,
|
|
113
|
-
rlpBinary,
|
|
114
|
-
rlpBinaries,
|
|
115
|
-
rawBinary,
|
|
116
|
-
signatures,
|
|
117
|
-
pointers,
|
|
118
|
-
offChainUpdates,
|
|
119
|
-
callStack,
|
|
120
|
-
proofOfInclusion,
|
|
121
|
-
mptrees,
|
|
122
|
-
callReturnType,
|
|
123
|
-
ctVersion,
|
|
124
|
-
abiVersion,
|
|
125
|
-
ttlType,
|
|
126
|
-
sophiaCodeTypeInfo,
|
|
127
|
-
payload,
|
|
128
|
-
stateTree,
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
interface BuildFieldTypes<Prefix extends undefined | Encoding | readonly Encoding[]> {
|
|
132
|
-
[FIELD_TYPES.id]: PrefixType<Prefix>;
|
|
133
|
-
[FIELD_TYPES.ids]: Array<Encoded.Generic<Prefix extends Encoding[] ? Prefix : any>>;
|
|
134
|
-
[FIELD_TYPES.string]: string;
|
|
135
|
-
[FIELD_TYPES.binary]: PrefixType<Prefix>;
|
|
136
|
-
[FIELD_TYPES.bool]: Boolean;
|
|
137
|
-
[FIELD_TYPES.hex]: string;
|
|
138
|
-
[FIELD_TYPES.rlpBinary]: any;
|
|
139
|
-
[FIELD_TYPES.rlpBinaries]: any[];
|
|
140
|
-
[FIELD_TYPES.rawBinary]: Uint8Array;
|
|
141
|
-
[FIELD_TYPES.signatures]: Uint8Array[];
|
|
142
|
-
[FIELD_TYPES.pointers]: NamePointer[];
|
|
143
|
-
[FIELD_TYPES.offChainUpdates]: any;
|
|
144
|
-
[FIELD_TYPES.callStack]: any;
|
|
145
|
-
[FIELD_TYPES.proofOfInclusion]: any;
|
|
146
|
-
[FIELD_TYPES.mptrees]: MPTree[];
|
|
147
|
-
[FIELD_TYPES.callReturnType]: any;
|
|
148
|
-
[FIELD_TYPES.ctVersion]: CtVersion;
|
|
149
|
-
[FIELD_TYPES.abiVersion]: ABI_VERSIONS;
|
|
150
|
-
[FIELD_TYPES.ttlType]: ORACLE_TTL_TYPES;
|
|
151
|
-
[FIELD_TYPES.sophiaCodeTypeInfo]: any;
|
|
152
|
-
[FIELD_TYPES.payload]: string | undefined;
|
|
153
|
-
[FIELD_TYPES.stateTree]: any;
|
|
41
|
+
export enum CallReturnType {
|
|
42
|
+
Ok = 0,
|
|
43
|
+
Error = 1,
|
|
44
|
+
Revert = 2,
|
|
154
45
|
}
|
|
155
46
|
|
|
156
|
-
|
|
157
|
-
type UnionToIntersection<Union> =
|
|
158
|
-
(Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)
|
|
159
|
-
? Intersection : never;
|
|
47
|
+
type TxElem = readonly [string, Field];
|
|
160
48
|
|
|
161
|
-
type
|
|
162
|
-
| readonly [string, FIELD_TYPES, Encoding | readonly Encoding[]];
|
|
163
|
-
|
|
164
|
-
type BuildTxArgBySchemaType<
|
|
165
|
-
Type extends FIELD_TYPES | Field,
|
|
166
|
-
Prefix extends undefined | Encoding | readonly Encoding[],
|
|
167
|
-
> =
|
|
168
|
-
Type extends Field
|
|
169
|
-
? Parameters<Type['serialize']>[0]
|
|
170
|
-
: Type extends FIELD_TYPES
|
|
171
|
-
? BuildFieldTypes<Prefix>[Type]
|
|
172
|
-
: never;
|
|
49
|
+
type BuildTxArgBySchemaType<Type extends Field> = Parameters<Type['serialize']>[0];
|
|
173
50
|
|
|
174
51
|
type NullablePartial<
|
|
175
52
|
T,
|
|
@@ -180,7 +57,7 @@ type BuildTxArgBySchema<SchemaLine> =
|
|
|
180
57
|
UnionToIntersection<
|
|
181
58
|
SchemaLine extends ReadonlyArray<infer Elem>
|
|
182
59
|
? Elem extends TxElem
|
|
183
|
-
? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1]
|
|
60
|
+
? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1]> }>
|
|
184
61
|
: never
|
|
185
62
|
: never
|
|
186
63
|
>;
|
|
@@ -189,60 +66,75 @@ export type RawTxObject<Tx extends TxSchema> = {
|
|
|
189
66
|
[k in keyof Tx]-?: Tx[k] extends BigNumber ? string : Tx[k]
|
|
190
67
|
};
|
|
191
68
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
] as const;
|
|
196
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @see {@link https://github.com/aeternity/protocol/blob/c007deeac4a01e401238412801ac7084ac72d60e/serializations.md#accounts-version-1-basic-accounts}
|
|
71
|
+
*/
|
|
197
72
|
export const TX_SCHEMA = {
|
|
198
73
|
[Tag.Account]: {
|
|
199
74
|
1: [
|
|
200
|
-
|
|
75
|
+
['tag', shortUIntConst(Tag.Account)],
|
|
76
|
+
['version', shortUIntConst(1)],
|
|
201
77
|
['nonce', shortUInt],
|
|
202
78
|
['balance', uInt],
|
|
203
79
|
],
|
|
204
80
|
2: [
|
|
205
|
-
|
|
81
|
+
['tag', shortUIntConst(Tag.Account)],
|
|
82
|
+
['version', shortUIntConst(2)],
|
|
206
83
|
['flags', uInt],
|
|
207
84
|
['nonce', shortUInt],
|
|
208
85
|
['balance', uInt],
|
|
209
|
-
['gaContract',
|
|
210
|
-
['gaAuthFun',
|
|
86
|
+
['gaContract', address(Encoding.ContractAddress, Encoding.Name)],
|
|
87
|
+
['gaAuthFun', encoded(Encoding.ContractBytearray)],
|
|
211
88
|
],
|
|
212
89
|
},
|
|
213
90
|
[Tag.SignedTx]: {
|
|
214
91
|
1: [
|
|
215
|
-
|
|
216
|
-
['
|
|
217
|
-
['
|
|
92
|
+
['tag', shortUIntConst(Tag.SignedTx)],
|
|
93
|
+
['version', shortUIntConst(1)],
|
|
94
|
+
['signatures', array(raw)],
|
|
95
|
+
['encodedTx', entry()],
|
|
218
96
|
],
|
|
219
97
|
},
|
|
220
98
|
[Tag.SpendTx]: {
|
|
221
99
|
1: [
|
|
222
|
-
|
|
223
|
-
['
|
|
224
|
-
['
|
|
100
|
+
['tag', shortUIntConst(Tag.SpendTx)],
|
|
101
|
+
['version', shortUIntConst(1)],
|
|
102
|
+
['senderId', address(Encoding.AccountAddress)],
|
|
103
|
+
['recipientId', address(Encoding.AccountAddress, Encoding.Name)],
|
|
225
104
|
['amount', coinAmount],
|
|
226
105
|
['fee', fee],
|
|
227
106
|
['ttl', shortUInt],
|
|
228
107
|
['nonce', shortUInt],
|
|
229
|
-
['payload',
|
|
108
|
+
['payload', encoded(Encoding.Bytearray, true)],
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
[Tag.Name]: {
|
|
112
|
+
1: [
|
|
113
|
+
['tag', shortUIntConst(Tag.Name)],
|
|
114
|
+
['version', shortUIntConst(1)],
|
|
115
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
116
|
+
['nameTtl', shortUInt],
|
|
117
|
+
['status', raw],
|
|
118
|
+
['clientTtl', shortUInt],
|
|
119
|
+
['pointers', pointers],
|
|
230
120
|
],
|
|
231
121
|
},
|
|
232
122
|
[Tag.NamePreclaimTx]: {
|
|
233
123
|
1: [
|
|
234
|
-
|
|
235
|
-
['
|
|
124
|
+
['tag', shortUIntConst(Tag.NamePreclaimTx)],
|
|
125
|
+
['version', shortUIntConst(1)],
|
|
126
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
236
127
|
['nonce', shortUInt],
|
|
237
|
-
['commitmentId',
|
|
128
|
+
['commitmentId', address(Encoding.Commitment)],
|
|
238
129
|
['fee', fee],
|
|
239
130
|
['ttl', shortUInt],
|
|
240
131
|
],
|
|
241
132
|
},
|
|
242
133
|
[Tag.NameClaimTx]: {
|
|
243
134
|
2: [
|
|
244
|
-
|
|
245
|
-
['
|
|
135
|
+
['tag', shortUIntConst(Tag.NameClaimTx)],
|
|
136
|
+
['version', shortUIntConst(2)],
|
|
137
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
246
138
|
['nonce', shortUInt],
|
|
247
139
|
['name', name],
|
|
248
140
|
['nameSalt', uInt],
|
|
@@ -253,12 +145,13 @@ export const TX_SCHEMA = {
|
|
|
253
145
|
},
|
|
254
146
|
[Tag.NameUpdateTx]: {
|
|
255
147
|
1: [
|
|
256
|
-
|
|
257
|
-
['
|
|
148
|
+
['tag', shortUIntConst(Tag.NameUpdateTx)],
|
|
149
|
+
['version', shortUIntConst(1)],
|
|
150
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
258
151
|
['nonce', shortUInt],
|
|
259
152
|
['nameId', nameId],
|
|
260
|
-
['nameTtl',
|
|
261
|
-
['pointers',
|
|
153
|
+
['nameTtl', shortUInt],
|
|
154
|
+
['pointers', pointers],
|
|
262
155
|
['clientTtl', shortUInt],
|
|
263
156
|
['fee', fee],
|
|
264
157
|
['ttl', shortUInt],
|
|
@@ -266,19 +159,21 @@ export const TX_SCHEMA = {
|
|
|
266
159
|
},
|
|
267
160
|
[Tag.NameTransferTx]: {
|
|
268
161
|
1: [
|
|
269
|
-
|
|
270
|
-
['
|
|
162
|
+
['tag', shortUIntConst(Tag.NameTransferTx)],
|
|
163
|
+
['version', shortUIntConst(1)],
|
|
164
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
271
165
|
['nonce', shortUInt],
|
|
272
166
|
['nameId', nameId],
|
|
273
|
-
['recipientId',
|
|
167
|
+
['recipientId', address(Encoding.AccountAddress, Encoding.Name)],
|
|
274
168
|
['fee', fee],
|
|
275
169
|
['ttl', shortUInt],
|
|
276
170
|
],
|
|
277
171
|
},
|
|
278
172
|
[Tag.NameRevokeTx]: {
|
|
279
173
|
1: [
|
|
280
|
-
|
|
281
|
-
['
|
|
174
|
+
['tag', shortUIntConst(Tag.NameRevokeTx)],
|
|
175
|
+
['version', shortUIntConst(1)],
|
|
176
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
282
177
|
['nonce', shortUInt],
|
|
283
178
|
['nameId', nameId],
|
|
284
179
|
['fee', fee],
|
|
@@ -287,84 +182,102 @@ export const TX_SCHEMA = {
|
|
|
287
182
|
},
|
|
288
183
|
[Tag.Contract]: {
|
|
289
184
|
1: [
|
|
290
|
-
|
|
291
|
-
['
|
|
292
|
-
['
|
|
293
|
-
['
|
|
294
|
-
['
|
|
295
|
-
['
|
|
296
|
-
['
|
|
185
|
+
['tag', shortUIntConst(Tag.Contract)],
|
|
186
|
+
['version', shortUIntConst(1)],
|
|
187
|
+
['owner', address(Encoding.AccountAddress)],
|
|
188
|
+
['ctVersion', ctVersion],
|
|
189
|
+
['code', encoded(Encoding.ContractBytearray)],
|
|
190
|
+
['log', encoded(Encoding.ContractBytearray)],
|
|
191
|
+
['active', boolean],
|
|
192
|
+
['referers', array(address(Encoding.AccountAddress))],
|
|
297
193
|
['deposit', deposit],
|
|
298
194
|
],
|
|
299
195
|
},
|
|
300
196
|
[Tag.ContractCreateTx]: {
|
|
301
197
|
1: [
|
|
302
|
-
|
|
303
|
-
['
|
|
198
|
+
['tag', shortUIntConst(Tag.ContractCreateTx)],
|
|
199
|
+
['version', shortUIntConst(1)],
|
|
200
|
+
['ownerId', address(Encoding.AccountAddress)],
|
|
304
201
|
['nonce', shortUInt],
|
|
305
|
-
['code',
|
|
306
|
-
['ctVersion',
|
|
202
|
+
['code', encoded(Encoding.ContractBytearray)],
|
|
203
|
+
['ctVersion', ctVersion],
|
|
307
204
|
['fee', fee],
|
|
308
205
|
['ttl', shortUInt],
|
|
309
206
|
['deposit', deposit],
|
|
310
207
|
['amount', coinAmount],
|
|
311
208
|
['gasLimit', gasLimit],
|
|
312
209
|
['gasPrice', gasPrice],
|
|
313
|
-
['callData',
|
|
210
|
+
['callData', encoded(Encoding.ContractBytearray)],
|
|
314
211
|
],
|
|
315
212
|
},
|
|
316
213
|
[Tag.ContractCallTx]: {
|
|
317
214
|
1: [
|
|
318
|
-
|
|
319
|
-
['
|
|
215
|
+
['tag', shortUIntConst(Tag.ContractCallTx)],
|
|
216
|
+
['version', shortUIntConst(1)],
|
|
217
|
+
['callerId', address(Encoding.AccountAddress)],
|
|
320
218
|
['nonce', shortUInt],
|
|
321
|
-
['contractId',
|
|
322
|
-
['abiVersion',
|
|
219
|
+
['contractId', address(Encoding.ContractAddress, Encoding.Name)],
|
|
220
|
+
['abiVersion', abiVersion],
|
|
323
221
|
['fee', fee],
|
|
324
222
|
['ttl', shortUInt],
|
|
325
223
|
['amount', coinAmount],
|
|
326
224
|
['gasLimit', gasLimit],
|
|
327
225
|
['gasPrice', gasPrice],
|
|
328
|
-
['callData',
|
|
226
|
+
['callData', encoded(Encoding.ContractBytearray)],
|
|
329
227
|
],
|
|
330
228
|
},
|
|
331
229
|
[Tag.ContractCall]: {
|
|
332
230
|
1: [
|
|
333
|
-
|
|
334
|
-
['
|
|
231
|
+
['tag', shortUIntConst(Tag.ContractCall)],
|
|
232
|
+
['version', shortUIntConst(1)],
|
|
233
|
+
['callerId', address(Encoding.AccountAddress)],
|
|
335
234
|
['callerNonce', shortUInt],
|
|
336
235
|
['height', shortUInt],
|
|
337
|
-
['contractId',
|
|
236
|
+
['contractId', address(Encoding.ContractAddress)],
|
|
338
237
|
['gasPrice', gasPrice],
|
|
339
238
|
['gasUsed', shortUInt],
|
|
340
|
-
['returnValue',
|
|
341
|
-
['returnType',
|
|
239
|
+
['returnValue', encoded(Encoding.ContractBytearray)],
|
|
240
|
+
['returnType', enumeration(CallReturnType)],
|
|
342
241
|
// TODO: add serialization for
|
|
343
242
|
// <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]
|
|
344
|
-
['log',
|
|
243
|
+
['log', raw],
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
[Tag.Oracle]: {
|
|
247
|
+
1: [
|
|
248
|
+
['tag', shortUIntConst(Tag.Oracle)],
|
|
249
|
+
['version', shortUIntConst(1)],
|
|
250
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
251
|
+
['queryFormat', string],
|
|
252
|
+
['responseFormat', string],
|
|
253
|
+
['queryFee', coinAmount],
|
|
254
|
+
['oracleTtlValue', shortUInt],
|
|
255
|
+
['abiVersion', abiVersion],
|
|
345
256
|
],
|
|
346
257
|
},
|
|
347
258
|
[Tag.OracleRegisterTx]: {
|
|
348
259
|
1: [
|
|
349
|
-
|
|
350
|
-
['
|
|
260
|
+
['tag', shortUIntConst(Tag.OracleRegisterTx)],
|
|
261
|
+
['version', shortUIntConst(1)],
|
|
262
|
+
['accountId', address(Encoding.AccountAddress)],
|
|
351
263
|
['nonce', shortUInt],
|
|
352
|
-
['queryFormat',
|
|
353
|
-
['responseFormat',
|
|
264
|
+
['queryFormat', string],
|
|
265
|
+
['responseFormat', string],
|
|
354
266
|
['queryFee', coinAmount],
|
|
355
|
-
['oracleTtlType',
|
|
267
|
+
['oracleTtlType', enumeration(ORACLE_TTL_TYPES)],
|
|
356
268
|
['oracleTtlValue', shortUInt],
|
|
357
269
|
['fee', fee],
|
|
358
270
|
['ttl', shortUInt],
|
|
359
|
-
['abiVersion',
|
|
271
|
+
['abiVersion', abiVersion],
|
|
360
272
|
],
|
|
361
273
|
},
|
|
362
274
|
[Tag.OracleExtendTx]: {
|
|
363
275
|
1: [
|
|
364
|
-
|
|
365
|
-
['
|
|
276
|
+
['tag', shortUIntConst(Tag.OracleExtendTx)],
|
|
277
|
+
['version', shortUIntConst(1)],
|
|
278
|
+
['oracleId', address(Encoding.OracleAddress, Encoding.Name)],
|
|
366
279
|
['nonce', shortUInt],
|
|
367
|
-
['oracleTtlType',
|
|
280
|
+
['oracleTtlType', enumeration(ORACLE_TTL_TYPES)],
|
|
368
281
|
['oracleTtlValue', shortUInt],
|
|
369
282
|
['fee', fee],
|
|
370
283
|
['ttl', shortUInt],
|
|
@@ -372,15 +285,16 @@ export const TX_SCHEMA = {
|
|
|
372
285
|
},
|
|
373
286
|
[Tag.OracleQueryTx]: {
|
|
374
287
|
1: [
|
|
375
|
-
|
|
376
|
-
['
|
|
288
|
+
['tag', shortUIntConst(Tag.OracleQueryTx)],
|
|
289
|
+
['version', shortUIntConst(1)],
|
|
290
|
+
['senderId', address(Encoding.AccountAddress)],
|
|
377
291
|
['nonce', shortUInt],
|
|
378
|
-
['oracleId',
|
|
379
|
-
['query',
|
|
292
|
+
['oracleId', address(Encoding.OracleAddress, Encoding.Name)],
|
|
293
|
+
['query', string],
|
|
380
294
|
['queryFee', coinAmount],
|
|
381
|
-
['queryTtlType',
|
|
295
|
+
['queryTtlType', enumeration(ORACLE_TTL_TYPES)],
|
|
382
296
|
['queryTtlValue', shortUInt],
|
|
383
|
-
['responseTtlType',
|
|
297
|
+
['responseTtlType', enumeration(ORACLE_TTL_TYPES)],
|
|
384
298
|
['responseTtlValue', shortUInt],
|
|
385
299
|
['fee', fee],
|
|
386
300
|
['ttl', shortUInt],
|
|
@@ -388,12 +302,13 @@ export const TX_SCHEMA = {
|
|
|
388
302
|
},
|
|
389
303
|
[Tag.OracleResponseTx]: {
|
|
390
304
|
1: [
|
|
391
|
-
|
|
392
|
-
['
|
|
305
|
+
['tag', shortUIntConst(Tag.OracleResponseTx)],
|
|
306
|
+
['version', shortUIntConst(1)],
|
|
307
|
+
['oracleId', address(Encoding.OracleAddress)],
|
|
393
308
|
['nonce', shortUInt],
|
|
394
|
-
['queryId',
|
|
395
|
-
['response',
|
|
396
|
-
['responseTtlType',
|
|
309
|
+
['queryId', encoded(Encoding.OracleQueryId)],
|
|
310
|
+
['response', string],
|
|
311
|
+
['responseTtlType', enumeration(ORACLE_TTL_TYPES)],
|
|
397
312
|
['responseTtlValue', shortUInt],
|
|
398
313
|
['fee', fee],
|
|
399
314
|
['ttl', shortUInt],
|
|
@@ -401,26 +316,28 @@ export const TX_SCHEMA = {
|
|
|
401
316
|
},
|
|
402
317
|
[Tag.ChannelCreateTx]: {
|
|
403
318
|
2: [
|
|
404
|
-
|
|
405
|
-
['
|
|
319
|
+
['tag', shortUIntConst(Tag.ChannelCreateTx)],
|
|
320
|
+
['version', shortUIntConst(2)],
|
|
321
|
+
['initiator', address(Encoding.AccountAddress)],
|
|
406
322
|
['initiatorAmount', uInt],
|
|
407
|
-
['responder',
|
|
323
|
+
['responder', address(Encoding.AccountAddress)],
|
|
408
324
|
['responderAmount', uInt],
|
|
409
325
|
['channelReserve', uInt],
|
|
410
326
|
['lockPeriod', uInt],
|
|
411
327
|
['ttl', shortUInt],
|
|
412
328
|
['fee', fee],
|
|
413
|
-
['initiatorDelegateIds',
|
|
414
|
-
['responderDelegateIds',
|
|
415
|
-
['stateHash',
|
|
329
|
+
['initiatorDelegateIds', array(address(...idTagToEncoding))],
|
|
330
|
+
['responderDelegateIds', array(address(...idTagToEncoding))],
|
|
331
|
+
['stateHash', encoded(Encoding.State)],
|
|
416
332
|
['nonce', shortUInt],
|
|
417
333
|
],
|
|
418
334
|
},
|
|
419
335
|
[Tag.ChannelCloseMutualTx]: {
|
|
420
336
|
1: [
|
|
421
|
-
|
|
422
|
-
['
|
|
423
|
-
['
|
|
337
|
+
['tag', shortUIntConst(Tag.ChannelCloseMutualTx)],
|
|
338
|
+
['version', shortUIntConst(1)],
|
|
339
|
+
['channelId', address(Encoding.Channel)],
|
|
340
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
424
341
|
['initiatorAmountFinal', uInt],
|
|
425
342
|
['responderAmountFinal', uInt],
|
|
426
343
|
['ttl', shortUInt],
|
|
@@ -430,11 +347,12 @@ export const TX_SCHEMA = {
|
|
|
430
347
|
},
|
|
431
348
|
[Tag.ChannelCloseSoloTx]: {
|
|
432
349
|
1: [
|
|
433
|
-
|
|
434
|
-
['
|
|
435
|
-
['
|
|
436
|
-
['
|
|
437
|
-
['
|
|
350
|
+
['tag', shortUIntConst(Tag.ChannelCloseSoloTx)],
|
|
351
|
+
['version', shortUIntConst(1)],
|
|
352
|
+
['channelId', address(Encoding.Channel)],
|
|
353
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
354
|
+
['payload', encoded(Encoding.Transaction)],
|
|
355
|
+
['poi', entry(Tag.TreesPoi)],
|
|
438
356
|
['ttl', shortUInt],
|
|
439
357
|
['fee', fee],
|
|
440
358
|
['nonce', shortUInt],
|
|
@@ -442,11 +360,12 @@ export const TX_SCHEMA = {
|
|
|
442
360
|
},
|
|
443
361
|
[Tag.ChannelSlashTx]: {
|
|
444
362
|
1: [
|
|
445
|
-
|
|
446
|
-
['
|
|
447
|
-
['
|
|
448
|
-
['
|
|
449
|
-
['
|
|
363
|
+
['tag', shortUIntConst(Tag.ChannelSlashTx)],
|
|
364
|
+
['version', shortUIntConst(1)],
|
|
365
|
+
['channelId', address(Encoding.Channel)],
|
|
366
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
367
|
+
['payload', encoded(Encoding.Transaction)],
|
|
368
|
+
['poi', entry(Tag.TreesPoi)],
|
|
450
369
|
['ttl', shortUInt],
|
|
451
370
|
['fee', fee],
|
|
452
371
|
['nonce', shortUInt],
|
|
@@ -454,35 +373,38 @@ export const TX_SCHEMA = {
|
|
|
454
373
|
},
|
|
455
374
|
[Tag.ChannelDepositTx]: {
|
|
456
375
|
1: [
|
|
457
|
-
|
|
458
|
-
['
|
|
459
|
-
['
|
|
376
|
+
['tag', shortUIntConst(Tag.ChannelDepositTx)],
|
|
377
|
+
['version', shortUIntConst(1)],
|
|
378
|
+
['channelId', address(Encoding.Channel)],
|
|
379
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
460
380
|
['amount', uInt],
|
|
461
381
|
['ttl', shortUInt],
|
|
462
382
|
['fee', fee],
|
|
463
|
-
['stateHash',
|
|
383
|
+
['stateHash', encoded(Encoding.State)],
|
|
464
384
|
['round', shortUInt],
|
|
465
385
|
['nonce', shortUInt],
|
|
466
386
|
],
|
|
467
387
|
},
|
|
468
388
|
[Tag.ChannelWithdrawTx]: {
|
|
469
389
|
1: [
|
|
470
|
-
|
|
471
|
-
['
|
|
472
|
-
['
|
|
390
|
+
['tag', shortUIntConst(Tag.ChannelWithdrawTx)],
|
|
391
|
+
['version', shortUIntConst(1)],
|
|
392
|
+
['channelId', address(Encoding.Channel)],
|
|
393
|
+
['toId', address(Encoding.AccountAddress)],
|
|
473
394
|
['amount', uInt],
|
|
474
395
|
['ttl', shortUInt],
|
|
475
396
|
['fee', fee],
|
|
476
|
-
['stateHash',
|
|
397
|
+
['stateHash', encoded(Encoding.State)],
|
|
477
398
|
['round', shortUInt],
|
|
478
399
|
['nonce', shortUInt],
|
|
479
400
|
],
|
|
480
401
|
},
|
|
481
402
|
[Tag.ChannelSettleTx]: {
|
|
482
403
|
1: [
|
|
483
|
-
|
|
484
|
-
['
|
|
485
|
-
['
|
|
404
|
+
['tag', shortUIntConst(Tag.ChannelSettleTx)],
|
|
405
|
+
['version', shortUIntConst(1)],
|
|
406
|
+
['channelId', address(Encoding.Channel)],
|
|
407
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
486
408
|
['initiatorAmountFinal', uInt],
|
|
487
409
|
['responderAmountFinal', uInt],
|
|
488
410
|
['ttl', shortUInt],
|
|
@@ -492,14 +414,15 @@ export const TX_SCHEMA = {
|
|
|
492
414
|
},
|
|
493
415
|
[Tag.ChannelForceProgressTx]: {
|
|
494
416
|
1: [
|
|
495
|
-
|
|
496
|
-
['
|
|
497
|
-
['
|
|
498
|
-
['
|
|
417
|
+
['tag', shortUIntConst(Tag.ChannelForceProgressTx)],
|
|
418
|
+
['version', shortUIntConst(1)],
|
|
419
|
+
['channelId', address(Encoding.Channel)],
|
|
420
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
421
|
+
['payload', encoded(Encoding.Transaction)],
|
|
499
422
|
['round', shortUInt],
|
|
500
|
-
['update',
|
|
501
|
-
['stateHash',
|
|
502
|
-
['offChainTrees',
|
|
423
|
+
['update', encoded(Encoding.ContractBytearray)],
|
|
424
|
+
['stateHash', encoded(Encoding.State)],
|
|
425
|
+
['offChainTrees', encoded(Encoding.StateTrees)],
|
|
503
426
|
['ttl', shortUInt],
|
|
504
427
|
['fee', fee],
|
|
505
428
|
['nonce', shortUInt],
|
|
@@ -507,38 +430,41 @@ export const TX_SCHEMA = {
|
|
|
507
430
|
},
|
|
508
431
|
[Tag.ChannelOffChainTx]: {
|
|
509
432
|
2: [
|
|
510
|
-
|
|
511
|
-
['
|
|
433
|
+
['tag', shortUIntConst(Tag.ChannelOffChainTx)],
|
|
434
|
+
['version', shortUIntConst(2)],
|
|
435
|
+
['channelId', address(Encoding.Channel)],
|
|
512
436
|
['round', shortUInt],
|
|
513
|
-
['stateHash',
|
|
437
|
+
['stateHash', encoded(Encoding.State)],
|
|
514
438
|
],
|
|
515
439
|
},
|
|
516
440
|
[Tag.Channel]: {
|
|
517
441
|
3: [
|
|
518
|
-
|
|
519
|
-
['
|
|
520
|
-
['
|
|
442
|
+
['tag', shortUIntConst(Tag.Channel)],
|
|
443
|
+
['version', shortUIntConst(3)],
|
|
444
|
+
['initiator', address(Encoding.AccountAddress)],
|
|
445
|
+
['responder', address(Encoding.AccountAddress)],
|
|
521
446
|
['channelAmount', uInt],
|
|
522
447
|
['initiatorAmount', uInt],
|
|
523
448
|
['responderAmount', uInt],
|
|
524
449
|
['channelReserve', uInt],
|
|
525
|
-
['initiatorDelegateIds',
|
|
526
|
-
['responderDelegateIds',
|
|
527
|
-
['stateHash',
|
|
450
|
+
['initiatorDelegateIds', array(address(...idTagToEncoding))],
|
|
451
|
+
['responderDelegateIds', array(address(...idTagToEncoding))],
|
|
452
|
+
['stateHash', encoded(Encoding.State)],
|
|
528
453
|
['round', shortUInt],
|
|
529
454
|
['soloRound', uInt],
|
|
530
455
|
['lockPeriod', uInt],
|
|
531
456
|
['lockedUntil', uInt],
|
|
532
|
-
['initiatorAuth',
|
|
533
|
-
['responderAuth',
|
|
457
|
+
['initiatorAuth', encoded(Encoding.ContractBytearray)],
|
|
458
|
+
['responderAuth', encoded(Encoding.ContractBytearray)],
|
|
534
459
|
],
|
|
535
460
|
},
|
|
536
461
|
[Tag.ChannelSnapshotSoloTx]: {
|
|
537
462
|
1: [
|
|
538
|
-
|
|
539
|
-
['
|
|
540
|
-
['
|
|
541
|
-
['
|
|
463
|
+
['tag', shortUIntConst(Tag.ChannelSnapshotSoloTx)],
|
|
464
|
+
['version', shortUIntConst(1)],
|
|
465
|
+
['channelId', address(Encoding.Channel)],
|
|
466
|
+
['fromId', address(Encoding.AccountAddress)],
|
|
467
|
+
['payload', encoded(Encoding.Transaction)],
|
|
542
468
|
['ttl', shortUInt],
|
|
543
469
|
['fee', fee],
|
|
544
470
|
['nonce', shortUInt],
|
|
@@ -546,181 +472,194 @@ export const TX_SCHEMA = {
|
|
|
546
472
|
},
|
|
547
473
|
[Tag.ChannelOffChainUpdateTransfer]: {
|
|
548
474
|
1: [
|
|
549
|
-
|
|
550
|
-
['
|
|
551
|
-
['
|
|
475
|
+
['tag', shortUIntConst(Tag.ChannelOffChainUpdateTransfer)],
|
|
476
|
+
['version', shortUIntConst(1)],
|
|
477
|
+
['from', address(Encoding.AccountAddress)],
|
|
478
|
+
['to', address(Encoding.AccountAddress)],
|
|
552
479
|
['amount', uInt],
|
|
553
480
|
],
|
|
554
481
|
},
|
|
555
482
|
[Tag.ChannelOffChainUpdateDeposit]: {
|
|
556
483
|
1: [
|
|
557
|
-
|
|
558
|
-
['
|
|
484
|
+
['tag', shortUIntConst(Tag.ChannelOffChainUpdateDeposit)],
|
|
485
|
+
['version', shortUIntConst(1)],
|
|
486
|
+
['from', address(Encoding.AccountAddress)],
|
|
559
487
|
['amount', uInt],
|
|
560
488
|
],
|
|
561
489
|
},
|
|
562
490
|
[Tag.ChannelOffChainUpdateWithdraw]: {
|
|
563
491
|
1: [
|
|
564
|
-
|
|
565
|
-
['
|
|
492
|
+
['tag', shortUIntConst(Tag.ChannelOffChainUpdateWithdraw)],
|
|
493
|
+
['version', shortUIntConst(1)],
|
|
494
|
+
['from', address(Encoding.AccountAddress)],
|
|
566
495
|
['amount', uInt],
|
|
567
496
|
],
|
|
568
497
|
},
|
|
569
498
|
[Tag.ChannelOffChainUpdateCreateContract]: {
|
|
570
499
|
1: [
|
|
571
|
-
|
|
572
|
-
['
|
|
573
|
-
['
|
|
574
|
-
['
|
|
500
|
+
['tag', shortUIntConst(Tag.ChannelOffChainUpdateCreateContract)],
|
|
501
|
+
['version', shortUIntConst(1)],
|
|
502
|
+
['owner', address(Encoding.AccountAddress)],
|
|
503
|
+
['ctVersion', ctVersion],
|
|
504
|
+
['code', encoded(Encoding.ContractBytearray)],
|
|
575
505
|
['deposit', uInt],
|
|
576
|
-
['callData',
|
|
506
|
+
['callData', encoded(Encoding.ContractBytearray)],
|
|
577
507
|
],
|
|
578
508
|
},
|
|
579
509
|
[Tag.ChannelOffChainUpdateCallContract]: {
|
|
580
510
|
1: [
|
|
581
|
-
|
|
582
|
-
['
|
|
583
|
-
['
|
|
584
|
-
['
|
|
511
|
+
['tag', shortUIntConst(Tag.ChannelOffChainUpdateCallContract)],
|
|
512
|
+
['version', shortUIntConst(1)],
|
|
513
|
+
['caller', address(Encoding.AccountAddress)],
|
|
514
|
+
['contract', address(Encoding.ContractAddress)],
|
|
515
|
+
['abiVersion', abiVersion],
|
|
585
516
|
['amount', uInt],
|
|
586
|
-
['callData',
|
|
587
|
-
['callStack',
|
|
517
|
+
['callData', encoded(Encoding.ContractBytearray)],
|
|
518
|
+
['callStack', raw],
|
|
588
519
|
['gasPrice', gasPrice],
|
|
589
520
|
['gasLimit', gasLimit],
|
|
590
521
|
],
|
|
591
522
|
},
|
|
592
523
|
[Tag.ChannelClientReconnectTx]: {
|
|
593
524
|
1: [
|
|
594
|
-
|
|
595
|
-
['
|
|
525
|
+
['tag', shortUIntConst(Tag.ChannelClientReconnectTx)],
|
|
526
|
+
['version', shortUIntConst(1)],
|
|
527
|
+
['channelId', address(Encoding.Channel)],
|
|
596
528
|
['round', shortUInt],
|
|
597
|
-
['role',
|
|
598
|
-
['pubkey',
|
|
529
|
+
['role', string],
|
|
530
|
+
['pubkey', address(Encoding.AccountAddress)],
|
|
599
531
|
],
|
|
600
532
|
},
|
|
601
533
|
[Tag.TreesPoi]: {
|
|
602
534
|
1: [
|
|
603
|
-
|
|
604
|
-
['
|
|
605
|
-
['
|
|
606
|
-
['
|
|
607
|
-
['
|
|
608
|
-
['
|
|
609
|
-
['
|
|
535
|
+
['tag', shortUIntConst(Tag.TreesPoi)],
|
|
536
|
+
['version', shortUIntConst(1)],
|
|
537
|
+
['accounts', array(mptree(Encoding.AccountAddress, Tag.Account))],
|
|
538
|
+
['calls', array(mptree(Encoding.Bytearray, Tag.ContractCall))],
|
|
539
|
+
['channels', array(mptree(Encoding.Channel, Tag.Channel))],
|
|
540
|
+
['contracts', array(mptree(Encoding.ContractAddress, Tag.Contract))],
|
|
541
|
+
['ns', array(mptree(Encoding.Name, Tag.Name))],
|
|
542
|
+
['oracles', array(mptree(Encoding.OracleAddress, Tag.Oracle))],
|
|
610
543
|
],
|
|
611
544
|
},
|
|
612
545
|
[Tag.StateTrees]: {
|
|
613
546
|
1: [
|
|
614
|
-
|
|
615
|
-
['
|
|
616
|
-
['
|
|
617
|
-
['
|
|
618
|
-
['
|
|
619
|
-
['
|
|
620
|
-
['
|
|
547
|
+
['tag', shortUIntConst(Tag.StateTrees)],
|
|
548
|
+
['version', shortUIntConst(1)],
|
|
549
|
+
['contracts', entry()],
|
|
550
|
+
['calls', entry()],
|
|
551
|
+
['channels', entry()],
|
|
552
|
+
['ns', entry()],
|
|
553
|
+
['oracles', entry()],
|
|
554
|
+
['accounts', entry()],
|
|
621
555
|
],
|
|
622
556
|
},
|
|
623
557
|
[Tag.Mtree]: {
|
|
624
558
|
1: [
|
|
625
|
-
|
|
626
|
-
['
|
|
559
|
+
['tag', shortUIntConst(Tag.Mtree)],
|
|
560
|
+
['version', shortUIntConst(1)],
|
|
561
|
+
['values', array(entry())],
|
|
627
562
|
],
|
|
628
563
|
},
|
|
629
564
|
[Tag.MtreeValue]: {
|
|
630
565
|
1: [
|
|
631
|
-
|
|
632
|
-
['
|
|
633
|
-
['
|
|
566
|
+
['tag', shortUIntConst(Tag.MtreeValue)],
|
|
567
|
+
['version', shortUIntConst(1)],
|
|
568
|
+
['key', raw],
|
|
569
|
+
['value', raw],
|
|
634
570
|
],
|
|
635
571
|
},
|
|
636
572
|
[Tag.ContractsMtree]: {
|
|
637
573
|
1: [
|
|
638
|
-
|
|
639
|
-
['
|
|
574
|
+
['tag', shortUIntConst(Tag.ContractsMtree)],
|
|
575
|
+
['version', shortUIntConst(1)],
|
|
576
|
+
['contracts', entry()],
|
|
640
577
|
],
|
|
641
578
|
},
|
|
642
579
|
[Tag.CallsMtree]: {
|
|
643
580
|
1: [
|
|
644
|
-
|
|
645
|
-
['
|
|
581
|
+
['tag', shortUIntConst(Tag.CallsMtree)],
|
|
582
|
+
['version', shortUIntConst(1)],
|
|
583
|
+
['calls', entry()],
|
|
646
584
|
],
|
|
647
585
|
},
|
|
648
586
|
[Tag.ChannelsMtree]: {
|
|
649
587
|
1: [
|
|
650
|
-
|
|
651
|
-
['
|
|
588
|
+
['tag', shortUIntConst(Tag.ChannelsMtree)],
|
|
589
|
+
['version', shortUIntConst(1)],
|
|
590
|
+
['channels', entry()],
|
|
652
591
|
],
|
|
653
592
|
},
|
|
654
593
|
[Tag.NameserviceMtree]: {
|
|
655
594
|
1: [
|
|
656
|
-
|
|
657
|
-
['
|
|
595
|
+
['tag', shortUIntConst(Tag.NameserviceMtree)],
|
|
596
|
+
['version', shortUIntConst(1)],
|
|
597
|
+
['mtree', entry()],
|
|
658
598
|
],
|
|
659
599
|
},
|
|
660
600
|
[Tag.OraclesMtree]: {
|
|
661
601
|
1: [
|
|
662
|
-
|
|
663
|
-
['
|
|
602
|
+
['tag', shortUIntConst(Tag.OraclesMtree)],
|
|
603
|
+
['version', shortUIntConst(1)],
|
|
604
|
+
['otree', entry()],
|
|
664
605
|
],
|
|
665
606
|
},
|
|
666
607
|
[Tag.AccountsMtree]: {
|
|
667
608
|
1: [
|
|
668
|
-
|
|
669
|
-
['
|
|
609
|
+
['tag', shortUIntConst(Tag.AccountsMtree)],
|
|
610
|
+
['version', shortUIntConst(1)],
|
|
611
|
+
['accounts', entry()],
|
|
670
612
|
],
|
|
671
613
|
},
|
|
672
614
|
[Tag.GaAttachTx]: {
|
|
673
615
|
1: [
|
|
674
|
-
|
|
675
|
-
['
|
|
616
|
+
['tag', shortUIntConst(Tag.GaAttachTx)],
|
|
617
|
+
['version', shortUIntConst(1)],
|
|
618
|
+
['ownerId', address(Encoding.AccountAddress)],
|
|
676
619
|
['nonce', shortUInt],
|
|
677
|
-
['code',
|
|
678
|
-
['authFun',
|
|
679
|
-
['ctVersion',
|
|
620
|
+
['code', encoded(Encoding.ContractBytearray)],
|
|
621
|
+
['authFun', raw],
|
|
622
|
+
['ctVersion', ctVersion],
|
|
680
623
|
['fee', fee],
|
|
681
624
|
['ttl', shortUInt],
|
|
682
625
|
['gasLimit', gasLimit],
|
|
683
626
|
['gasPrice', gasPrice],
|
|
684
|
-
['callData',
|
|
627
|
+
['callData', encoded(Encoding.ContractBytearray)],
|
|
685
628
|
],
|
|
686
629
|
},
|
|
687
630
|
[Tag.GaMetaTx]: {
|
|
688
631
|
2: [
|
|
689
|
-
|
|
690
|
-
['
|
|
691
|
-
['
|
|
692
|
-
['
|
|
632
|
+
['tag', shortUIntConst(Tag.GaMetaTx)],
|
|
633
|
+
['version', shortUIntConst(2)],
|
|
634
|
+
['gaId', address(Encoding.AccountAddress)],
|
|
635
|
+
['authData', encoded(Encoding.ContractBytearray)],
|
|
636
|
+
['abiVersion', abiVersion],
|
|
693
637
|
['fee', fee],
|
|
694
638
|
['gasLimit', gasLimit],
|
|
695
639
|
['gasPrice', gasPrice],
|
|
696
|
-
['tx',
|
|
640
|
+
['tx', entry()],
|
|
697
641
|
],
|
|
698
642
|
},
|
|
699
643
|
[Tag.PayingForTx]: {
|
|
700
644
|
1: [
|
|
701
|
-
|
|
702
|
-
['
|
|
645
|
+
['tag', shortUIntConst(Tag.PayingForTx)],
|
|
646
|
+
['version', shortUIntConst(1)],
|
|
647
|
+
['payerId', address(Encoding.AccountAddress)],
|
|
703
648
|
['nonce', shortUInt],
|
|
704
649
|
['fee', fee],
|
|
705
|
-
['tx',
|
|
706
|
-
],
|
|
707
|
-
},
|
|
708
|
-
[Tag.CompilerSophia]: {
|
|
709
|
-
3: [
|
|
710
|
-
...BASE_TX,
|
|
711
|
-
['sourceCodeHash', FIELD_TYPES.rawBinary],
|
|
712
|
-
['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo],
|
|
713
|
-
['byteCode', FIELD_TYPES.rawBinary],
|
|
714
|
-
['compilerVersion', FIELD_TYPES.string],
|
|
715
|
-
['payable', FIELD_TYPES.bool],
|
|
650
|
+
['tx', entry()],
|
|
716
651
|
],
|
|
717
652
|
},
|
|
718
653
|
} as const;
|
|
719
654
|
|
|
655
|
+
type TxTypeSchemasNotCombined = {
|
|
656
|
+
[tag in Tag]: {
|
|
657
|
+
[ver in keyof typeof TX_SCHEMA[tag]]: BuildTxArgBySchema<typeof TX_SCHEMA[tag][ver]>
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
|
|
720
661
|
export type TxTypeSchemas = {
|
|
721
|
-
[key in Tag]:
|
|
722
|
-
typeof TX_SCHEMA[key][keyof typeof TX_SCHEMA[key]]
|
|
723
|
-
>
|
|
662
|
+
[key in Tag]: TxTypeSchemasNotCombined[key][keyof TxTypeSchemasNotCombined[key]]
|
|
724
663
|
};
|
|
725
664
|
|
|
726
665
|
export type TxSchema = TxTypeSchemas[Tag];
|