@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.0-beta.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/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 +1792 -1525
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.mjs.map +1 -1
- 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 +11 -24
- 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 +19 -22
- 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 +174 -211
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +7 -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 +4 -3
- package/es/index-browser.mjs +6 -20
- 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 +2 -32
- 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/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 +8 -23
- 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 +6 -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 +28 -27
- 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 +133 -163
- package/src/contract/compiler/Base.ts +7 -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 +12 -20
- 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 +15 -44
- package/src/utils/string.ts +0 -17
- 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 +7 -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 +4 -3
- 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/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 +7 -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 +4 -3
- 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
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import { sendTransaction, resolveName } from './chain';
|
|
2
|
-
import { BuildTxOptions } from './tx';
|
|
1
|
+
import { sendTransaction, resolveName, SendTransactionOptions } from './chain';
|
|
2
|
+
import { BuildTxOptions } from './tx/builder';
|
|
3
3
|
import { Encoded } from './utils/encoder';
|
|
4
4
|
import { Tag, AensName } from './tx/builder/constants';
|
|
5
5
|
import AccountBase from './account/Base';
|
|
6
|
-
/**
|
|
7
|
-
* Sign and post a transaction to the chain
|
|
8
|
-
* @category chain
|
|
9
|
-
* @param tx - Transaction
|
|
10
|
-
* @param options - Options
|
|
11
|
-
* @param options.verify - Verify transaction before broadcast, throw error if not
|
|
12
|
-
* valid
|
|
13
|
-
* @returns Transaction
|
|
14
|
-
*/
|
|
15
|
-
export declare function send(tx: Encoded.Transaction, options: SendOptions): Promise<SendReturnType>;
|
|
16
|
-
type SendOptionsType = Parameters<AccountBase['signTransaction']>[1] & Parameters<typeof sendTransaction>[1] & {
|
|
17
|
-
onAccount: AccountBase;
|
|
18
|
-
};
|
|
19
|
-
export interface SendOptions extends SendOptionsType {
|
|
20
|
-
}
|
|
21
|
-
interface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {
|
|
22
|
-
}
|
|
23
6
|
/**
|
|
24
7
|
* Send coins to another account
|
|
25
8
|
* @category chain
|
|
@@ -28,24 +11,33 @@ interface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {
|
|
|
28
11
|
* @param options - Options
|
|
29
12
|
* @returns Transaction
|
|
30
13
|
*/
|
|
31
|
-
export declare function spend(amount: number | string, recipientIdOrName: Encoded.AccountAddress | AensName, options: SpendOptions): ReturnType<typeof
|
|
14
|
+
export declare function spend(amount: number | string, recipientIdOrName: Encoded.AccountAddress | AensName, options: SpendOptions): ReturnType<typeof sendTransaction>;
|
|
32
15
|
type SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'> & Parameters<typeof resolveName>[2] & {
|
|
33
16
|
onAccount: AccountBase;
|
|
34
|
-
} &
|
|
17
|
+
} & SendTransactionOptions;
|
|
35
18
|
interface SpendOptions extends SpendOptionsType {
|
|
36
19
|
}
|
|
37
20
|
/**
|
|
38
|
-
*
|
|
21
|
+
* Spend a fraction of coin balance to another account. Useful if needed to drain account balance
|
|
22
|
+
* completely, sending funds to another account (with fraction set to 1).
|
|
39
23
|
* @category chain
|
|
40
24
|
* @param fraction - Fraction of balance to spend (between 0 and 1)
|
|
41
25
|
* @param recipientIdOrName - Address or name of recipient account
|
|
42
26
|
* @param options - Options
|
|
43
|
-
* @
|
|
27
|
+
* @example
|
|
28
|
+
* ```js
|
|
29
|
+
* // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
|
|
30
|
+
* const { blockHeight } = await aeSdk.transferFunds(
|
|
31
|
+
* 0.42,
|
|
32
|
+
* 'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
|
|
33
|
+
* );
|
|
34
|
+
* console.log('Transaction mined at', blockHeight);
|
|
35
|
+
* ```
|
|
44
36
|
*/
|
|
45
|
-
export declare function transferFunds(fraction: number | string, recipientIdOrName: AensName | Encoded.AccountAddress, options: TransferFundsOptions): ReturnType<typeof
|
|
37
|
+
export declare function transferFunds(fraction: number | string, recipientIdOrName: AensName | Encoded.AccountAddress, options: TransferFundsOptions): ReturnType<typeof sendTransaction>;
|
|
46
38
|
type TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'> & Parameters<typeof resolveName>[2] & {
|
|
47
39
|
onAccount: AccountBase;
|
|
48
|
-
} &
|
|
40
|
+
} & SendTransactionOptions;
|
|
49
41
|
interface TransferFundsOptions extends TransferFundsOptionsType {
|
|
50
42
|
}
|
|
51
43
|
/**
|
|
@@ -55,8 +47,8 @@ interface TransferFundsOptions extends TransferFundsOptionsType {
|
|
|
55
47
|
* @param options - Options
|
|
56
48
|
* @returns Object Transaction
|
|
57
49
|
*/
|
|
58
|
-
export declare function payForTransaction(transaction: Encoded.Transaction, options: PayForTransactionOptions): ReturnType<typeof
|
|
59
|
-
interface PayForTransactionOptions extends BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx'>,
|
|
50
|
+
export declare function payForTransaction(transaction: Encoded.Transaction, options: PayForTransactionOptions): ReturnType<typeof sendTransaction>;
|
|
51
|
+
interface PayForTransactionOptions extends BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx' | 'onNode'>, SendTransactionOptions {
|
|
60
52
|
onAccount: AccountBase;
|
|
61
53
|
}
|
|
62
54
|
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Field as OriginalField } from './field-types';
|
|
2
|
+
import { UnionToIntersection } from '../../utils/other';
|
|
3
|
+
export interface Field extends OriginalField {
|
|
4
|
+
serialize: (...args: any[]) => any;
|
|
5
|
+
}
|
|
6
|
+
type NullablePartial<T, NK extends keyof T = {
|
|
7
|
+
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
8
|
+
}[keyof T]> = Partial<Pick<T, NK>> & Omit<T, NK>;
|
|
9
|
+
type Or<A, B> = A extends undefined ? B : A;
|
|
10
|
+
type TxParamsBySchemaInternal<SchemaItem> = {
|
|
11
|
+
-readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field ? Parameters<SchemaItem[key]['serialize']>[0] : never;
|
|
12
|
+
};
|
|
13
|
+
type TxParamsBySchemaInternalParams<SchemaItem, SchemaItemValues = SchemaItem[keyof SchemaItem]> = UnionToIntersection<SchemaItemValues extends Field ? Or<Parameters<SchemaItemValues['serialize']>[2], {}> : never>;
|
|
14
|
+
type PickIsRec<SchemaItem, Recursive extends boolean> = {
|
|
15
|
+
[Key in keyof SchemaItem as SchemaItem[Key] extends Field & {
|
|
16
|
+
recursiveType: true;
|
|
17
|
+
} ? (Recursive extends true ? Key : never) : (Recursive extends true ? never : Key)]: SchemaItem[Key];
|
|
18
|
+
};
|
|
19
|
+
type TxParamsBySchema<SchemaItem> = SchemaItem extends Object ? TxParamsBySchemaInternal<PickIsRec<SchemaItem, true>> & NullablePartial<TxParamsBySchemaInternal<PickIsRec<SchemaItem, false>>> & TxParamsBySchemaInternalParams<PickIsRec<SchemaItem, false>> : never;
|
|
20
|
+
type TxParamsAsyncBySchemaInternal<SchemaItem> = {
|
|
21
|
+
-readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field & {
|
|
22
|
+
prepare: Function;
|
|
23
|
+
} ? Parameters<SchemaItem[key]['prepare']>[0] : SchemaItem[key] extends Field ? Parameters<SchemaItem[key]['serialize']>[0] : never;
|
|
24
|
+
};
|
|
25
|
+
type TxParamsAsyncBySchemaInternalParams<SchemaItem, SchemaItemValues = SchemaItem[keyof SchemaItem]> = UnionToIntersection<SchemaItemValues extends Field & {
|
|
26
|
+
prepare: Function;
|
|
27
|
+
} ? Or<Parameters<SchemaItemValues['prepare']>[2], {}> : {}>;
|
|
28
|
+
type TxParamsAsyncBySchema<SchemaItem> = SchemaItem extends Object ? TxParamsAsyncBySchemaInternal<PickIsRec<SchemaItem, true>> & NullablePartial<TxParamsAsyncBySchemaInternal<PickIsRec<SchemaItem, false>>> & TxParamsAsyncBySchemaInternalParams<PickIsRec<SchemaItem, false>> & TxParamsBySchemaInternalParams<PickIsRec<SchemaItem, false>> : never;
|
|
29
|
+
type TxUnpackedBySchema<SchemaItem> = {
|
|
30
|
+
-readonly [key in keyof SchemaItem]: SchemaItem[key] extends Field ? ReturnType<SchemaItem[key]['deserialize']> : never;
|
|
31
|
+
};
|
|
32
|
+
export default interface SchemaTypes<Schema extends readonly any[], SchemaItems = Schema[number]> {
|
|
33
|
+
TxParams: TxParamsBySchema<SchemaItems>;
|
|
34
|
+
TxParamsAsync: TxParamsAsyncBySchema<SchemaItems>;
|
|
35
|
+
TxUnpacked: TxUnpackedBySchema<SchemaItems>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -16,7 +16,8 @@ export declare const NAME_BID_RANGES: {
|
|
|
16
16
|
[k: string]: BigNumber;
|
|
17
17
|
};
|
|
18
18
|
export declare enum ConsensusProtocolVersion {
|
|
19
|
-
Iris = 5
|
|
19
|
+
Iris = 5,
|
|
20
|
+
Ceres = 6
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* @category transaction builder
|
|
@@ -94,5 +95,6 @@ export declare enum Tag {
|
|
|
94
95
|
AccountsMtree = 626,
|
|
95
96
|
GaAttachTx = 80,
|
|
96
97
|
GaMetaTx = 81,
|
|
97
|
-
PayingForTx = 82
|
|
98
|
+
PayingForTx = 82,
|
|
99
|
+
GaMetaTxAuthData = 810
|
|
98
100
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Tag, ConsensusProtocolVersion, AbiVersion } from '../constants';
|
|
3
|
+
import Node from '../../../Node';
|
|
3
4
|
declare const _default: {
|
|
4
|
-
|
|
5
|
+
_getProtocolDetails(c: ConsensusProtocolVersion, tag: Tag): AbiVersion;
|
|
6
|
+
serialize(value: AbiVersion | undefined, { tag }: {
|
|
5
7
|
tag: Tag;
|
|
6
|
-
|
|
8
|
+
}, { consensusProtocolVersion }: {
|
|
9
|
+
consensusProtocolVersion?: ConsensusProtocolVersion | undefined;
|
|
7
10
|
}): Buffer;
|
|
11
|
+
prepare(value: AbiVersion | undefined, { tag }: {
|
|
12
|
+
tag: Tag;
|
|
13
|
+
}, options: {
|
|
14
|
+
consensusProtocolVersion?: ConsensusProtocolVersion;
|
|
15
|
+
onNode?: Node;
|
|
16
|
+
}): Promise<AbiVersion | undefined>;
|
|
8
17
|
deserialize(buffer: Buffer): AbiVersion;
|
|
9
18
|
};
|
|
10
19
|
export default _default;
|
|
@@ -2,6 +2,6 @@ export default function genArrayField<Input, Output, Binary>(itemHandler: {
|
|
|
2
2
|
serialize: (value: Input, params: unknown) => Binary;
|
|
3
3
|
deserialize: (value: Binary, params: unknown) => Output;
|
|
4
4
|
}): {
|
|
5
|
-
serialize: (value: Input[], params: unknown) => Binary[];
|
|
5
|
+
serialize: (value: readonly Input[], params: unknown) => Binary[];
|
|
6
6
|
deserialize: (value: Binary[], params: unknown) => Output[];
|
|
7
7
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Int } from '../constants';
|
|
3
3
|
import { AE_AMOUNT_FORMATS } from '../../../utils/amount-formatter';
|
|
4
|
-
export interface Options {
|
|
5
|
-
denomination?: AE_AMOUNT_FORMATS;
|
|
6
|
-
}
|
|
7
4
|
declare const _default: {
|
|
8
5
|
serializeAettos(value: string | undefined): string;
|
|
9
|
-
serialize(value: Int | undefined, { denomination
|
|
6
|
+
serialize(value: Int | undefined, params: {}, { denomination }: {
|
|
7
|
+
denomination?: AE_AMOUNT_FORMATS | undefined;
|
|
8
|
+
}): Buffer;
|
|
10
9
|
deserialize(value: Buffer): string;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ConsensusProtocolVersion, VmVersion, AbiVersion } from '../constants';
|
|
3
|
+
import Node from '../../../Node';
|
|
3
4
|
export declare const ProtocolToVmAbi: {
|
|
4
5
|
readonly 5: {
|
|
5
6
|
readonly 'contract-create': {
|
|
@@ -23,7 +24,32 @@ export declare const ProtocolToVmAbi: {
|
|
|
23
24
|
];
|
|
24
25
|
readonly abiVersion: readonly [
|
|
25
26
|
AbiVersion.NoAbi,
|
|
26
|
-
AbiVersion.
|
|
27
|
+
AbiVersion.Fate
|
|
28
|
+
];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly 6: {
|
|
32
|
+
readonly 'contract-create': {
|
|
33
|
+
readonly vmVersion: readonly [
|
|
34
|
+
VmVersion.Fate2
|
|
35
|
+
];
|
|
36
|
+
readonly abiVersion: readonly [
|
|
37
|
+
AbiVersion.Fate
|
|
38
|
+
];
|
|
39
|
+
};
|
|
40
|
+
readonly 'contract-call': {
|
|
41
|
+
readonly vmVersion: readonly [
|
|
42
|
+
];
|
|
43
|
+
readonly abiVersion: readonly [
|
|
44
|
+
AbiVersion.Fate
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
readonly 'oracle-call': {
|
|
48
|
+
readonly vmVersion: readonly [
|
|
49
|
+
];
|
|
50
|
+
readonly abiVersion: readonly [
|
|
51
|
+
AbiVersion.NoAbi,
|
|
52
|
+
AbiVersion.Fate
|
|
27
53
|
];
|
|
28
54
|
};
|
|
29
55
|
};
|
|
@@ -34,9 +60,13 @@ export interface CtVersion {
|
|
|
34
60
|
}
|
|
35
61
|
export declare function getProtocolDetails(protocolVersion: ConsensusProtocolVersion, type: 'contract-create' | 'contract-call' | 'oracle-call'): CtVersion;
|
|
36
62
|
declare const _default: {
|
|
37
|
-
serialize(value: CtVersion | undefined, { consensusProtocolVersion }: {
|
|
38
|
-
consensusProtocolVersion
|
|
63
|
+
serialize(value: CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
|
|
64
|
+
consensusProtocolVersion?: ConsensusProtocolVersion | undefined;
|
|
39
65
|
}): Buffer;
|
|
66
|
+
prepare(value: CtVersion | undefined, params: {}, options: {
|
|
67
|
+
consensusProtocolVersion?: ConsensusProtocolVersion;
|
|
68
|
+
onNode?: Node;
|
|
69
|
+
}): Promise<CtVersion | undefined>;
|
|
40
70
|
deserialize(buffer: Buffer): CtVersion;
|
|
41
71
|
};
|
|
42
72
|
export default _default;
|
|
@@ -5,9 +5,10 @@ declare const _default: {
|
|
|
5
5
|
/**
|
|
6
6
|
* @param value - Deposit value in string format. Should be equal to '0'.
|
|
7
7
|
* @param options - Options
|
|
8
|
+
* @param parameters - Parameters
|
|
8
9
|
* @returns Deposit value Buffer.
|
|
9
10
|
*/
|
|
10
|
-
serialize(value: Int | undefined, options: Parameters<(typeof coinAmount)['serialize']>[1]): Buffer;
|
|
11
|
+
serialize(value: Int | undefined, options: Parameters<(typeof coinAmount)['serialize']>[1], parameters: Parameters<(typeof coinAmount)['serialize']>[2]): Buffer;
|
|
11
12
|
serializeAettos(value: string | undefined): string;
|
|
12
13
|
deserialize(value: Buffer): string;
|
|
13
14
|
};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import { Encoded, Encoding } from '../../../utils/encoder';
|
|
3
3
|
export default function genEncodedField<E extends Encoding, Optional extends boolean = false>(encoding: E, optional?: Optional): {
|
|
4
4
|
serialize: Optional extends true ? (value?: Encoded.Generic<E>) => Buffer : (value: Encoded.Generic<E>) => Buffer;
|
|
5
|
-
deserialize: (value: Buffer) => Encoded.Generic<
|
|
5
|
+
deserialize: (value: Buffer) => Encoded.Generic<E>;
|
|
6
6
|
};
|
|
@@ -14,7 +14,9 @@ declare const _default: {
|
|
|
14
14
|
_computingMinFee?: BigNumber | undefined;
|
|
15
15
|
_pickBiggerFee?: boolean | undefined;
|
|
16
16
|
}): string;
|
|
17
|
-
serialize(value: import("../constants").Int | undefined, { denomination
|
|
17
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
18
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
19
|
+
}): Buffer;
|
|
18
20
|
deserialize(value: Buffer): string;
|
|
19
21
|
};
|
|
20
22
|
export default _default;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { Tag } from '../constants';
|
|
3
3
|
import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
|
|
4
4
|
declare const _default: {
|
|
5
|
-
serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx,
|
|
5
|
+
serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
|
|
6
6
|
tag: Tag;
|
|
7
7
|
rebuildTx: (params: any) => any;
|
|
8
8
|
unpackTx: typeof unpackTxType;
|
|
9
9
|
buildTx: typeof buildTxType;
|
|
10
|
-
gasMax: number;
|
|
11
10
|
_computingGasLimit?: number | undefined;
|
|
11
|
+
}, { gasMax }: {
|
|
12
|
+
gasMax?: number | undefined;
|
|
12
13
|
}): Buffer;
|
|
13
14
|
deserialize(value: Buffer): number;
|
|
14
15
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
declare const _default: {
|
|
3
3
|
serializeAettos(value?: string | undefined): string;
|
|
4
|
-
serialize(value: import("../constants").Int | undefined, { denomination
|
|
4
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
5
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
6
|
+
}): Buffer;
|
|
5
7
|
deserialize(value: Buffer): string;
|
|
6
8
|
};
|
|
7
9
|
export default _default;
|
|
@@ -4,13 +4,24 @@ import _array from './array';
|
|
|
4
4
|
import _encoded from './encoded';
|
|
5
5
|
import _entry from './entry';
|
|
6
6
|
import _enumeration from './enumeration';
|
|
7
|
+
import _map from './map';
|
|
7
8
|
import _mptree from './mptree';
|
|
9
|
+
import _nonce from './nonce';
|
|
8
10
|
import _shortUIntConst from './short-u-int-const';
|
|
11
|
+
import _wrapped from './wrapped';
|
|
9
12
|
declare const abiVersion: {
|
|
10
|
-
|
|
13
|
+
_getProtocolDetails(c: import("../constants").ConsensusProtocolVersion, tag: import("../constants").Tag): import("../constants").AbiVersion;
|
|
14
|
+
serialize(value: import("../constants").AbiVersion | undefined, { tag }: {
|
|
11
15
|
tag: import("../constants").Tag;
|
|
12
|
-
|
|
16
|
+
}, { consensusProtocolVersion }: {
|
|
17
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
13
18
|
}): Buffer;
|
|
19
|
+
prepare(value: import("../constants").AbiVersion | undefined, { tag }: {
|
|
20
|
+
tag: import("../constants").Tag;
|
|
21
|
+
}, options: {
|
|
22
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
23
|
+
onNode?: import("../../..").Node | undefined;
|
|
24
|
+
}): Promise<import("../constants").AbiVersion | undefined>;
|
|
14
25
|
deserialize(buffer: Buffer): import("../constants").AbiVersion;
|
|
15
26
|
};
|
|
16
27
|
declare const address: typeof _address;
|
|
@@ -21,17 +32,25 @@ declare const boolean: {
|
|
|
21
32
|
};
|
|
22
33
|
declare const coinAmount: {
|
|
23
34
|
serializeAettos(value: string | undefined): string;
|
|
24
|
-
serialize(value: import("../constants").Int | undefined, { denomination
|
|
35
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
36
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
37
|
+
}): Buffer;
|
|
25
38
|
deserialize(value: Buffer): string;
|
|
26
39
|
};
|
|
27
40
|
declare const ctVersion: {
|
|
28
|
-
serialize(value: import("./ct-version").CtVersion | undefined, { consensusProtocolVersion }: {
|
|
29
|
-
consensusProtocolVersion
|
|
41
|
+
serialize(value: import("./ct-version").CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
|
|
42
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
30
43
|
}): Buffer;
|
|
44
|
+
prepare(value: import("./ct-version").CtVersion | undefined, params: {}, options: {
|
|
45
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
46
|
+
onNode?: import("../../..").Node | undefined;
|
|
47
|
+
}): Promise<import("./ct-version").CtVersion | undefined>;
|
|
31
48
|
deserialize(buffer: Buffer): import("./ct-version").CtVersion;
|
|
32
49
|
};
|
|
33
50
|
declare const deposit: {
|
|
34
|
-
serialize(value: import("../constants").Int | undefined, options:
|
|
51
|
+
serialize(value: import("../constants").Int | undefined, options: {}, parameters: {
|
|
52
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
53
|
+
}): Buffer;
|
|
35
54
|
serializeAettos(value: string | undefined): string;
|
|
36
55
|
deserialize(value: Buffer): string;
|
|
37
56
|
};
|
|
@@ -46,7 +65,9 @@ declare const fee: {
|
|
|
46
65
|
_computingMinFee?: import("bignumber.js").BigNumber | undefined;
|
|
47
66
|
_pickBiggerFee?: boolean | undefined;
|
|
48
67
|
}): string;
|
|
49
|
-
serialize(value: import("../constants").Int | undefined, { denomination
|
|
68
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
69
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
70
|
+
}): Buffer;
|
|
50
71
|
deserialize(value: Buffer): string;
|
|
51
72
|
};
|
|
52
73
|
declare const field: {
|
|
@@ -54,21 +75,25 @@ declare const field: {
|
|
|
54
75
|
deserialize(value: Buffer): string;
|
|
55
76
|
};
|
|
56
77
|
declare const gasLimit: {
|
|
57
|
-
serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx,
|
|
78
|
+
serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
|
|
58
79
|
tag: import("../constants").Tag;
|
|
59
80
|
rebuildTx: (params: any) => any;
|
|
60
81
|
unpackTx: typeof import("..").unpackTx;
|
|
61
82
|
buildTx: typeof import("..").buildTx;
|
|
62
|
-
gasMax: number;
|
|
63
83
|
_computingGasLimit?: number | undefined;
|
|
84
|
+
}, { gasMax }: {
|
|
85
|
+
gasMax?: number | undefined;
|
|
64
86
|
}): Buffer;
|
|
65
87
|
deserialize(value: Buffer): number;
|
|
66
88
|
};
|
|
67
89
|
declare const gasPrice: {
|
|
68
90
|
serializeAettos(value?: string | undefined): string;
|
|
69
|
-
serialize(value: import("../constants").Int | undefined, { denomination
|
|
91
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
92
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
93
|
+
}): Buffer;
|
|
70
94
|
deserialize(value: Buffer): string;
|
|
71
95
|
};
|
|
96
|
+
declare const map: typeof _map;
|
|
72
97
|
declare const mptree: typeof _mptree;
|
|
73
98
|
declare const name: {
|
|
74
99
|
serialize(value: `${string}.chain`): Buffer;
|
|
@@ -80,13 +105,16 @@ declare const nameFee: {
|
|
|
80
105
|
}): string;
|
|
81
106
|
serialize(value: import("../constants").Int | undefined, txFields: {
|
|
82
107
|
name: `${string}.chain`;
|
|
83
|
-
}
|
|
108
|
+
}, parameters: {
|
|
109
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
110
|
+
}): Buffer;
|
|
84
111
|
deserialize(value: Buffer): string;
|
|
85
112
|
};
|
|
86
113
|
declare const nameId: {
|
|
87
114
|
serialize(value: `${string}.chain` | `nm_${string}`): Buffer;
|
|
88
115
|
deserialize: (value: Buffer) => `nm_${string}`;
|
|
89
116
|
};
|
|
117
|
+
declare const nonce: typeof _nonce;
|
|
90
118
|
declare const pointers: {
|
|
91
119
|
serialize(pointers: (import("../../../apis/node").NamePointer & {
|
|
92
120
|
id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
|
|
@@ -111,10 +139,19 @@ declare const string: {
|
|
|
111
139
|
serialize(string: string): Buffer;
|
|
112
140
|
deserialize(buffer: Buffer): string;
|
|
113
141
|
};
|
|
142
|
+
declare const ttl: {
|
|
143
|
+
serialize(value: number | undefined): Buffer;
|
|
144
|
+
prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
|
|
145
|
+
onNode?: import("../../..").Node | undefined;
|
|
146
|
+
absoluteTtl?: boolean | undefined;
|
|
147
|
+
}): Promise<number | undefined>;
|
|
148
|
+
deserialize(value: Buffer): number;
|
|
149
|
+
};
|
|
114
150
|
declare const uInt: {
|
|
115
151
|
serialize(value: import("../constants").Int): Buffer;
|
|
116
152
|
deserialize(value: Buffer): string;
|
|
117
153
|
};
|
|
154
|
+
declare const wrapped: typeof _wrapped;
|
|
118
155
|
export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[
|
|
119
156
|
Buffer,
|
|
120
157
|
Array<[
|
|
@@ -123,7 +160,9 @@ export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[
|
|
|
123
160
|
]>
|
|
124
161
|
]>;
|
|
125
162
|
export interface Field {
|
|
126
|
-
serialize: (value: any, options: any) => BinaryData;
|
|
163
|
+
serialize: (value: any, options: any, parameters: any) => BinaryData;
|
|
164
|
+
prepare?: (value: any, options: any, parameters: any) => Promise<any>;
|
|
127
165
|
deserialize: (value: BinaryData, options: any) => any;
|
|
166
|
+
recursiveType?: boolean;
|
|
128
167
|
}
|
|
129
|
-
export { abiVersion, address, array, boolean, coinAmount, ctVersion, deposit, encoded, entry, enumeration, fee, field, gasLimit, gasPrice, mptree, name, nameFee, nameId, pointers, raw, shortUInt, shortUIntConst, string, uInt, };
|
|
168
|
+
export { abiVersion, address, array, boolean, coinAmount, ctVersion, deposit, encoded, entry, enumeration, fee, field, gasLimit, gasPrice, map, mptree, name, nameFee, nameId, nonce, pointers, raw, shortUInt, shortUIntConst, string, ttl, uInt, wrapped, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Tag } from '../constants';
|
|
3
|
+
import { Encoding, Encoded } from '../../../utils/encoder';
|
|
4
|
+
import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
|
|
5
|
+
export default function genMapField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
|
|
6
|
+
serialize: (value: Record<Encoded.Generic<E>, any>, options: {
|
|
7
|
+
buildTx: typeof buildTxType;
|
|
8
|
+
}) => Buffer;
|
|
9
|
+
deserialize: (value: Buffer, options: {
|
|
10
|
+
unpackTx: typeof unpackTxType;
|
|
11
|
+
}) => Record<Encoded.Generic<E>, any>;
|
|
12
|
+
recursiveType: true;
|
|
13
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Tag } from '../constants';
|
|
3
3
|
import { Encoded, Encoding } from '../../../utils/encoder';
|
|
4
4
|
import type { unpackTx } from '..';
|
|
5
|
+
import type { TxUnpacked } from '../schema.generated';
|
|
5
6
|
type MPTreeBinary = [
|
|
6
7
|
Buffer,
|
|
7
8
|
Array<[
|
|
@@ -31,8 +32,12 @@ declare class MPTree<E extends Encoding, T extends Tag> {
|
|
|
31
32
|
* @param key - The key of the element to retrieve
|
|
32
33
|
* @returns Value associated to the specified key
|
|
33
34
|
*/
|
|
34
|
-
get(key: Encoded.Generic<E>):
|
|
35
|
-
|
|
35
|
+
get(key: Encoded.Generic<E>): TxUnpacked & {
|
|
36
|
+
tag: T;
|
|
37
|
+
} | undefined;
|
|
38
|
+
toObject(): Record<Encoded.Generic<E>, TxUnpacked & {
|
|
39
|
+
tag: T;
|
|
40
|
+
}>;
|
|
36
41
|
}
|
|
37
42
|
export default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
|
|
38
43
|
serialize: (value: MPTree<E, T>) => MPTreeBinary;
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
*/
|
|
13
13
|
serialize(value: Int | undefined, txFields: {
|
|
14
14
|
name: AensName;
|
|
15
|
-
} & Parameters<(typeof coinAmount)['serialize']>[1]): Buffer;
|
|
15
|
+
} & Parameters<(typeof coinAmount)['serialize']>[1], parameters: Parameters<(typeof coinAmount)['serialize']>[2]): Buffer;
|
|
16
16
|
deserialize(value: Buffer): string;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Node from '../../../Node';
|
|
3
|
+
import { NextNonceStrategy } from '../../../apis/node';
|
|
4
|
+
export default function genNonceField<SenderKey extends string>(senderKey: SenderKey): {
|
|
5
|
+
serialize: (value: number) => Buffer;
|
|
6
|
+
prepare: (value: number | undefined, params: {}, options: {
|
|
7
|
+
[key in SenderKey]: string;
|
|
8
|
+
} & {
|
|
9
|
+
strategy?: NextNonceStrategy;
|
|
10
|
+
onNode?: Node;
|
|
11
|
+
}) => Promise<number>;
|
|
12
|
+
deserialize: (value: Buffer) => number;
|
|
13
|
+
senderKey: string;
|
|
14
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export default function genShortUIntConstField<Value extends number>(
|
|
3
|
-
serialize: (value?: Value) => Buffer;
|
|
2
|
+
export default function genShortUIntConstField<Value extends number, Optional extends boolean = false>(constValue: Value, optional?: Optional): {
|
|
3
|
+
serialize: Optional extends true ? (value?: Value) => Buffer : (value: Value) => Buffer;
|
|
4
4
|
deserialize: (value: Buffer) => Value;
|
|
5
|
+
constValue: Value;
|
|
6
|
+
constValueOptional: boolean;
|
|
5
7
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Node from '../../../Node';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
serialize(value: number | undefined): Buffer;
|
|
5
|
+
prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
|
|
6
|
+
onNode?: Node | undefined;
|
|
7
|
+
absoluteTtl?: boolean | undefined;
|
|
8
|
+
}): Promise<number | undefined>;
|
|
9
|
+
deserialize(value: Buffer): number;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Tag } from '../constants';
|
|
3
|
+
import type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';
|
|
4
|
+
type TagWrapping = Tag.AccountsMtree | Tag.CallsMtree | Tag.ChannelsMtree | Tag.ContractsMtree | Tag.NameserviceMtree | Tag.OraclesMtree;
|
|
5
|
+
export default function genWrappedField<T extends TagWrapping>(tag: T): {
|
|
6
|
+
serialize: (value: any, options: {
|
|
7
|
+
buildTx: typeof buildTxType;
|
|
8
|
+
}) => Buffer;
|
|
9
|
+
deserialize: (value: Buffer, options: {
|
|
10
|
+
unpackTx: typeof unpackTxType;
|
|
11
|
+
}) => any;
|
|
12
|
+
recursiveType: true;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import { Encoded, Encoding } from '../../utils/encoder';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Field } from './field-types';
|
|
3
|
+
import { TxUnpacked, TxParams, TxParamsAsync } from './schema.generated';
|
|
4
4
|
import { Tag } from './constants';
|
|
5
|
+
/**
|
|
6
|
+
* JavaScript-based Transaction builder
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSchema(tag: Tag, version?: number): Array<[
|
|
9
|
+
string,
|
|
10
|
+
Field
|
|
11
|
+
]>;
|
|
5
12
|
/**
|
|
6
13
|
* Build transaction hash
|
|
7
14
|
* @category transaction builder
|
|
8
15
|
* @param params - Object with tx params
|
|
9
16
|
* @param options - options
|
|
10
|
-
* @param options.denomination - Denomination of amounts
|
|
11
17
|
* @param options.prefix - Prefix of transaction
|
|
12
|
-
* @
|
|
13
|
-
* @returns object
|
|
14
|
-
* @returns object.tx Base64Check transaction hash with 'tx_' prefix
|
|
15
|
-
* @returns object.rlpEncoded rlp encoded transaction
|
|
16
|
-
* @returns object.binary binary transaction
|
|
18
|
+
* @returns object Base64Check transaction hash with 'tx_' prefix
|
|
17
19
|
*/
|
|
18
|
-
export declare function buildTx<
|
|
19
|
-
tag: TxType;
|
|
20
|
-
version?: number;
|
|
21
|
-
} & Omit<TxTypeSchemas[TxType], 'tag' | 'version'> & (TxType extends Tag.ContractCreateTx | Tag.ContractCallTx | Tag.ChannelOffChainUpdateCallContract | Tag.GaAttachTx | Tag.GaMetaTx ? {
|
|
22
|
-
gasMax?: number;
|
|
23
|
-
} : {}), { prefix, denomination, }?: {
|
|
20
|
+
export declare function buildTx<E extends Encoding = Encoding.Transaction>(params: TxParams, { prefix, }?: {
|
|
24
21
|
prefix?: E;
|
|
25
|
-
denomination?: AE_AMOUNT_FORMATS;
|
|
26
22
|
}): Encoded.Generic<E>;
|
|
23
|
+
export type BuildTxOptions<TxType extends Tag, OmitFields extends string> = Omit<TxParamsAsync & {
|
|
24
|
+
tag: TxType;
|
|
25
|
+
}, 'tag' | OmitFields>;
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
27
|
+
* @category transaction builder
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildTxAsync(params: TxParamsAsync): Promise<Encoded.Transaction>;
|
|
30
|
+
/**
|
|
31
|
+
* Unpack transaction encoded as string
|
|
29
32
|
* @category transaction builder
|
|
30
33
|
* @param encodedTx - Transaction to unpack
|
|
31
34
|
* @param txType - Expected transaction type
|
|
32
|
-
* @returns
|
|
33
|
-
* @returns object.tx Object with transaction param's
|
|
34
|
-
* @returns object.txType Transaction type
|
|
35
|
+
* @returns Object with transaction param's
|
|
35
36
|
*/
|
|
36
|
-
export declare function unpackTx<TxType extends Tag>(encodedTx: Encoded.Transaction | Encoded.Poi, txType?: TxType):
|
|
37
|
+
export declare function unpackTx<TxType extends Tag>(encodedTx: Encoded.Transaction | Encoded.Poi | Encoded.StateTrees | Encoded.CallStateTree, txType?: TxType): TxUnpacked & {
|
|
38
|
+
tag: TxType;
|
|
39
|
+
};
|
|
37
40
|
/**
|
|
38
41
|
* Build a transaction hash
|
|
39
42
|
* @category transaction builder
|