@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +1833 -1543
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +5 -4
- package/es/AeSdkAepp.mjs +13 -17
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +11 -12
- package/es/AeSdkMethods.mjs +6 -8
- package/es/AeSdkMethods.mjs.map +1 -1
- package/es/AeSdkWallet.mjs +1 -1
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +5 -1
- package/es/Node.mjs +11 -5
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +11 -6
- package/es/account/Base.mjs +0 -17
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.mjs +12 -25
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.mjs.map +1 -1
- package/es/account/LedgerFactory.mjs.map +1 -1
- package/es/account/Memory.d.ts +2 -1
- package/es/account/Memory.mjs +9 -21
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +12 -14
- package/es/aens.mjs +17 -31
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.d.ts +1 -1
- package/es/apis/compiler/compiler.mjs +4 -20
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +3 -2
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +1 -1
- package/es/apis/compiler/models/mappers.mjs +19 -2
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +15 -15
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.d.ts +1 -1
- package/es/apis/node/models/mappers.mjs +2 -1
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/parameters.d.ts +2 -2
- package/es/apis/node/models/parameters.mjs +2 -2
- package/es/apis/node/models/parameters.mjs.map +1 -1
- package/es/apis/node/node.mjs +3 -19
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +8 -8
- package/es/chain.mjs +20 -23
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +25 -12
- package/es/channel/Base.mjs +23 -26
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/Contract.mjs +8 -21
- package/es/channel/Contract.mjs.map +1 -1
- package/es/channel/Spend.d.ts +4 -2
- package/es/channel/Spend.mjs +0 -16
- package/es/channel/Spend.mjs.map +1 -1
- package/es/channel/handlers.mjs +6 -18
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +19 -2
- package/es/channel/internal.mjs +19 -19
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +30 -85
- package/es/contract/Contract.mjs +197 -215
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +10 -14
- package/es/contract/compiler/Base.mjs.map +1 -1
- package/es/contract/compiler/Cli.mjs +5 -11
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/contract/compiler/Http.mjs +6 -30
- package/es/contract/compiler/Http.mjs.map +1 -1
- package/es/contract/compiler/HttpNode.mjs.map +1 -1
- package/es/contract/compiler/getFileSystem.mjs.map +1 -1
- package/es/contract/delegation-signature.d.ts +43 -0
- package/es/contract/delegation-signature.mjs +45 -0
- package/es/contract/delegation-signature.mjs.map +1 -0
- package/es/contract/ga.d.ts +23 -7
- package/es/contract/ga.mjs +52 -27
- package/es/contract/ga.mjs.map +1 -1
- package/es/index-browser.d.ts +5 -4
- package/es/index-browser.mjs +7 -21
- package/es/index-browser.mjs.map +1 -1
- package/es/oracle.d.ts +12 -17
- package/es/oracle.mjs +28 -48
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +19 -27
- package/es/spend.mjs +20 -43
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/SchemaTypes.d.ts +37 -0
- package/es/tx/builder/SchemaTypes.mjs +2 -0
- package/es/tx/builder/SchemaTypes.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +4 -2
- package/es/tx/builder/constants.mjs +2 -0
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/abi-version.d.ts +11 -2
- package/es/tx/builder/field-types/abi-version.mjs +24 -4
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
- package/es/tx/builder/field-types/address.mjs.map +1 -1
- package/es/tx/builder/field-types/array.d.ts +1 -1
- package/es/tx/builder/field-types/array.mjs.map +1 -1
- package/es/tx/builder/field-types/boolean.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/es/tx/builder/field-types/coin-amount.mjs +4 -5
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +22 -3
- package/es/tx/builder/field-types/ct-version.mjs +32 -4
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
- package/es/tx/builder/field-types/deposit.d.ts +2 -1
- package/es/tx/builder/field-types/deposit.mjs +3 -2
- package/es/tx/builder/field-types/deposit.mjs.map +1 -1
- package/es/tx/builder/field-types/encoded.d.ts +1 -1
- package/es/tx/builder/field-types/encoded.mjs.map +1 -1
- package/es/tx/builder/field-types/entry.mjs +3 -0
- package/es/tx/builder/field-types/entry.mjs.map +1 -1
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +3 -1
- package/es/tx/builder/field-types/fee.mjs +5 -1
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/field.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/es/tx/builder/field-types/gas-limit.mjs +4 -2
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +3 -1
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +52 -13
- package/es/tx/builder/field-types/index.mjs +10 -2
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/map.d.ts +13 -0
- package/es/tx/builder/field-types/map.mjs +49 -0
- package/es/tx/builder/field-types/map.mjs.map +1 -0
- package/es/tx/builder/field-types/mptree.d.ts +7 -2
- package/es/tx/builder/field-types/mptree.mjs +5 -7
- package/es/tx/builder/field-types/mptree.mjs.map +1 -1
- package/es/tx/builder/field-types/name-fee.d.ts +1 -1
- package/es/tx/builder/field-types/name-fee.mjs +2 -2
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/name-id.mjs.map +1 -1
- package/es/tx/builder/field-types/name.mjs.map +1 -1
- package/es/tx/builder/field-types/nonce.d.ts +14 -0
- package/es/tx/builder/field-types/nonce.mjs +29 -0
- package/es/tx/builder/field-types/nonce.mjs.map +1 -0
- package/es/tx/builder/field-types/pointers.mjs.map +1 -1
- package/es/tx/builder/field-types/raw.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/string.mjs.map +1 -1
- package/es/tx/builder/field-types/ttl.d.ts +11 -0
- package/es/tx/builder/field-types/ttl.mjs +21 -0
- package/es/tx/builder/field-types/ttl.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/wrapped.d.ts +14 -0
- package/es/tx/builder/field-types/wrapped.mjs +22 -0
- package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +20 -20
- package/es/tx/builder/index.mjs +54 -64
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +2735 -2865
- package/es/tx/builder/schema.generated.d.ts +2011 -0
- package/es/tx/builder/schema.generated.mjs +2 -0
- package/es/tx/builder/schema.generated.mjs.map +1 -0
- package/es/tx/builder/schema.mjs +459 -155
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/execution-cost.d.ts +35 -0
- package/es/tx/execution-cost.mjs +123 -0
- package/es/tx/execution-cost.mjs.map +1 -0
- package/es/tx/transaction-signer.d.ts +6 -0
- package/es/tx/transaction-signer.mjs +27 -0
- package/es/tx/transaction-signer.mjs.map +1 -0
- package/es/tx/validator.mjs +60 -109
- package/es/tx/validator.mjs.map +1 -1
- package/es/utils/amount-formatter.mjs +0 -16
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +3 -2
- package/es/utils/autorest.mjs +43 -11
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bytes.mjs +0 -16
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.mjs +0 -16
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +14 -31
- package/es/utils/errors.mjs +3 -33
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/other.d.ts +1 -1
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.mjs +0 -17
- package/es/utils/string.mjs.map +1 -1
- package/package.json +34 -30
- package/src/AeSdkAepp.ts +16 -14
- package/src/AeSdkMethods.ts +11 -16
- package/src/AeSdkWallet.ts +1 -1
- package/src/Node.ts +17 -6
- package/src/account/Base.ts +11 -22
- package/src/account/Generalized.ts +9 -24
- package/src/account/Memory.ts +14 -21
- package/src/aens.ts +31 -47
- package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
- package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
- package/src/aepp-wallet-communication/rpc/types.ts +7 -2
- package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
- package/src/apis/compiler/compiler.ts +3 -27
- package/src/apis/compiler/models/index.ts +3 -2
- package/src/apis/compiler/models/mappers.ts +15 -2
- package/src/apis/node/models/index.ts +16 -15
- package/src/apis/node/models/mappers.ts +2 -1
- package/src/apis/node/models/parameters.ts +2 -2
- package/src/apis/node/node.ts +3 -27
- package/src/chain.ts +29 -28
- package/src/channel/Base.ts +33 -33
- package/src/channel/Contract.ts +8 -23
- package/src/channel/Spend.ts +2 -17
- package/src/channel/handlers.ts +5 -18
- package/src/channel/internal.ts +40 -22
- package/src/contract/Contract.ts +161 -170
- package/src/contract/compiler/Base.ts +10 -14
- package/src/contract/compiler/Cli.ts +5 -11
- package/src/contract/compiler/Http.ts +6 -25
- package/src/contract/delegation-signature.ts +56 -0
- package/src/contract/ga.ts +53 -32
- package/src/index-browser.ts +15 -21
- package/src/oracle.ts +46 -56
- package/src/spend.ts +33 -67
- package/src/tx/builder/SchemaTypes.ts +79 -0
- package/src/tx/builder/constants.ts +2 -0
- package/src/tx/builder/field-types/abi-version.ts +29 -6
- package/src/tx/builder/field-types/array.ts +1 -1
- package/src/tx/builder/field-types/coin-amount.ts +6 -4
- package/src/tx/builder/field-types/ct-version.ts +37 -4
- package/src/tx/builder/field-types/deposit.ts +3 -1
- package/src/tx/builder/field-types/encoded.ts +1 -1
- package/src/tx/builder/field-types/entry.ts +8 -3
- package/src/tx/builder/field-types/fee.ts +6 -4
- package/src/tx/builder/field-types/gas-limit.ts +2 -2
- package/src/tx/builder/field-types/index.ts +15 -1
- package/src/tx/builder/field-types/map.ts +45 -0
- package/src/tx/builder/field-types/mptree.ts +4 -3
- package/src/tx/builder/field-types/name-fee.ts +2 -1
- package/src/tx/builder/field-types/nonce.ts +40 -0
- package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
- package/src/tx/builder/field-types/ttl.ts +24 -0
- package/src/tx/builder/field-types/wrapped.ts +32 -0
- package/src/tx/builder/index.ts +57 -71
- package/src/tx/builder/schema.generated.ts +2013 -0
- package/src/tx/builder/schema.ts +544 -624
- package/src/tx/execution-cost.ts +146 -0
- package/src/tx/transaction-signer.ts +27 -0
- package/src/tx/validator.ts +60 -91
- package/src/utils/amount-formatter.ts +0 -16
- package/src/utils/autorest.ts +52 -11
- package/src/utils/bytes.ts +0 -16
- package/src/utils/crypto.ts +0 -16
- package/src/utils/errors.ts +16 -45
- package/src/utils/string.ts +0 -17
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +5 -4
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.2/Node.d.ts +5 -1
- package/types-legacy/ts4.2/account/Base.d.ts +11 -6
- package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.2/aens.d.ts +12 -14
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.2/chain.d.ts +8 -8
- package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +10 -14
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.2/index-browser.d.ts +5 -4
- package/types-legacy/ts4.2/oracle.d.ts +12 -17
- package/types-legacy/ts4.2/spend.d.ts +19 -27
- package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.2/utils/other.d.ts +1 -1
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +5 -4
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.5/Node.d.ts +5 -1
- package/types-legacy/ts4.5/account/Base.d.ts +11 -6
- package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.5/aens.d.ts +12 -14
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.5/chain.d.ts +8 -8
- package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +10 -14
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.5/index-browser.d.ts +5 -4
- package/types-legacy/ts4.5/oracle.d.ts +12 -17
- package/types-legacy/ts4.5/spend.d.ts +19 -27
- package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.5/utils/other.d.ts +1 -1
- package/es/tx/index.d.ts +0 -19
- package/es/tx/index.mjs +0 -115
- package/es/tx/index.mjs.map +0 -1
- package/src/apis/compiler/code-model-v4.yaml +0 -2442
- package/src/apis/node/code-model-v4.yaml +0 -10080
- package/src/tx/index.ts +0 -129
- package/types-legacy/ts4.2/tx/index.d.ts +0 -19
- package/types-legacy/ts4.5/tx/index.d.ts +0 -19
package/src/tx/builder/schema.ts
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
// # RLP version number
|
|
5
5
|
// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization
|
|
6
6
|
|
|
7
|
-
import BigNumber from 'bignumber.js';
|
|
8
7
|
import { Tag } from './constants';
|
|
8
|
+
import SchemaTypes from './SchemaTypes';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,
|
|
11
11
|
address, pointers, entry, enumeration, mptree, shortUIntConst, string, encoded, raw,
|
|
12
|
-
array, boolean, ctVersion, abiVersion,
|
|
12
|
+
array, boolean, ctVersion, abiVersion, ttl, nonce, map, wrapped,
|
|
13
13
|
} from './field-types';
|
|
14
|
-
import { Encoding } from '../../utils/encoder';
|
|
15
|
-
import { UnionToIntersection } from '../../utils/other';
|
|
14
|
+
import { Encoded, Encoding } from '../../utils/encoder';
|
|
16
15
|
import { idTagToEncoding } from './field-types/address';
|
|
17
16
|
|
|
18
17
|
export enum ORACLE_TTL_TYPES {
|
|
@@ -20,10 +19,7 @@ export enum ORACLE_TTL_TYPES {
|
|
|
20
19
|
block = 1,
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
// # TRANSACTION DEFAULT TTL
|
|
24
|
-
export const TX_TTL = 0;
|
|
25
22
|
// # ORACLE
|
|
26
|
-
export const QUERY_FEE = 30000;
|
|
27
23
|
export const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };
|
|
28
24
|
export const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
|
|
29
25
|
export const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
|
|
@@ -33,634 +29,558 @@ export const DRY_RUN_ACCOUNT = {
|
|
|
33
29
|
amount: 100000000000000000000000000000000000n,
|
|
34
30
|
} as const;
|
|
35
31
|
|
|
36
|
-
export type TxField = [
|
|
37
|
-
name: string,
|
|
38
|
-
type: Field,
|
|
39
|
-
];
|
|
40
|
-
|
|
41
32
|
export enum CallReturnType {
|
|
42
33
|
Ok = 0,
|
|
43
34
|
Error = 1,
|
|
44
35
|
Revert = 2,
|
|
45
36
|
}
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
// TODO: figure out how to omit overriding types of recursive fields
|
|
39
|
+
interface EntryAny {
|
|
40
|
+
serialize: (value: TxParams | Uint8Array | Encoded.Transaction) => Buffer;
|
|
41
|
+
deserialize: (value: Buffer) => TxUnpacked;
|
|
42
|
+
recursiveType: true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const entryAny = entry() as unknown as EntryAny;
|
|
46
|
+
|
|
47
|
+
interface EntrySignedTx {
|
|
48
|
+
serialize: (value: TxParams & { tag: Tag.SignedTx } | Uint8Array | Encoded.Transaction) => Buffer;
|
|
49
|
+
deserialize: (value: Buffer) => TxUnpacked & { tag: Tag.SignedTx };
|
|
50
|
+
recursiveType: true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const entrySignedTx = entry(Tag.SignedTx) as unknown as EntrySignedTx;
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
interface EntryMtreeValueArray {
|
|
56
|
+
serialize: (
|
|
57
|
+
value: Array<TxParams & { tag: Tag.MtreeValue } | Uint8Array | Encoded.Transaction>,
|
|
58
|
+
) => Buffer[];
|
|
59
|
+
deserialize: (value: Buffer[]) => Array<TxUnpacked & { tag: Tag.MtreeValue }>;
|
|
60
|
+
recursiveType: true;
|
|
61
|
+
}
|
|
50
62
|
|
|
51
|
-
|
|
52
|
-
T,
|
|
53
|
-
NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T],
|
|
54
|
-
> = Partial<Pick<T, NK>> & Omit<T, NK>;
|
|
63
|
+
const entryMtreeValueArray = array(entry(Tag.MtreeValue)) as unknown as EntryMtreeValueArray;
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
: never
|
|
62
|
-
: never
|
|
63
|
-
>;
|
|
65
|
+
interface EntryTreesPoi {
|
|
66
|
+
serialize: (value: TxParams & { tag: Tag.TreesPoi } | Uint8Array | Encoded.Transaction) => Buffer;
|
|
67
|
+
deserialize: (value: Buffer) => TxUnpacked & { tag: Tag.TreesPoi };
|
|
68
|
+
recursiveType: true;
|
|
69
|
+
}
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
const entryTreesPoi = entry(Tag.TreesPoi) as unknown as EntryTreesPoi;
|
|
72
|
+
|
|
73
|
+
interface MapContracts {
|
|
74
|
+
serialize: (
|
|
75
|
+
value: Record<Encoded.ContractAddress, TxParams & { tag: Tag.Contract }>,
|
|
76
|
+
) => Buffer;
|
|
77
|
+
deserialize: (
|
|
78
|
+
value: Buffer,
|
|
79
|
+
) => Record<Encoded.ContractAddress, TxUnpacked & { tag: Tag.Contract }>;
|
|
80
|
+
recursiveType: true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const mapContracts = map(Encoding.ContractAddress, Tag.Contract) as unknown as MapContracts;
|
|
84
|
+
|
|
85
|
+
interface MapAccounts {
|
|
86
|
+
serialize: (
|
|
87
|
+
value: Record<Encoded.AccountAddress, TxParams & { tag: Tag.Account }>,
|
|
88
|
+
) => Buffer;
|
|
89
|
+
deserialize: (value: Buffer) => Record<Encoded.AccountAddress, TxUnpacked & { tag: Tag.Account }>;
|
|
90
|
+
recursiveType: true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const mapAccounts = map(Encoding.AccountAddress, Tag.Account) as unknown as MapAccounts;
|
|
94
|
+
|
|
95
|
+
interface MapCalls {
|
|
96
|
+
serialize: (
|
|
97
|
+
value: Record<Encoded.Bytearray, TxParams & { tag: Tag.ContractCall }>,
|
|
98
|
+
) => Buffer;
|
|
99
|
+
deserialize: (value: Buffer) => Record<Encoded.Bytearray, TxUnpacked & { tag: Tag.ContractCall }>;
|
|
100
|
+
recursiveType: true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const mapCalls = map(Encoding.Bytearray, Tag.ContractCall) as unknown as MapCalls;
|
|
104
|
+
|
|
105
|
+
interface MapChannels {
|
|
106
|
+
serialize: (
|
|
107
|
+
value: Record<Encoded.Channel, TxParams & { tag: Tag.Channel }>,
|
|
108
|
+
) => Buffer;
|
|
109
|
+
deserialize: (value: Buffer) => Record<Encoded.Channel, TxUnpacked & { tag: Tag.Channel }>;
|
|
110
|
+
recursiveType: true;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const mapChannels = map(Encoding.Channel, Tag.Channel) as unknown as MapChannels;
|
|
114
|
+
|
|
115
|
+
interface MapNames {
|
|
116
|
+
serialize: (
|
|
117
|
+
value: Record<Encoded.Name, TxParams & { tag: Tag.Name }>,
|
|
118
|
+
) => Buffer;
|
|
119
|
+
deserialize: (value: Buffer) => Record<Encoded.Name, TxUnpacked & { tag: Tag.Name }>;
|
|
120
|
+
recursiveType: true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const mapNames = map(Encoding.Name, Tag.Name) as unknown as MapNames;
|
|
124
|
+
|
|
125
|
+
interface MapOracles {
|
|
126
|
+
serialize: (
|
|
127
|
+
value: Record<Encoded.OracleAddress, TxParams & { tag: Tag.Oracle }>,
|
|
128
|
+
) => Buffer;
|
|
129
|
+
deserialize: (value: Buffer) => Record<Encoded.OracleAddress, TxUnpacked & { tag: Tag.Oracle }>;
|
|
130
|
+
recursiveType: true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const mapOracles = map(Encoding.OracleAddress, Tag.Oracle) as unknown as MapOracles;
|
|
68
134
|
|
|
69
135
|
/**
|
|
70
136
|
* @see {@link https://github.com/aeternity/protocol/blob/c007deeac4a01e401238412801ac7084ac72d60e/serializations.md#accounts-version-1-basic-accounts}
|
|
71
137
|
*/
|
|
72
|
-
export const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
['amount', uInt],
|
|
517
|
-
['callData', encoded(Encoding.ContractBytearray)],
|
|
518
|
-
['callStack', raw],
|
|
519
|
-
['gasPrice', gasPrice],
|
|
520
|
-
['gasLimit', gasLimit],
|
|
521
|
-
],
|
|
522
|
-
},
|
|
523
|
-
[Tag.ChannelClientReconnectTx]: {
|
|
524
|
-
1: [
|
|
525
|
-
['tag', shortUIntConst(Tag.ChannelClientReconnectTx)],
|
|
526
|
-
['version', shortUIntConst(1)],
|
|
527
|
-
['channelId', address(Encoding.Channel)],
|
|
528
|
-
['round', shortUInt],
|
|
529
|
-
['role', string],
|
|
530
|
-
['pubkey', address(Encoding.AccountAddress)],
|
|
531
|
-
],
|
|
532
|
-
},
|
|
533
|
-
[Tag.TreesPoi]: {
|
|
534
|
-
1: [
|
|
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))],
|
|
543
|
-
],
|
|
544
|
-
},
|
|
545
|
-
[Tag.StateTrees]: {
|
|
546
|
-
1: [
|
|
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()],
|
|
555
|
-
],
|
|
556
|
-
},
|
|
557
|
-
[Tag.Mtree]: {
|
|
558
|
-
1: [
|
|
559
|
-
['tag', shortUIntConst(Tag.Mtree)],
|
|
560
|
-
['version', shortUIntConst(1)],
|
|
561
|
-
['values', array(entry())],
|
|
562
|
-
],
|
|
563
|
-
},
|
|
564
|
-
[Tag.MtreeValue]: {
|
|
565
|
-
1: [
|
|
566
|
-
['tag', shortUIntConst(Tag.MtreeValue)],
|
|
567
|
-
['version', shortUIntConst(1)],
|
|
568
|
-
['key', raw],
|
|
569
|
-
['value', raw],
|
|
570
|
-
],
|
|
571
|
-
},
|
|
572
|
-
[Tag.ContractsMtree]: {
|
|
573
|
-
1: [
|
|
574
|
-
['tag', shortUIntConst(Tag.ContractsMtree)],
|
|
575
|
-
['version', shortUIntConst(1)],
|
|
576
|
-
['contracts', entry()],
|
|
577
|
-
],
|
|
578
|
-
},
|
|
579
|
-
[Tag.CallsMtree]: {
|
|
580
|
-
1: [
|
|
581
|
-
['tag', shortUIntConst(Tag.CallsMtree)],
|
|
582
|
-
['version', shortUIntConst(1)],
|
|
583
|
-
['calls', entry()],
|
|
584
|
-
],
|
|
585
|
-
},
|
|
586
|
-
[Tag.ChannelsMtree]: {
|
|
587
|
-
1: [
|
|
588
|
-
['tag', shortUIntConst(Tag.ChannelsMtree)],
|
|
589
|
-
['version', shortUIntConst(1)],
|
|
590
|
-
['channels', entry()],
|
|
591
|
-
],
|
|
592
|
-
},
|
|
593
|
-
[Tag.NameserviceMtree]: {
|
|
594
|
-
1: [
|
|
595
|
-
['tag', shortUIntConst(Tag.NameserviceMtree)],
|
|
596
|
-
['version', shortUIntConst(1)],
|
|
597
|
-
['mtree', entry()],
|
|
598
|
-
],
|
|
599
|
-
},
|
|
600
|
-
[Tag.OraclesMtree]: {
|
|
601
|
-
1: [
|
|
602
|
-
['tag', shortUIntConst(Tag.OraclesMtree)],
|
|
603
|
-
['version', shortUIntConst(1)],
|
|
604
|
-
['otree', entry()],
|
|
605
|
-
],
|
|
606
|
-
},
|
|
607
|
-
[Tag.AccountsMtree]: {
|
|
608
|
-
1: [
|
|
609
|
-
['tag', shortUIntConst(Tag.AccountsMtree)],
|
|
610
|
-
['version', shortUIntConst(1)],
|
|
611
|
-
['accounts', entry()],
|
|
612
|
-
],
|
|
613
|
-
},
|
|
614
|
-
[Tag.GaAttachTx]: {
|
|
615
|
-
1: [
|
|
616
|
-
['tag', shortUIntConst(Tag.GaAttachTx)],
|
|
617
|
-
['version', shortUIntConst(1)],
|
|
618
|
-
['ownerId', address(Encoding.AccountAddress)],
|
|
619
|
-
['nonce', shortUInt],
|
|
620
|
-
['code', encoded(Encoding.ContractBytearray)],
|
|
621
|
-
['authFun', raw],
|
|
622
|
-
['ctVersion', ctVersion],
|
|
623
|
-
['fee', fee],
|
|
624
|
-
['ttl', shortUInt],
|
|
625
|
-
['gasLimit', gasLimit],
|
|
626
|
-
['gasPrice', gasPrice],
|
|
627
|
-
['callData', encoded(Encoding.ContractBytearray)],
|
|
628
|
-
],
|
|
629
|
-
},
|
|
630
|
-
[Tag.GaMetaTx]: {
|
|
631
|
-
2: [
|
|
632
|
-
['tag', shortUIntConst(Tag.GaMetaTx)],
|
|
633
|
-
['version', shortUIntConst(2)],
|
|
634
|
-
['gaId', address(Encoding.AccountAddress)],
|
|
635
|
-
['authData', encoded(Encoding.ContractBytearray)],
|
|
636
|
-
['abiVersion', abiVersion],
|
|
637
|
-
['fee', fee],
|
|
638
|
-
['gasLimit', gasLimit],
|
|
639
|
-
['gasPrice', gasPrice],
|
|
640
|
-
['tx', entry()],
|
|
641
|
-
],
|
|
642
|
-
},
|
|
643
|
-
[Tag.PayingForTx]: {
|
|
644
|
-
1: [
|
|
645
|
-
['tag', shortUIntConst(Tag.PayingForTx)],
|
|
646
|
-
['version', shortUIntConst(1)],
|
|
647
|
-
['payerId', address(Encoding.AccountAddress)],
|
|
648
|
-
['nonce', shortUInt],
|
|
649
|
-
['fee', fee],
|
|
650
|
-
['tx', entry()],
|
|
651
|
-
],
|
|
652
|
-
},
|
|
653
|
-
} as const;
|
|
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
|
-
|
|
661
|
-
export type TxTypeSchemas = {
|
|
662
|
-
[key in Tag]: TxTypeSchemasNotCombined[key][keyof TxTypeSchemasNotCombined[key]]
|
|
663
|
-
};
|
|
138
|
+
export const txSchema = [{
|
|
139
|
+
tag: shortUIntConst(Tag.Account),
|
|
140
|
+
version: shortUIntConst(1),
|
|
141
|
+
nonce: shortUInt,
|
|
142
|
+
balance: uInt,
|
|
143
|
+
}, {
|
|
144
|
+
tag: shortUIntConst(Tag.Account),
|
|
145
|
+
version: shortUIntConst(2, true),
|
|
146
|
+
flags: uInt,
|
|
147
|
+
nonce: shortUInt,
|
|
148
|
+
balance: uInt,
|
|
149
|
+
gaContract: address(Encoding.ContractAddress, Encoding.Name),
|
|
150
|
+
gaAuthFun: encoded(Encoding.ContractBytearray),
|
|
151
|
+
}, {
|
|
152
|
+
tag: shortUIntConst(Tag.SignedTx),
|
|
153
|
+
version: shortUIntConst(1, true),
|
|
154
|
+
signatures: array(raw),
|
|
155
|
+
encodedTx: entryAny,
|
|
156
|
+
}, {
|
|
157
|
+
tag: shortUIntConst(Tag.SpendTx),
|
|
158
|
+
version: shortUIntConst(1, true),
|
|
159
|
+
senderId: address(Encoding.AccountAddress),
|
|
160
|
+
recipientId: address(Encoding.AccountAddress, Encoding.Name),
|
|
161
|
+
amount: coinAmount,
|
|
162
|
+
fee,
|
|
163
|
+
ttl,
|
|
164
|
+
nonce: nonce('senderId'),
|
|
165
|
+
payload: encoded(Encoding.Bytearray, true),
|
|
166
|
+
}, {
|
|
167
|
+
tag: shortUIntConst(Tag.Name),
|
|
168
|
+
version: shortUIntConst(1, true),
|
|
169
|
+
accountId: address(Encoding.AccountAddress),
|
|
170
|
+
nameTtl: shortUInt,
|
|
171
|
+
status: raw,
|
|
172
|
+
clientTtl: shortUInt,
|
|
173
|
+
pointers,
|
|
174
|
+
}, {
|
|
175
|
+
tag: shortUIntConst(Tag.NamePreclaimTx),
|
|
176
|
+
version: shortUIntConst(1, true),
|
|
177
|
+
accountId: address(Encoding.AccountAddress),
|
|
178
|
+
nonce: nonce('accountId'),
|
|
179
|
+
commitmentId: address(Encoding.Commitment),
|
|
180
|
+
fee,
|
|
181
|
+
ttl,
|
|
182
|
+
}, {
|
|
183
|
+
tag: shortUIntConst(Tag.NameClaimTx),
|
|
184
|
+
version: shortUIntConst(2, true),
|
|
185
|
+
accountId: address(Encoding.AccountAddress),
|
|
186
|
+
nonce: nonce('accountId'),
|
|
187
|
+
name,
|
|
188
|
+
nameSalt: uInt,
|
|
189
|
+
nameFee,
|
|
190
|
+
fee,
|
|
191
|
+
ttl,
|
|
192
|
+
}, {
|
|
193
|
+
tag: shortUIntConst(Tag.NameUpdateTx),
|
|
194
|
+
version: shortUIntConst(1, true),
|
|
195
|
+
accountId: address(Encoding.AccountAddress),
|
|
196
|
+
nonce: nonce('accountId'),
|
|
197
|
+
nameId,
|
|
198
|
+
nameTtl: shortUInt,
|
|
199
|
+
pointers,
|
|
200
|
+
clientTtl: shortUInt,
|
|
201
|
+
fee,
|
|
202
|
+
ttl,
|
|
203
|
+
}, {
|
|
204
|
+
tag: shortUIntConst(Tag.NameTransferTx),
|
|
205
|
+
version: shortUIntConst(1, true),
|
|
206
|
+
accountId: address(Encoding.AccountAddress),
|
|
207
|
+
nonce: nonce('accountId'),
|
|
208
|
+
nameId,
|
|
209
|
+
recipientId: address(Encoding.AccountAddress, Encoding.Name),
|
|
210
|
+
fee,
|
|
211
|
+
ttl,
|
|
212
|
+
}, {
|
|
213
|
+
tag: shortUIntConst(Tag.NameRevokeTx),
|
|
214
|
+
version: shortUIntConst(1, true),
|
|
215
|
+
accountId: address(Encoding.AccountAddress),
|
|
216
|
+
nonce: nonce('accountId'),
|
|
217
|
+
nameId,
|
|
218
|
+
fee,
|
|
219
|
+
ttl,
|
|
220
|
+
}, {
|
|
221
|
+
tag: shortUIntConst(Tag.Contract),
|
|
222
|
+
version: shortUIntConst(1, true),
|
|
223
|
+
owner: address(Encoding.AccountAddress),
|
|
224
|
+
ctVersion,
|
|
225
|
+
code: encoded(Encoding.ContractBytearray),
|
|
226
|
+
log: encoded(Encoding.ContractBytearray),
|
|
227
|
+
active: boolean,
|
|
228
|
+
referers: array(address(Encoding.AccountAddress)),
|
|
229
|
+
deposit,
|
|
230
|
+
}, {
|
|
231
|
+
tag: shortUIntConst(Tag.ContractCreateTx),
|
|
232
|
+
version: shortUIntConst(1, true),
|
|
233
|
+
ownerId: address(Encoding.AccountAddress),
|
|
234
|
+
nonce: nonce('ownerId'),
|
|
235
|
+
code: encoded(Encoding.ContractBytearray),
|
|
236
|
+
ctVersion,
|
|
237
|
+
fee,
|
|
238
|
+
ttl,
|
|
239
|
+
deposit,
|
|
240
|
+
amount: coinAmount,
|
|
241
|
+
gasLimit,
|
|
242
|
+
gasPrice,
|
|
243
|
+
callData: encoded(Encoding.ContractBytearray),
|
|
244
|
+
}, {
|
|
245
|
+
tag: shortUIntConst(Tag.ContractCallTx),
|
|
246
|
+
version: shortUIntConst(1, true),
|
|
247
|
+
callerId: address(Encoding.AccountAddress),
|
|
248
|
+
nonce: nonce('callerId'),
|
|
249
|
+
contractId: address(Encoding.ContractAddress, Encoding.Name),
|
|
250
|
+
abiVersion,
|
|
251
|
+
fee,
|
|
252
|
+
ttl,
|
|
253
|
+
amount: coinAmount,
|
|
254
|
+
gasLimit,
|
|
255
|
+
gasPrice,
|
|
256
|
+
callData: encoded(Encoding.ContractBytearray),
|
|
257
|
+
}, {
|
|
258
|
+
tag: shortUIntConst(Tag.ContractCall),
|
|
259
|
+
version: shortUIntConst(2, true),
|
|
260
|
+
callerId: address(Encoding.AccountAddress),
|
|
261
|
+
callerNonce: shortUInt,
|
|
262
|
+
height: shortUInt,
|
|
263
|
+
contractId: address(Encoding.ContractAddress),
|
|
264
|
+
// TODO: rename after resolving https://github.com/aeternity/protocol/issues/506
|
|
265
|
+
gasPrice: uInt,
|
|
266
|
+
gasUsed: shortUInt,
|
|
267
|
+
returnValue: encoded(Encoding.ContractBytearray),
|
|
268
|
+
returnType: enumeration(CallReturnType),
|
|
269
|
+
// TODO: add serialization for
|
|
270
|
+
// <log> :: [ { <address> :: id, [ <topics> :: binary() }, <data> :: binary() } ]
|
|
271
|
+
log: array(raw),
|
|
272
|
+
}, {
|
|
273
|
+
tag: shortUIntConst(Tag.Oracle),
|
|
274
|
+
version: shortUIntConst(1, true),
|
|
275
|
+
accountId: address(Encoding.AccountAddress),
|
|
276
|
+
queryFormat: string,
|
|
277
|
+
responseFormat: string,
|
|
278
|
+
queryFee: coinAmount,
|
|
279
|
+
oracleTtlValue: shortUInt,
|
|
280
|
+
abiVersion,
|
|
281
|
+
}, {
|
|
282
|
+
tag: shortUIntConst(Tag.OracleRegisterTx),
|
|
283
|
+
version: shortUIntConst(1, true),
|
|
284
|
+
accountId: address(Encoding.AccountAddress),
|
|
285
|
+
nonce: nonce('accountId'),
|
|
286
|
+
queryFormat: string,
|
|
287
|
+
responseFormat: string,
|
|
288
|
+
queryFee: coinAmount,
|
|
289
|
+
oracleTtlType: enumeration(ORACLE_TTL_TYPES),
|
|
290
|
+
oracleTtlValue: shortUInt,
|
|
291
|
+
fee,
|
|
292
|
+
ttl,
|
|
293
|
+
abiVersion,
|
|
294
|
+
}, {
|
|
295
|
+
tag: shortUIntConst(Tag.OracleExtendTx),
|
|
296
|
+
version: shortUIntConst(1, true),
|
|
297
|
+
oracleId: address(Encoding.OracleAddress, Encoding.Name),
|
|
298
|
+
nonce: nonce('oracleId'),
|
|
299
|
+
oracleTtlType: enumeration(ORACLE_TTL_TYPES),
|
|
300
|
+
oracleTtlValue: shortUInt,
|
|
301
|
+
fee,
|
|
302
|
+
ttl,
|
|
303
|
+
}, {
|
|
304
|
+
tag: shortUIntConst(Tag.OracleQueryTx),
|
|
305
|
+
version: shortUIntConst(1, true),
|
|
306
|
+
senderId: address(Encoding.AccountAddress),
|
|
307
|
+
nonce: nonce('senderId'),
|
|
308
|
+
oracleId: address(Encoding.OracleAddress, Encoding.Name),
|
|
309
|
+
query: string,
|
|
310
|
+
queryFee: coinAmount,
|
|
311
|
+
queryTtlType: enumeration(ORACLE_TTL_TYPES),
|
|
312
|
+
queryTtlValue: shortUInt,
|
|
313
|
+
responseTtlType: enumeration(ORACLE_TTL_TYPES),
|
|
314
|
+
responseTtlValue: shortUInt,
|
|
315
|
+
fee,
|
|
316
|
+
ttl,
|
|
317
|
+
}, {
|
|
318
|
+
tag: shortUIntConst(Tag.OracleResponseTx),
|
|
319
|
+
version: shortUIntConst(1, true),
|
|
320
|
+
oracleId: address(Encoding.OracleAddress),
|
|
321
|
+
nonce: nonce('oracleId'),
|
|
322
|
+
queryId: encoded(Encoding.OracleQueryId),
|
|
323
|
+
response: string,
|
|
324
|
+
responseTtlType: enumeration(ORACLE_TTL_TYPES),
|
|
325
|
+
responseTtlValue: shortUInt,
|
|
326
|
+
fee,
|
|
327
|
+
ttl,
|
|
328
|
+
}, {
|
|
329
|
+
tag: shortUIntConst(Tag.ChannelCreateTx),
|
|
330
|
+
version: shortUIntConst(2, true),
|
|
331
|
+
initiator: address(Encoding.AccountAddress),
|
|
332
|
+
initiatorAmount: uInt,
|
|
333
|
+
responder: address(Encoding.AccountAddress),
|
|
334
|
+
responderAmount: uInt,
|
|
335
|
+
channelReserve: uInt,
|
|
336
|
+
lockPeriod: uInt,
|
|
337
|
+
ttl,
|
|
338
|
+
fee,
|
|
339
|
+
initiatorDelegateIds: array(address(...idTagToEncoding)),
|
|
340
|
+
responderDelegateIds: array(address(...idTagToEncoding)),
|
|
341
|
+
stateHash: encoded(Encoding.State),
|
|
342
|
+
nonce: nonce('initiator'),
|
|
343
|
+
}, {
|
|
344
|
+
tag: shortUIntConst(Tag.ChannelCloseMutualTx),
|
|
345
|
+
version: shortUIntConst(1, true),
|
|
346
|
+
channelId: address(Encoding.Channel),
|
|
347
|
+
fromId: address(Encoding.AccountAddress),
|
|
348
|
+
initiatorAmountFinal: uInt,
|
|
349
|
+
responderAmountFinal: uInt,
|
|
350
|
+
ttl,
|
|
351
|
+
fee,
|
|
352
|
+
nonce: nonce('fromId'),
|
|
353
|
+
}, {
|
|
354
|
+
tag: shortUIntConst(Tag.ChannelCloseSoloTx),
|
|
355
|
+
version: shortUIntConst(1, true),
|
|
356
|
+
channelId: address(Encoding.Channel),
|
|
357
|
+
fromId: address(Encoding.AccountAddress),
|
|
358
|
+
payload: encoded(Encoding.Transaction),
|
|
359
|
+
poi: entryTreesPoi,
|
|
360
|
+
ttl,
|
|
361
|
+
fee,
|
|
362
|
+
nonce: nonce('fromId'),
|
|
363
|
+
}, {
|
|
364
|
+
tag: shortUIntConst(Tag.ChannelSlashTx),
|
|
365
|
+
version: shortUIntConst(1, true),
|
|
366
|
+
channelId: address(Encoding.Channel),
|
|
367
|
+
fromId: address(Encoding.AccountAddress),
|
|
368
|
+
payload: encoded(Encoding.Transaction),
|
|
369
|
+
poi: entryTreesPoi,
|
|
370
|
+
ttl,
|
|
371
|
+
fee,
|
|
372
|
+
nonce: nonce('fromId'),
|
|
373
|
+
}, {
|
|
374
|
+
tag: shortUIntConst(Tag.ChannelDepositTx),
|
|
375
|
+
version: shortUIntConst(1, true),
|
|
376
|
+
channelId: address(Encoding.Channel),
|
|
377
|
+
fromId: address(Encoding.AccountAddress),
|
|
378
|
+
amount: uInt,
|
|
379
|
+
ttl,
|
|
380
|
+
fee,
|
|
381
|
+
stateHash: encoded(Encoding.State),
|
|
382
|
+
round: shortUInt,
|
|
383
|
+
nonce: nonce('fromId'),
|
|
384
|
+
}, {
|
|
385
|
+
tag: shortUIntConst(Tag.ChannelWithdrawTx),
|
|
386
|
+
version: shortUIntConst(1, true),
|
|
387
|
+
channelId: address(Encoding.Channel),
|
|
388
|
+
toId: address(Encoding.AccountAddress),
|
|
389
|
+
amount: uInt,
|
|
390
|
+
ttl,
|
|
391
|
+
fee,
|
|
392
|
+
stateHash: encoded(Encoding.State),
|
|
393
|
+
round: shortUInt,
|
|
394
|
+
nonce: nonce('fromId'),
|
|
395
|
+
}, {
|
|
396
|
+
tag: shortUIntConst(Tag.ChannelSettleTx),
|
|
397
|
+
version: shortUIntConst(1, true),
|
|
398
|
+
channelId: address(Encoding.Channel),
|
|
399
|
+
fromId: address(Encoding.AccountAddress),
|
|
400
|
+
initiatorAmountFinal: uInt,
|
|
401
|
+
responderAmountFinal: uInt,
|
|
402
|
+
ttl,
|
|
403
|
+
fee,
|
|
404
|
+
nonce: nonce('fromId'),
|
|
405
|
+
}, {
|
|
406
|
+
tag: shortUIntConst(Tag.ChannelForceProgressTx),
|
|
407
|
+
version: shortUIntConst(1, true),
|
|
408
|
+
channelId: address(Encoding.Channel),
|
|
409
|
+
fromId: address(Encoding.AccountAddress),
|
|
410
|
+
payload: encoded(Encoding.Transaction),
|
|
411
|
+
round: shortUInt,
|
|
412
|
+
update: encoded(Encoding.ContractBytearray),
|
|
413
|
+
stateHash: encoded(Encoding.State),
|
|
414
|
+
offChainTrees: encoded(Encoding.StateTrees),
|
|
415
|
+
ttl,
|
|
416
|
+
fee,
|
|
417
|
+
nonce: nonce('fromId'),
|
|
418
|
+
}, {
|
|
419
|
+
tag: shortUIntConst(Tag.ChannelOffChainTx),
|
|
420
|
+
version: shortUIntConst(2, true),
|
|
421
|
+
channelId: address(Encoding.Channel),
|
|
422
|
+
round: shortUInt,
|
|
423
|
+
stateHash: encoded(Encoding.State),
|
|
424
|
+
}, {
|
|
425
|
+
tag: shortUIntConst(Tag.Channel),
|
|
426
|
+
version: shortUIntConst(3, true),
|
|
427
|
+
initiator: address(Encoding.AccountAddress),
|
|
428
|
+
responder: address(Encoding.AccountAddress),
|
|
429
|
+
channelAmount: uInt,
|
|
430
|
+
initiatorAmount: uInt,
|
|
431
|
+
responderAmount: uInt,
|
|
432
|
+
channelReserve: uInt,
|
|
433
|
+
initiatorDelegateIds: array(address(...idTagToEncoding)),
|
|
434
|
+
responderDelegateIds: array(address(...idTagToEncoding)),
|
|
435
|
+
stateHash: encoded(Encoding.State),
|
|
436
|
+
round: shortUInt,
|
|
437
|
+
soloRound: uInt,
|
|
438
|
+
lockPeriod: uInt,
|
|
439
|
+
lockedUntil: uInt,
|
|
440
|
+
initiatorAuth: encoded(Encoding.ContractBytearray),
|
|
441
|
+
responderAuth: encoded(Encoding.ContractBytearray),
|
|
442
|
+
}, {
|
|
443
|
+
tag: shortUIntConst(Tag.ChannelSnapshotSoloTx),
|
|
444
|
+
version: shortUIntConst(1, true),
|
|
445
|
+
channelId: address(Encoding.Channel),
|
|
446
|
+
fromId: address(Encoding.AccountAddress),
|
|
447
|
+
payload: encoded(Encoding.Transaction),
|
|
448
|
+
ttl,
|
|
449
|
+
fee,
|
|
450
|
+
nonce: nonce('fromId'),
|
|
451
|
+
}, {
|
|
452
|
+
tag: shortUIntConst(Tag.ChannelOffChainUpdateTransfer),
|
|
453
|
+
version: shortUIntConst(1, true),
|
|
454
|
+
from: address(Encoding.AccountAddress),
|
|
455
|
+
to: address(Encoding.AccountAddress),
|
|
456
|
+
amount: uInt,
|
|
457
|
+
}, {
|
|
458
|
+
tag: shortUIntConst(Tag.ChannelOffChainUpdateDeposit),
|
|
459
|
+
version: shortUIntConst(1, true),
|
|
460
|
+
from: address(Encoding.AccountAddress),
|
|
461
|
+
amount: uInt,
|
|
462
|
+
}, {
|
|
463
|
+
tag: shortUIntConst(Tag.ChannelOffChainUpdateWithdraw),
|
|
464
|
+
version: shortUIntConst(1, true),
|
|
465
|
+
from: address(Encoding.AccountAddress),
|
|
466
|
+
amount: uInt,
|
|
467
|
+
}, {
|
|
468
|
+
tag: shortUIntConst(Tag.ChannelOffChainUpdateCreateContract),
|
|
469
|
+
version: shortUIntConst(1, true),
|
|
470
|
+
owner: address(Encoding.AccountAddress),
|
|
471
|
+
ctVersion,
|
|
472
|
+
code: encoded(Encoding.ContractBytearray),
|
|
473
|
+
deposit: uInt,
|
|
474
|
+
callData: encoded(Encoding.ContractBytearray),
|
|
475
|
+
}, {
|
|
476
|
+
tag: shortUIntConst(Tag.ChannelOffChainUpdateCallContract),
|
|
477
|
+
version: shortUIntConst(1, true),
|
|
478
|
+
caller: address(Encoding.AccountAddress),
|
|
479
|
+
contract: address(Encoding.ContractAddress),
|
|
480
|
+
abiVersion,
|
|
481
|
+
amount: uInt,
|
|
482
|
+
callData: encoded(Encoding.ContractBytearray),
|
|
483
|
+
callStack: raw,
|
|
484
|
+
gasPrice,
|
|
485
|
+
gasLimit,
|
|
486
|
+
}, {
|
|
487
|
+
tag: shortUIntConst(Tag.ChannelClientReconnectTx),
|
|
488
|
+
version: shortUIntConst(1, true),
|
|
489
|
+
channelId: address(Encoding.Channel),
|
|
490
|
+
round: shortUInt,
|
|
491
|
+
role: string,
|
|
492
|
+
pubkey: address(Encoding.AccountAddress),
|
|
493
|
+
}, {
|
|
494
|
+
tag: shortUIntConst(Tag.TreesPoi),
|
|
495
|
+
version: shortUIntConst(1, true),
|
|
496
|
+
// TODO: inline an extra wrapping array after resolving https://github.com/aeternity/protocol/issues/505
|
|
497
|
+
accounts: array(mptree(Encoding.AccountAddress, Tag.Account)),
|
|
498
|
+
calls: array(mptree(Encoding.Bytearray, Tag.ContractCall)),
|
|
499
|
+
channels: array(mptree(Encoding.Channel, Tag.Channel)),
|
|
500
|
+
contracts: array(mptree(Encoding.ContractAddress, Tag.Contract)),
|
|
501
|
+
ns: array(mptree(Encoding.Name, Tag.Name)),
|
|
502
|
+
oracles: array(mptree(Encoding.OracleAddress, Tag.Oracle)),
|
|
503
|
+
}, {
|
|
504
|
+
tag: shortUIntConst(Tag.StateTrees),
|
|
505
|
+
version: shortUIntConst(0, true),
|
|
506
|
+
contracts: wrapped(Tag.ContractsMtree) as unknown as MapContracts,
|
|
507
|
+
calls: wrapped(Tag.CallsMtree) as unknown as MapCalls,
|
|
508
|
+
channels: wrapped(Tag.ChannelsMtree) as unknown as MapChannels,
|
|
509
|
+
ns: wrapped(Tag.NameserviceMtree) as unknown as MapNames,
|
|
510
|
+
oracles: wrapped(Tag.OraclesMtree) as unknown as MapOracles,
|
|
511
|
+
accounts: wrapped(Tag.AccountsMtree) as unknown as MapAccounts,
|
|
512
|
+
}, {
|
|
513
|
+
tag: shortUIntConst(Tag.Mtree),
|
|
514
|
+
version: shortUIntConst(1, true),
|
|
515
|
+
values: entryMtreeValueArray,
|
|
516
|
+
}, {
|
|
517
|
+
tag: shortUIntConst(Tag.MtreeValue),
|
|
518
|
+
version: shortUIntConst(1, true),
|
|
519
|
+
key: raw,
|
|
520
|
+
value: raw,
|
|
521
|
+
}, {
|
|
522
|
+
tag: shortUIntConst(Tag.ContractsMtree),
|
|
523
|
+
version: shortUIntConst(1, true),
|
|
524
|
+
payload: mapContracts,
|
|
525
|
+
}, {
|
|
526
|
+
tag: shortUIntConst(Tag.CallsMtree),
|
|
527
|
+
version: shortUIntConst(1, true),
|
|
528
|
+
payload: mapCalls,
|
|
529
|
+
}, {
|
|
530
|
+
tag: shortUIntConst(Tag.ChannelsMtree),
|
|
531
|
+
version: shortUIntConst(1, true),
|
|
532
|
+
payload: mapChannels,
|
|
533
|
+
}, {
|
|
534
|
+
tag: shortUIntConst(Tag.NameserviceMtree),
|
|
535
|
+
version: shortUIntConst(1, true),
|
|
536
|
+
payload: mapNames,
|
|
537
|
+
}, {
|
|
538
|
+
tag: shortUIntConst(Tag.OraclesMtree),
|
|
539
|
+
version: shortUIntConst(1, true),
|
|
540
|
+
payload: mapOracles,
|
|
541
|
+
}, {
|
|
542
|
+
tag: shortUIntConst(Tag.AccountsMtree),
|
|
543
|
+
version: shortUIntConst(1, true),
|
|
544
|
+
payload: mapAccounts,
|
|
545
|
+
}, {
|
|
546
|
+
tag: shortUIntConst(Tag.GaAttachTx),
|
|
547
|
+
version: shortUIntConst(1, true),
|
|
548
|
+
ownerId: address(Encoding.AccountAddress),
|
|
549
|
+
nonce: nonce('ownerId'),
|
|
550
|
+
code: encoded(Encoding.ContractBytearray),
|
|
551
|
+
authFun: raw,
|
|
552
|
+
ctVersion,
|
|
553
|
+
fee,
|
|
554
|
+
ttl,
|
|
555
|
+
gasLimit,
|
|
556
|
+
gasPrice,
|
|
557
|
+
callData: encoded(Encoding.ContractBytearray),
|
|
558
|
+
}, {
|
|
559
|
+
tag: shortUIntConst(Tag.GaMetaTx),
|
|
560
|
+
version: shortUIntConst(2, true),
|
|
561
|
+
gaId: address(Encoding.AccountAddress),
|
|
562
|
+
authData: encoded(Encoding.ContractBytearray),
|
|
563
|
+
abiVersion,
|
|
564
|
+
fee,
|
|
565
|
+
gasLimit,
|
|
566
|
+
gasPrice,
|
|
567
|
+
tx: entrySignedTx,
|
|
568
|
+
}, {
|
|
569
|
+
tag: shortUIntConst(Tag.PayingForTx),
|
|
570
|
+
version: shortUIntConst(1, true),
|
|
571
|
+
payerId: address(Encoding.AccountAddress),
|
|
572
|
+
nonce: nonce('payerId'),
|
|
573
|
+
fee,
|
|
574
|
+
tx: entrySignedTx,
|
|
575
|
+
}, {
|
|
576
|
+
tag: shortUIntConst(Tag.GaMetaTxAuthData),
|
|
577
|
+
version: shortUIntConst(1, true),
|
|
578
|
+
fee: coinAmount,
|
|
579
|
+
gasPrice,
|
|
580
|
+
txHash: encoded(Encoding.TxHash),
|
|
581
|
+
}] as const;
|
|
664
582
|
|
|
665
|
-
|
|
666
|
-
export type
|
|
583
|
+
type TxSchema = SchemaTypes<typeof txSchema>;
|
|
584
|
+
export type TxParams = TxSchema['TxParams'];
|
|
585
|
+
export type TxParamsAsync = TxSchema['TxParamsAsync'];
|
|
586
|
+
export type TxUnpacked = TxSchema['TxUnpacked'];
|