@aeternity/aepp-sdk 13.0.0-alpha.0 → 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 +5595 -2249
- 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.d.ts +3 -3
- package/es/AeSdkBase.mjs +4 -0
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +12 -14
- 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 +9 -4
- package/es/Node.mjs +12 -6
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +13 -8
- package/es/account/Base.mjs +0 -17
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.mjs +14 -25
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.mjs +2 -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 +11 -22
- 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 +22 -32
- 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.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +19 -20
- 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 +5 -6
- 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 +17 -9
- package/es/chain.mjs +23 -23
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +27 -9
- package/es/channel/Base.mjs +27 -27
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/Contract.d.ts +8 -7
- package/es/channel/Contract.mjs +8 -21
- package/es/channel/Contract.mjs.map +1 -1
- package/es/channel/Spend.d.ts +5 -1
- package/es/channel/Spend.mjs +4 -18
- package/es/channel/Spend.mjs.map +1 -1
- package/es/channel/handlers.mjs +16 -26
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +19 -2
- package/es/channel/internal.mjs +22 -20
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +43 -123
- package/es/contract/Contract.mjs +230 -250
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +74 -0
- package/es/contract/compiler/Base.mjs +5 -0
- package/es/contract/compiler/Base.mjs.map +1 -0
- package/es/contract/compiler/Cli.d.ts +23 -0
- package/es/contract/compiler/Cli.mjs +149 -0
- package/es/contract/compiler/Cli.mjs.map +1 -0
- package/es/contract/compiler/Http.d.ts +32 -0
- package/es/contract/compiler/Http.mjs +94 -0
- package/es/contract/compiler/Http.mjs.map +1 -0
- package/es/contract/compiler/HttpNode.d.ts +17 -0
- package/es/contract/compiler/HttpNode.mjs +26 -0
- package/es/contract/compiler/HttpNode.mjs.map +1 -0
- package/es/contract/compiler/getFileSystem.d.ts +6 -0
- package/es/contract/compiler/getFileSystem.mjs +40 -0
- package/es/contract/compiler/getFileSystem.mjs.map +1 -0
- package/es/contract/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 +27 -10
- package/es/contract/ga.mjs +63 -29
- package/es/contract/ga.mjs.map +1 -1
- package/es/index-browser.d.ts +40 -0
- package/es/index-browser.mjs +41 -0
- package/es/index-browser.mjs.map +1 -0
- package/es/index.d.ts +4 -38
- package/es/index.mjs +4 -53
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +12 -17
- package/es/oracle.mjs +29 -49
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +19 -27
- package/es/spend.mjs +21 -46
- 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 +31 -2
- package/es/tx/builder/constants.mjs +34 -3
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/abi-version.d.ts +19 -0
- package/es/tx/builder/field-types/abi-version.mjs +40 -0
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -0
- package/es/tx/builder/field-types/address.d.ts +5 -6
- package/es/tx/builder/field-types/address.mjs +17 -8
- package/es/tx/builder/field-types/address.mjs.map +1 -1
- package/es/tx/builder/field-types/array.d.ts +7 -0
- package/es/tx/builder/field-types/array.mjs +11 -0
- package/es/tx/builder/field-types/array.mjs.map +1 -0
- package/es/tx/builder/field-types/boolean.d.ts +6 -0
- package/es/tx/builder/field-types/boolean.mjs +13 -0
- package/es/tx/builder/field-types/boolean.mjs.map +1 -0
- package/es/tx/builder/field-types/coin-amount.d.ts +4 -5
- 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 +49 -0
- package/es/tx/builder/field-types/ct-version.mjs +76 -0
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -0
- package/es/tx/builder/field-types/deposit.d.ts +3 -2
- 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 +6 -0
- package/es/tx/builder/field-types/encoded.mjs +21 -0
- package/es/tx/builder/field-types/encoded.mjs.map +1 -0
- package/es/tx/builder/field-types/entry.d.ts +11 -0
- package/es/tx/builder/field-types/entry.mjs +34 -0
- package/es/tx/builder/field-types/entry.mjs.map +1 -0
- package/es/tx/builder/field-types/enumeration.d.ts +5 -3
- package/es/tx/builder/field-types/enumeration.mjs +11 -2
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +12 -7
- package/es/tx/builder/field-types/fee.mjs +28 -20
- 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 +7 -3
- package/es/tx/builder/field-types/gas-limit.mjs +13 -8
- 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 +107 -30
- package/es/tx/builder/field-types/index.mjs +38 -12
- 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 +42 -0
- package/es/tx/builder/field-types/mptree.mjs +266 -0
- package/es/tx/builder/field-types/mptree.mjs.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +2 -3
- 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 +2 -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 +2 -2
- package/es/tx/builder/field-types/pointers.mjs.map +1 -1
- package/es/tx/builder/field-types/raw.d.ts +6 -0
- package/es/tx/builder/field-types/raw.mjs +13 -0
- package/es/tx/builder/field-types/raw.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int-const.d.ts +7 -0
- package/es/tx/builder/field-types/short-u-int-const.mjs +20 -0
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/string.d.ts +6 -0
- package/es/tx/builder/field-types/string.mjs +10 -0
- package/es/tx/builder/field-types/string.mjs.map +1 -0
- package/es/tx/builder/field-types/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.d.ts +1 -2
- 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 +18 -36
- package/es/tx/builder/index.mjs +65 -236
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +2734 -1324
- 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 -223
- 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.d.ts +3 -5
- package/es/tx/validator.mjs +91 -153
- 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 +1 -17
- 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 +16 -38
- package/es/utils/errors.mjs +3 -43
- 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.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 +52 -40
- package/src/AeSdkBase.ts +6 -3
- package/src/AeSdkMethods.ts +12 -18
- package/src/AeSdkWallet.ts +1 -1
- package/src/Node.ts +23 -9
- package/src/account/Base.ts +13 -24
- package/src/account/Generalized.ts +9 -24
- package/src/account/Ledger.ts +1 -1
- package/src/account/Memory.ts +15 -22
- package/src/aens.ts +34 -49
- package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +18 -24
- 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/RpcClient.ts +2 -2
- 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 +33 -30
- package/src/channel/Base.ts +39 -31
- package/src/channel/Contract.ts +18 -32
- package/src/channel/Spend.ts +8 -18
- package/src/channel/handlers.ts +14 -26
- package/src/channel/internal.ts +41 -23
- package/src/contract/Contract.ts +188 -228
- package/src/contract/compiler/Base.ts +87 -0
- package/src/contract/compiler/Cli.ts +128 -0
- package/src/contract/compiler/Http.ts +105 -0
- package/src/contract/compiler/HttpNode.ts +26 -0
- package/src/contract/compiler/getFileSystem.ts +42 -0
- package/src/contract/delegation-signature.ts +56 -0
- package/src/contract/ga.ts +61 -37
- package/src/index-browser.ts +50 -0
- package/src/index.ts +4 -56
- package/src/oracle.ts +47 -57
- package/src/spend.ts +34 -68
- package/src/tx/builder/SchemaTypes.ts +79 -0
- package/src/tx/builder/constants.ts +34 -3
- package/src/tx/builder/field-types/abi-version.ts +44 -0
- package/src/tx/builder/field-types/address.ts +23 -13
- package/src/tx/builder/field-types/array.ts +19 -0
- package/src/tx/builder/field-types/boolean.ts +9 -0
- package/src/tx/builder/field-types/coin-amount.ts +8 -5
- package/src/tx/builder/field-types/ct-version.ts +83 -0
- package/src/tx/builder/field-types/deposit.ts +4 -2
- package/src/tx/builder/field-types/encoded.ts +27 -0
- package/src/tx/builder/field-types/entry.ts +36 -0
- package/src/tx/builder/field-types/enumeration.ts +15 -4
- package/src/tx/builder/field-types/fee.ts +41 -19
- package/src/tx/builder/field-types/gas-limit.ts +13 -8
- package/src/tx/builder/field-types/index.ts +60 -17
- package/src/tx/builder/field-types/map.ts +45 -0
- package/src/tx/builder/field-types/mptree.ts +243 -0
- package/src/tx/builder/field-types/name-fee.ts +3 -3
- package/src/tx/builder/field-types/name-id.ts +1 -1
- package/src/tx/builder/field-types/nonce.ts +40 -0
- package/src/tx/builder/field-types/pointers.ts +2 -2
- package/src/tx/builder/field-types/raw.ts +9 -0
- package/src/tx/builder/field-types/short-u-int-const.ts +30 -0
- package/src/tx/builder/field-types/string.ts +11 -0
- package/src/tx/builder/field-types/ttl.ts +24 -0
- package/src/tx/builder/field-types/u-int.ts +1 -3
- package/src/tx/builder/field-types/wrapped.ts +32 -0
- package/src/tx/builder/index.ts +82 -280
- package/src/tx/builder/schema.generated.ts +2013 -0
- package/src/tx/builder/schema.ts +536 -666
- package/src/tx/execution-cost.ts +146 -0
- package/src/tx/transaction-signer.ts +27 -0
- package/src/tx/validator.ts +100 -154
- package/src/utils/amount-formatter.ts +0 -16
- package/src/utils/autorest.ts +52 -11
- package/src/utils/bytes.ts +1 -17
- package/src/utils/crypto.ts +0 -16
- package/src/utils/errors.ts +18 -56
- package/src/utils/string.ts +0 -17
- package/types-legacy/ts4.2/AeSdkBase.d.ts +3 -3
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +12 -14
- package/types-legacy/ts4.2/Node.d.ts +8 -4
- package/types-legacy/ts4.2/account/Base.d.ts +13 -8
- 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/connection/BrowserRuntime.d.ts +1 -0
- 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 +17 -9
- package/types-legacy/ts4.2/channel/Base.d.ts +27 -9
- package/types-legacy/ts4.2/channel/Contract.d.ts +8 -7
- package/types-legacy/ts4.2/channel/Spend.d.ts +5 -1
- package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.2/contract/Contract.d.ts +42 -122
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +74 -0
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +23 -0
- package/types-legacy/ts4.2/contract/compiler/Http.d.ts +32 -0
- package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +17 -0
- package/types-legacy/ts4.2/contract/compiler/getFileSystem.d.ts +6 -0
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +27 -10
- package/types-legacy/ts4.2/index-browser.d.ts +40 -0
- package/types-legacy/ts4.2/index.d.ts +4 -38
- 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 +31 -2
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +19 -0
- package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +11 -12
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/boolean.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +4 -5
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +72 -0
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +3 -2
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/entry.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +5 -3
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +12 -7
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +7 -3
- 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 +113 -30
- 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 +48 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +2 -3
- package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/raw.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/string.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +1 -2
- package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +21 -36
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +2971 -2926
- 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/tx/validator.d.ts +3 -5
- package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.2/utils/errors.d.ts +16 -38
- package/types-legacy/ts4.5/AeSdkBase.d.ts +3 -3
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +12 -14
- package/types-legacy/ts4.5/Node.d.ts +8 -4
- package/types-legacy/ts4.5/account/Base.d.ts +13 -8
- 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/connection/BrowserRuntime.d.ts +1 -0
- 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 +17 -9
- package/types-legacy/ts4.5/channel/Base.d.ts +27 -9
- package/types-legacy/ts4.5/channel/Contract.d.ts +8 -7
- package/types-legacy/ts4.5/channel/Spend.d.ts +5 -1
- package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.5/contract/Contract.d.ts +42 -122
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +74 -0
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +23 -0
- package/types-legacy/ts4.5/contract/compiler/Http.d.ts +32 -0
- package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +17 -0
- package/types-legacy/ts4.5/contract/compiler/getFileSystem.d.ts +6 -0
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +27 -10
- package/types-legacy/ts4.5/index-browser.d.ts +40 -0
- package/types-legacy/ts4.5/index.d.ts +4 -38
- 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 +31 -2
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +19 -0
- package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +11 -12
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/boolean.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +4 -5
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +72 -0
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +3 -2
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/entry.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +5 -3
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +12 -7
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +7 -3
- 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 +113 -30
- 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 +48 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +2 -3
- package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/raw.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/string.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +1 -2
- package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +21 -36
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +2971 -2926
- 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/tx/validator.d.ts +3 -5
- package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.5/utils/errors.d.ts +16 -38
- package/es/contract/CompilerHttp.d.ts +0 -18
- package/es/contract/CompilerHttp.mjs +0 -63
- package/es/contract/CompilerHttp.mjs.map +0 -1
- package/es/tx/builder/field-types/addresses.d.ts +0 -6
- package/es/tx/builder/field-types/addresses.mjs +0 -13
- package/es/tx/builder/field-types/addresses.mjs.map +0 -1
- package/es/tx/index.d.ts +0 -34
- package/es/tx/index.mjs +0 -172
- package/es/tx/index.mjs.map +0 -1
- package/es/utils/mptree.d.ts +0 -26
- package/es/utils/mptree.mjs +0 -143
- package/es/utils/mptree.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/contract/CompilerHttp.ts +0 -67
- package/src/tx/builder/field-types/addresses.ts +0 -18
- package/src/tx/index.ts +0 -196
- package/src/utils/mptree.ts +0 -145
- package/types-legacy/ts4.2/contract/CompilerHttp.d.ts +0 -18
- package/types-legacy/ts4.2/tx/builder/field-types/addresses.d.ts +0 -6
- package/types-legacy/ts4.2/tx/index.d.ts +0 -34
- package/types-legacy/ts4.2/utils/mptree.d.ts +0 -32
- package/types-legacy/ts4.5/contract/CompilerHttp.d.ts +0 -18
- package/types-legacy/ts4.5/tx/builder/field-types/addresses.d.ts +0 -6
- package/types-legacy/ts4.5/tx/index.d.ts +0 -34
- package/types-legacy/ts4.5/utils/mptree.d.ts +0 -32
|
@@ -2,22 +2,27 @@ import { IllegalArgumentError } from "../../../utils/errors.mjs";
|
|
|
2
2
|
import { MIN_GAS_PRICE, Tag, MAX_AUTH_FUN_GAS } from "../constants.mjs";
|
|
3
3
|
import shortUInt from "./short-u-int.mjs";
|
|
4
4
|
import { buildFee } from "./fee.mjs";
|
|
5
|
-
function calculateGasLimitMax(
|
|
6
|
-
return gasMax - +buildFee(
|
|
5
|
+
function calculateGasLimitMax(gasMax, rebuildTx, unpackTx, buildTx) {
|
|
6
|
+
return gasMax - +buildFee(rebuildTx(gasMax), unpackTx, buildTx).dividedBy(MIN_GAS_PRICE);
|
|
7
7
|
}
|
|
8
8
|
export default {
|
|
9
9
|
...shortUInt,
|
|
10
|
-
serialize(_value, _ref) {
|
|
10
|
+
serialize(_value, _ref, _ref2) {
|
|
11
11
|
let {
|
|
12
|
-
|
|
12
|
+
tag,
|
|
13
13
|
rebuildTx,
|
|
14
|
-
|
|
14
|
+
unpackTx,
|
|
15
|
+
buildTx,
|
|
15
16
|
_computingGasLimit
|
|
16
17
|
} = _ref;
|
|
18
|
+
let {
|
|
19
|
+
gasMax = 6e6
|
|
20
|
+
} = _ref2;
|
|
17
21
|
if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);
|
|
18
|
-
const gasLimitMax =
|
|
19
|
-
_computingGasLimit: gasLimit
|
|
20
|
-
|
|
22
|
+
const gasLimitMax = tag === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(gasMax, gasLimit => rebuildTx({
|
|
23
|
+
_computingGasLimit: gasLimit,
|
|
24
|
+
_pickBiggerFee: true
|
|
25
|
+
}), unpackTx, buildTx);
|
|
21
26
|
const value = _value !== null && _value !== void 0 ? _value : gasLimitMax;
|
|
22
27
|
if (value > gasLimitMax) {
|
|
23
28
|
throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas-limit.mjs","names":["IllegalArgumentError","MIN_GAS_PRICE","Tag","MAX_AUTH_FUN_GAS","shortUInt","buildFee","calculateGasLimitMax","
|
|
1
|
+
{"version":3,"file":"gas-limit.mjs","names":["IllegalArgumentError","MIN_GAS_PRICE","Tag","MAX_AUTH_FUN_GAS","shortUInt","buildFee","calculateGasLimitMax","gasMax","rebuildTx","unpackTx","buildTx","dividedBy","serialize","_value","_ref","_ref2","tag","_computingGasLimit","gasLimitMax","GaMetaTx","gasLimit","_pickBiggerFee","value"],"sources":["../../../../src/tx/builder/field-types/gas-limit.ts"],"sourcesContent":["import { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag, MAX_AUTH_FUN_GAS } from '../constants';\nimport shortUInt from './short-u-int';\nimport { buildFee } from './fee';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nfunction calculateGasLimitMax(\n gasMax: number,\n rebuildTx: (value: number) => any,\n unpackTx: typeof unpackTxType,\n buildTx: typeof buildTxType,\n): number {\n return gasMax - +buildFee(rebuildTx(gasMax), unpackTx, buildTx).dividedBy(MIN_GAS_PRICE);\n}\n\nexport default {\n ...shortUInt,\n\n serialize(\n _value: number | undefined,\n {\n tag, rebuildTx, unpackTx, buildTx, _computingGasLimit,\n }: {\n tag: Tag;\n rebuildTx: (params: any) => any;\n unpackTx: typeof unpackTxType;\n buildTx: typeof buildTxType;\n _computingGasLimit?: number;\n },\n { gasMax = 6e6 }: { gasMax?: number },\n ): Buffer {\n if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);\n\n const gasLimitMax = tag === Tag.GaMetaTx ? MAX_AUTH_FUN_GAS : calculateGasLimitMax(\n gasMax,\n (gasLimit) => rebuildTx({ _computingGasLimit: gasLimit, _pickBiggerFee: true }),\n unpackTx,\n buildTx,\n );\n const value = _value ?? gasLimitMax;\n if (value > gasLimitMax) {\n throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);\n }\n return shortUInt.serialize(value);\n },\n};\n"],"mappings":"SAASA,oBAAoB;AAAA,SACpBC,aAAa,EAAEC,GAAG,EAAEC,gBAAgB;AAAA,OACtCC,SAAS;AAAA,SACPC,QAAQ;AAGjB,SAASC,oBAAoBA,CAC3BC,MAAc,EACdC,SAAiC,EACjCC,QAA6B,EAC7BC,OAA2B,EACnB;EACR,OAAOH,MAAM,GAAG,CAACF,QAAQ,CAACG,SAAS,CAACD,MAAM,CAAC,EAAEE,QAAQ,EAAEC,OAAO,CAAC,CAACC,SAAS,CAACV,aAAa,CAAC;AAC1F;AAEA,eAAe;EACb,GAAGG,SAAS;EAEZQ,SAASA,CACPC,MAA0B,EAAAC,IAAA,EAAAC,KAAA,EAWlB;IAAA,IAVR;MACEC,GAAG;MAAER,SAAS;MAAEC,QAAQ;MAAEC,OAAO;MAAEO;IAOrC,CAAC,GAAAH,IAAA;IAAA,IACD;MAAEP,MAAM,GAAG;IAAyB,CAAC,GAAAQ,KAAA;IAErC,IAAIE,kBAAkB,IAAI,IAAI,EAAE,OAAOb,SAAS,CAACQ,SAAS,CAACK,kBAAkB,CAAC;IAE9E,MAAMC,WAAW,GAAGF,GAAG,KAAKd,GAAG,CAACiB,QAAQ,GAAGhB,gBAAgB,GAAGG,oBAAoB,CAChFC,MAAM,EACLa,QAAQ,IAAKZ,SAAS,CAAC;MAAES,kBAAkB,EAAEG,QAAQ;MAAEC,cAAc,EAAE;IAAK,CAAC,CAAC,EAC/EZ,QAAQ,EACRC,OAAO,CACR;IACD,MAAMY,KAAK,GAAGT,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIK,WAAW;IACnC,IAAII,KAAK,GAAGJ,WAAW,EAAE;MACvB,MAAM,IAAIlB,oBAAoB,CAAE,aAAYsB,KAAM,6BAA4BJ,WAAY,EAAC,CAAC;IAC9F;IACA,OAAOd,SAAS,CAACQ,SAAS,CAACU,KAAK,CAAC;EACnC;AACF,CAAC"}
|
|
@@ -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("
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas-price.mjs","names":["coinAmount","IllegalArgumentError","MIN_GAS_PRICE","serializeAettos","value","toString"],"sources":["../../../../src/tx/builder/field-types/gas-price.ts"],"sourcesContent":["import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n};\n"],"mappings":"OAAOA,UAAU;AAAA,SACRC,oBAAoB;AAAA,SACpBC,aAAa;AAEtB,eAAe;EACb,GAAGF,UAAU;EAEbG,
|
|
1
|
+
{"version":3,"file":"gas-price.mjs","names":["coinAmount","IllegalArgumentError","MIN_GAS_PRICE","serializeAettos","value","arguments","length","undefined","toString"],"sources":["../../../../src/tx/builder/field-types/gas-price.ts"],"sourcesContent":["import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n};\n"],"mappings":"OAAOA,UAAU;AAAA,SACRC,oBAAoB;AAAA,SACpBC,aAAa;AAEtB,eAAe;EACb,GAAGF,UAAU;EAEbG,eAAeA,CAAA,EAA+D;IAAA,IAA9DC,KAAyB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGH,aAAa,CAACM,QAAQ,EAAE;IAClE,IAAI,CAACJ,KAAK,GAAGF,aAAa,EAAE;MAC1B,MAAM,IAAID,oBAAoB,CAAE,aAAYG,KAAK,CAACI,QAAQ,EAAG,wBAAuBN,aAAc,EAAC,CAAC;IACtG;IACA,OAAOE,KAAK;EACd;AACF,CAAC"}
|
|
@@ -1,55 +1,100 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import _address from './address';
|
|
3
|
-
import
|
|
3
|
+
import _array from './array';
|
|
4
|
+
import _encoded from './encoded';
|
|
5
|
+
import _entry from './entry';
|
|
4
6
|
import _enumeration from './enumeration';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import _map from './map';
|
|
8
|
+
import _mptree from './mptree';
|
|
9
|
+
import _nonce from './nonce';
|
|
10
|
+
import _shortUIntConst from './short-u-int-const';
|
|
11
|
+
import _wrapped from './wrapped';
|
|
12
|
+
declare const abiVersion: {
|
|
13
|
+
_getProtocolDetails(c: import("../constants").ConsensusProtocolVersion, tag: import("../constants").Tag): import("../constants").AbiVersion;
|
|
14
|
+
serialize(value: import("../constants").AbiVersion | undefined, { tag }: {
|
|
15
|
+
tag: import("../constants").Tag;
|
|
16
|
+
}, { consensusProtocolVersion }: {
|
|
17
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
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>;
|
|
25
|
+
deserialize(buffer: Buffer): import("../constants").AbiVersion;
|
|
12
26
|
};
|
|
13
|
-
declare const
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
declare const address: typeof _address;
|
|
28
|
+
declare const array: typeof _array;
|
|
29
|
+
declare const boolean: {
|
|
30
|
+
serialize(value: boolean): Buffer;
|
|
31
|
+
deserialize(buffer: Buffer): boolean;
|
|
16
32
|
};
|
|
17
33
|
declare const coinAmount: {
|
|
18
34
|
serializeAettos(value: string | undefined): string;
|
|
19
|
-
serialize(value: import("
|
|
35
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
36
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
37
|
+
}): Buffer;
|
|
20
38
|
deserialize(value: Buffer): string;
|
|
21
39
|
};
|
|
22
|
-
declare const
|
|
23
|
-
|
|
40
|
+
declare const ctVersion: {
|
|
41
|
+
serialize(value: import("./ct-version").CtVersion | undefined, params: {}, { consensusProtocolVersion }: {
|
|
42
|
+
consensusProtocolVersion?: import("../constants").ConsensusProtocolVersion | undefined;
|
|
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>;
|
|
48
|
+
deserialize(buffer: Buffer): import("./ct-version").CtVersion;
|
|
49
|
+
};
|
|
24
50
|
declare const deposit: {
|
|
25
|
-
serialize(value: import("
|
|
51
|
+
serialize(value: import("../constants").Int | undefined, options: {}, parameters: {
|
|
52
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
53
|
+
}): Buffer;
|
|
26
54
|
serializeAettos(value: string | undefined): string;
|
|
27
55
|
deserialize(value: Buffer): string;
|
|
28
56
|
};
|
|
57
|
+
declare const encoded: typeof _encoded;
|
|
58
|
+
declare const entry: typeof _entry;
|
|
29
59
|
declare const enumeration: typeof _enumeration;
|
|
30
60
|
declare const fee: {
|
|
31
|
-
serializeAettos(_value: string | undefined, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
61
|
+
serializeAettos(_value: string | undefined, { rebuildTx, unpackTx, buildTx, _computingMinFee, _pickBiggerFee, }: {
|
|
62
|
+
rebuildTx: (params: any) => `tx_${string}`;
|
|
63
|
+
unpackTx: typeof import("..").unpackTx;
|
|
64
|
+
buildTx: typeof import("..").buildTx;
|
|
65
|
+
_computingMinFee?: import("bignumber.js").BigNumber | undefined;
|
|
66
|
+
_pickBiggerFee?: boolean | undefined;
|
|
35
67
|
}): string;
|
|
36
|
-
serialize(value: import("
|
|
68
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
69
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
70
|
+
}): Buffer;
|
|
71
|
+
deserialize(value: Buffer): string;
|
|
72
|
+
};
|
|
73
|
+
declare const field: {
|
|
74
|
+
serialize(value: string): Buffer;
|
|
37
75
|
deserialize(value: Buffer): string;
|
|
38
76
|
};
|
|
39
77
|
declare const gasLimit: {
|
|
40
|
-
serialize(_value: number | undefined, {
|
|
41
|
-
|
|
78
|
+
serialize(_value: number | undefined, { tag, rebuildTx, unpackTx, buildTx, _computingGasLimit, }: {
|
|
79
|
+
tag: import("../constants").Tag;
|
|
42
80
|
rebuildTx: (params: any) => any;
|
|
43
|
-
|
|
81
|
+
unpackTx: typeof import("..").unpackTx;
|
|
82
|
+
buildTx: typeof import("..").buildTx;
|
|
44
83
|
_computingGasLimit?: number | undefined;
|
|
84
|
+
}, { gasMax }: {
|
|
85
|
+
gasMax?: number | undefined;
|
|
45
86
|
}): Buffer;
|
|
46
87
|
deserialize(value: Buffer): number;
|
|
47
88
|
};
|
|
48
89
|
declare const gasPrice: {
|
|
49
90
|
serializeAettos(value?: string | undefined): string;
|
|
50
|
-
serialize(value: import("
|
|
91
|
+
serialize(value: import("../constants").Int | undefined, params: {}, { denomination }: {
|
|
92
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
93
|
+
}): Buffer;
|
|
51
94
|
deserialize(value: Buffer): string;
|
|
52
95
|
};
|
|
96
|
+
declare const map: typeof _map;
|
|
97
|
+
declare const mptree: typeof _mptree;
|
|
53
98
|
declare const name: {
|
|
54
99
|
serialize(value: `${string}.chain`): Buffer;
|
|
55
100
|
deserialize(value: Buffer): `${string}.chain`;
|
|
@@ -58,15 +103,18 @@ declare const nameFee: {
|
|
|
58
103
|
serializeAettos(_value: string | undefined, txFields: {
|
|
59
104
|
name: `${string}.chain`;
|
|
60
105
|
}): string;
|
|
61
|
-
serialize(value: import("
|
|
106
|
+
serialize(value: import("../constants").Int | undefined, txFields: {
|
|
62
107
|
name: `${string}.chain`;
|
|
63
|
-
}
|
|
108
|
+
}, parameters: {
|
|
109
|
+
denomination?: import("../../..").AE_AMOUNT_FORMATS | undefined;
|
|
110
|
+
}): Buffer;
|
|
64
111
|
deserialize(value: Buffer): string;
|
|
65
112
|
};
|
|
66
113
|
declare const nameId: {
|
|
67
|
-
serialize(value:
|
|
114
|
+
serialize(value: `${string}.chain` | `nm_${string}`): Buffer;
|
|
68
115
|
deserialize: (value: Buffer) => `nm_${string}`;
|
|
69
116
|
};
|
|
117
|
+
declare const nonce: typeof _nonce;
|
|
70
118
|
declare const pointers: {
|
|
71
119
|
serialize(pointers: (import("../../../apis/node").NamePointer & {
|
|
72
120
|
id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
|
|
@@ -75,8 +123,37 @@ declare const pointers: {
|
|
|
75
123
|
id: `ch_${string}` | `ct_${string}` | `ok_${string}` | `ak_${string}` | `cm_${string}` | `nm_${string}`;
|
|
76
124
|
})[];
|
|
77
125
|
};
|
|
126
|
+
declare const raw: {
|
|
127
|
+
serialize(buffer: Uint8Array): Buffer;
|
|
128
|
+
deserialize(buffer: Buffer): Buffer;
|
|
129
|
+
};
|
|
130
|
+
declare const shortUInt: {
|
|
131
|
+
serialize(value: number): Buffer;
|
|
132
|
+
deserialize(value: Buffer): number;
|
|
133
|
+
};
|
|
134
|
+
declare const shortUIntConst: typeof _shortUIntConst;
|
|
135
|
+
declare const string: {
|
|
136
|
+
serialize(string: string): Buffer;
|
|
137
|
+
deserialize(buffer: Buffer): string;
|
|
138
|
+
};
|
|
139
|
+
declare const ttl: {
|
|
140
|
+
serialize(value: number | undefined): Buffer;
|
|
141
|
+
prepare(value: number | undefined, params: {}, { onNode, absoluteTtl }: {
|
|
142
|
+
onNode?: import("../../..").Node | undefined;
|
|
143
|
+
absoluteTtl?: boolean | undefined;
|
|
144
|
+
}): Promise<number | undefined>;
|
|
145
|
+
deserialize(value: Buffer): number;
|
|
146
|
+
};
|
|
147
|
+
declare const uInt: {
|
|
148
|
+
serialize(value: import("../constants").Int): Buffer;
|
|
149
|
+
deserialize(value: Buffer): string;
|
|
150
|
+
};
|
|
151
|
+
declare const wrapped: typeof _wrapped;
|
|
152
|
+
export type BinaryData = Buffer | Buffer[] | Buffer[][] | Array<[Buffer, Array<[Buffer, Buffer[]]>]>;
|
|
78
153
|
export interface Field {
|
|
79
|
-
serialize: (value: any, options: any) =>
|
|
80
|
-
|
|
154
|
+
serialize: (value: any, options: any, parameters: any) => BinaryData;
|
|
155
|
+
prepare?: (value: any, options: any, parameters: any) => Promise<any>;
|
|
156
|
+
deserialize: (value: BinaryData, options: any) => any;
|
|
157
|
+
recursiveType?: boolean;
|
|
81
158
|
}
|
|
82
|
-
export {
|
|
159
|
+
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, };
|
|
@@ -1,32 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _uInt from "./u-int.mjs";
|
|
3
|
-
import _shortUInt from "./short-u-int.mjs";
|
|
4
|
-
import _coinAmount from "./coin-amount.mjs";
|
|
1
|
+
import _abiVersion from "./abi-version.mjs";
|
|
5
2
|
import _address from "./address.mjs";
|
|
6
|
-
import
|
|
3
|
+
import _array from "./array.mjs";
|
|
4
|
+
import _boolean from "./boolean.mjs";
|
|
5
|
+
import _coinAmount from "./coin-amount.mjs";
|
|
6
|
+
import _ctVersion from "./ct-version.mjs";
|
|
7
7
|
import _deposit from "./deposit.mjs";
|
|
8
|
+
import _encoded from "./encoded.mjs";
|
|
9
|
+
import _entry from "./entry.mjs";
|
|
8
10
|
import _enumeration from "./enumeration.mjs";
|
|
9
11
|
import _fee from "./fee.mjs";
|
|
12
|
+
import _field from "./field.mjs";
|
|
10
13
|
import _gasLimit from "./gas-limit.mjs";
|
|
11
14
|
import _gasPrice from "./gas-price.mjs";
|
|
15
|
+
import _map from "./map.mjs";
|
|
16
|
+
import _mptree from "./mptree.mjs";
|
|
12
17
|
import _name from "./name.mjs";
|
|
13
18
|
import _nameFee from "./name-fee.mjs";
|
|
14
19
|
import _nameId from "./name-id.mjs";
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
import _nonce from "./nonce.mjs";
|
|
21
|
+
import _pointers from "./pointers.mjs";
|
|
22
|
+
import _raw from "./raw.mjs";
|
|
23
|
+
import _shortUInt from "./short-u-int.mjs";
|
|
24
|
+
import _shortUIntConst from "./short-u-int-const.mjs";
|
|
25
|
+
import _string from "./string.mjs";
|
|
26
|
+
import _ttl from "./ttl.mjs";
|
|
27
|
+
import _uInt from "./u-int.mjs";
|
|
28
|
+
import _wrapped from "./wrapped.mjs"; // TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15
|
|
29
|
+
const abiVersion = _abiVersion;
|
|
20
30
|
const address = _address;
|
|
21
|
-
const
|
|
31
|
+
const array = _array;
|
|
32
|
+
const boolean = _boolean;
|
|
33
|
+
const coinAmount = _coinAmount;
|
|
34
|
+
const ctVersion = _ctVersion;
|
|
22
35
|
const deposit = _deposit;
|
|
36
|
+
const encoded = _encoded;
|
|
37
|
+
const entry = _entry;
|
|
23
38
|
const enumeration = _enumeration;
|
|
24
39
|
const fee = _fee;
|
|
40
|
+
const field = _field;
|
|
25
41
|
const gasLimit = _gasLimit;
|
|
26
42
|
const gasPrice = _gasPrice;
|
|
43
|
+
const map = _map;
|
|
44
|
+
const mptree = _mptree;
|
|
27
45
|
const name = _name;
|
|
28
46
|
const nameFee = _nameFee;
|
|
29
47
|
const nameId = _nameId;
|
|
48
|
+
const nonce = _nonce;
|
|
30
49
|
const pointers = _pointers;
|
|
31
|
-
|
|
50
|
+
const raw = _raw;
|
|
51
|
+
const shortUInt = _shortUInt;
|
|
52
|
+
const shortUIntConst = _shortUIntConst;
|
|
53
|
+
const string = _string;
|
|
54
|
+
const ttl = _ttl;
|
|
55
|
+
const uInt = _uInt;
|
|
56
|
+
const wrapped = _wrapped;
|
|
57
|
+
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 };
|
|
32
58
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["_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","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"],"sources":["../../../../src/tx/builder/field-types/index.ts"],"sourcesContent":["import _abiVersion from './abi-version';\nimport _address from './address';\nimport _array from './array';\nimport _boolean from './boolean';\nimport _coinAmount from './coin-amount';\nimport _ctVersion from './ct-version';\nimport _deposit from './deposit';\nimport _encoded from './encoded';\nimport _entry from './entry';\nimport _enumeration from './enumeration';\nimport _fee from './fee';\nimport _field from './field';\nimport _gasLimit from './gas-limit';\nimport _gasPrice from './gas-price';\nimport _map from './map';\nimport _mptree from './mptree';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\nimport _nonce from './nonce';\nimport _pointers from './pointers';\nimport _raw from './raw';\nimport _shortUInt from './short-u-int';\nimport _shortUIntConst from './short-u-int-const';\nimport _string from './string';\nimport _ttl from './ttl';\nimport _uInt from './u-int';\nimport _wrapped from './wrapped';\n\n// TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15\nconst abiVersion = _abiVersion;\nconst address = _address;\nconst array = _array;\nconst boolean = _boolean;\nconst coinAmount = _coinAmount;\nconst ctVersion = _ctVersion;\nconst deposit = _deposit;\nconst encoded = _encoded;\nconst entry = _entry;\nconst enumeration = _enumeration;\nconst fee = _fee;\nconst field = _field;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst map = _map;\nconst mptree = _mptree;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\nconst nonce = _nonce;\nconst pointers = _pointers;\nconst raw = _raw;\nconst shortUInt = _shortUInt;\nconst shortUIntConst = _shortUIntConst;\nconst string = _string;\nconst ttl = _ttl;\nconst uInt = _uInt;\nconst wrapped = _wrapped;\n\nexport type BinaryData = Buffer | Buffer[] | Buffer[][]\n| Array<[Buffer, Array<[Buffer, Buffer[]]>]>;\nexport interface Field {\n serialize: (value: any, options: any, parameters: any) => BinaryData;\n prepare?: (value: any, options: any, parameters: any) => Promise<any>;\n deserialize: (value: BinaryData, options: any) => any;\n recursiveType?: boolean;\n}\n\nexport {\n abiVersion,\n address,\n array,\n boolean,\n coinAmount,\n ctVersion,\n deposit,\n encoded,\n entry,\n enumeration,\n fee,\n field,\n gasLimit,\n gasPrice,\n map,\n mptree,\n name,\n nameFee,\n nameId,\n nonce,\n pointers,\n raw,\n shortUInt,\n shortUIntConst,\n string,\n ttl,\n uInt,\n wrapped,\n};\n"],"mappings":"OAAOA,WAAW;AAAA,OACXC,QAAQ;AAAA,OACRC,MAAM;AAAA,OACNC,QAAQ;AAAA,OACRC,WAAW;AAAA,OACXC,UAAU;AAAA,OACVC,QAAQ;AAAA,OACRC,QAAQ;AAAA,OACRC,MAAM;AAAA,OACNC,YAAY;AAAA,OACZC,IAAI;AAAA,OACJC,MAAM;AAAA,OACNC,SAAS;AAAA,OACTC,SAAS;AAAA,OACTC,IAAI;AAAA,OACJC,OAAO;AAAA,OACPC,KAAK;AAAA,OACLC,QAAQ;AAAA,OACRC,OAAO;AAAA,OACPC,MAAM;AAAA,OACNC,SAAS;AAAA,OACTC,IAAI;AAAA,OACJC,UAAU;AAAA,OACVC,eAAe;AAAA,OACfC,OAAO;AAAA,OACPC,IAAI;AAAA,OACJC,KAAK;AAAA,OACLC,QAAQ,uBAEf;AACA,MAAMC,UAAU,GAAG5B,WAAW;AAC9B,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,UAAU,GAAG5B,WAAW;AAC9B,MAAM6B,SAAS,GAAG5B,UAAU;AAC5B,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,WAAW,GAAG5B,YAAY;AAChC,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,IAAI,GAAG5B,KAAK;AAClB,MAAM6B,OAAO,GAAG5B,QAAQ;AACxB,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,KAAK,GAAG5B,MAAM;AACpB,MAAM6B,QAAQ,GAAG5B,SAAS;AAC1B,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,SAAS,GAAG5B,UAAU;AAC5B,MAAM6B,cAAc,GAAG5B,eAAe;AACtC,MAAM6B,MAAM,GAAG5B,OAAO;AACtB,MAAM6B,GAAG,GAAG5B,IAAI;AAChB,MAAM6B,IAAI,GAAG5B,KAAK;AAClB,MAAM6B,OAAO,GAAG5B,QAAQ;AAWxB,SACEC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,WAAW,EACXC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,QAAQ,EACRC,GAAG,EACHC,SAAS,EACTC,cAAc,EACdC,MAAM,EACNC,GAAG,EACHC,IAAI,EACJC,OAAO"}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Tag } from "../constants.mjs";
|
|
2
|
+
import { encode, Encoding, decode } from "../../../utils/encoder.mjs";
|
|
3
|
+
export default function genMapField(encoding, tag) {
|
|
4
|
+
return {
|
|
5
|
+
serialize(object, _ref) {
|
|
6
|
+
let {
|
|
7
|
+
buildTx
|
|
8
|
+
} = _ref;
|
|
9
|
+
return decode(buildTx({
|
|
10
|
+
tag: Tag.Mtree,
|
|
11
|
+
values: Object.entries(object).map(_ref2 => {
|
|
12
|
+
let [key, value] = _ref2;
|
|
13
|
+
return {
|
|
14
|
+
tag: Tag.MtreeValue,
|
|
15
|
+
key: decode(key),
|
|
16
|
+
value: decode(buildTx({
|
|
17
|
+
...value,
|
|
18
|
+
tag
|
|
19
|
+
}))
|
|
20
|
+
};
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
},
|
|
24
|
+
deserialize(buffer, _ref3) {
|
|
25
|
+
let {
|
|
26
|
+
unpackTx
|
|
27
|
+
} = _ref3;
|
|
28
|
+
const {
|
|
29
|
+
values
|
|
30
|
+
} = unpackTx(encode(buffer, Encoding.Transaction), Tag.Mtree);
|
|
31
|
+
return Object.fromEntries(values
|
|
32
|
+
// TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066
|
|
33
|
+
.filter(_ref4 => {
|
|
34
|
+
let {
|
|
35
|
+
key
|
|
36
|
+
} = _ref4;
|
|
37
|
+
return encoding !== Encoding.ContractAddress || key.length === 32;
|
|
38
|
+
}).map(_ref5 => {
|
|
39
|
+
let {
|
|
40
|
+
key,
|
|
41
|
+
value
|
|
42
|
+
} = _ref5;
|
|
43
|
+
return [encode(key, encoding), unpackTx(encode(value, Encoding.Transaction), tag)];
|
|
44
|
+
}));
|
|
45
|
+
},
|
|
46
|
+
recursiveType: true
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=map.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.mjs","names":["Tag","encode","Encoding","decode","genMapField","encoding","tag","serialize","object","_ref","buildTx","Mtree","values","Object","entries","map","_ref2","key","value","MtreeValue","deserialize","buffer","_ref3","unpackTx","Transaction","fromEntries","filter","_ref4","ContractAddress","length","_ref5","recursiveType"],"sources":["../../../../src/tx/builder/field-types/map.ts"],"sourcesContent":["import { Tag } from '../constants';\nimport {\n encode, Encoding, Encoded, decode,\n} from '../../../utils/encoder';\nimport type { unpackTx as unpackTxType, buildTx as buildTxType } from '../index';\n\nexport default function genMapField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {\n serialize: (\n // TODO: replace with `TxParams & { tag: T }`,\n // but fix TS2502 value is referenced directly or indirectly in its own type annotation\n value: Record<Encoded.Generic<E>, any>, options: { buildTx: typeof buildTxType }\n ) => Buffer;\n deserialize: (\n value: Buffer, options: { unpackTx: typeof unpackTxType },\n // TODO: replace with `TxUnpacked & { tag: T }`,\n // TS2577 Return type annotation circularly references itself\n ) => Record<Encoded.Generic<E>, any>;\n recursiveType: true;\n} {\n return {\n serialize(object, { buildTx }) {\n return decode(buildTx({\n tag: Tag.Mtree,\n values: Object.entries(object).map(([key, value]) => ({\n tag: Tag.MtreeValue,\n key: decode(key as Encoded.Generic<E>),\n value: decode(buildTx({ ...value as any, tag })),\n })),\n }));\n },\n\n deserialize(buffer, { unpackTx }) {\n const { values } = unpackTx(encode(buffer, Encoding.Transaction), Tag.Mtree);\n return Object.fromEntries(values\n // TODO: remove after resolving https://github.com/aeternity/aeternity/issues/4066\n .filter(({ key }) => encoding !== Encoding.ContractAddress || key.length === 32)\n .map(({ key, value }) => [\n encode(key, encoding),\n unpackTx(encode(value, Encoding.Transaction), tag),\n ])) as Record<Encoded.Generic<E>, any>;\n },\n\n recursiveType: true,\n };\n}\n"],"mappings":"SAASA,GAAG;AAAA,SAEVC,MAAM,EAAEC,QAAQ,EAAWC,MAAM;AAInC,eAAe,SAASC,WAAWA,CAAoCC,QAAW,EAAEC,GAAM,EAYxF;EACA,OAAO;IACLC,SAASA,CAACC,MAAM,EAAAC,IAAA,EAAe;MAAA,IAAb;QAAEC;MAAQ,CAAC,GAAAD,IAAA;MAC3B,OAAON,MAAM,CAACO,OAAO,CAAC;QACpBJ,GAAG,EAAEN,GAAG,CAACW,KAAK;QACdC,MAAM,EAAEC,MAAM,CAACC,OAAO,CAACN,MAAM,CAAC,CAACO,GAAG,CAACC,KAAA;UAAA,IAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,KAAA;UAAA,OAAM;YACpDV,GAAG,EAAEN,GAAG,CAACmB,UAAU;YACnBF,GAAG,EAAEd,MAAM,CAACc,GAAG,CAAuB;YACtCC,KAAK,EAAEf,MAAM,CAACO,OAAO,CAAC;cAAE,GAAGQ,KAAY;cAAEZ;YAAI,CAAC,CAAC;UACjD,CAAC;QAAA,CAAC;MACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEDc,WAAWA,CAACC,MAAM,EAAAC,KAAA,EAAgB;MAAA,IAAd;QAAEC;MAAS,CAAC,GAAAD,KAAA;MAC9B,MAAM;QAAEV;MAAO,CAAC,GAAGW,QAAQ,CAACtB,MAAM,CAACoB,MAAM,EAAEnB,QAAQ,CAACsB,WAAW,CAAC,EAAExB,GAAG,CAACW,KAAK,CAAC;MAC5E,OAAOE,MAAM,CAACY,WAAW,CAACb;MACxB;MAAA,CACCc,MAAM,CAACC,KAAA;QAAA,IAAC;UAAEV;QAAI,CAAC,GAAAU,KAAA;QAAA,OAAKtB,QAAQ,KAAKH,QAAQ,CAAC0B,eAAe,IAAIX,GAAG,CAACY,MAAM,KAAK,EAAE;MAAA,EAAC,CAC/Ed,GAAG,CAACe,KAAA;QAAA,IAAC;UAAEb,GAAG;UAAEC;QAAM,CAAC,GAAAY,KAAA;QAAA,OAAK,CACvB7B,MAAM,CAACgB,GAAG,EAAEZ,QAAQ,CAAC,EACrBkB,QAAQ,CAACtB,MAAM,CAACiB,KAAK,EAAEhB,QAAQ,CAACsB,WAAW,CAAC,EAAElB,GAAG,CAAC,CACnD;MAAA,EAAC,CAAC;IACP,CAAC;IAEDyB,aAAa,EAAE;EACjB,CAAC;AACH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Tag } from '../constants';
|
|
3
|
+
import { Encoded, Encoding } from '../../../utils/encoder';
|
|
4
|
+
import type { unpackTx } from '..';
|
|
5
|
+
import type { TxUnpacked } from '../schema.generated';
|
|
6
|
+
type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];
|
|
7
|
+
declare class MPTree<E extends Encoding, T extends Tag> {
|
|
8
|
+
#private;
|
|
9
|
+
get isComplete(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Deserialize Merkle Patricia Tree
|
|
12
|
+
* @param binary - Binary
|
|
13
|
+
* @param tag - Tag to use to decode value
|
|
14
|
+
* @param unpTx - Implementation of unpackTx use to decode values
|
|
15
|
+
* @returns Merkle Patricia Tree
|
|
16
|
+
*/
|
|
17
|
+
constructor(binary: MPTreeBinary, encoding: E, tag: T, unpTx: typeof unpackTx);
|
|
18
|
+
isEqual(tree: MPTree<E, T>): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Serialize Merkle Patricia Tree
|
|
21
|
+
* @returns Binary
|
|
22
|
+
*/
|
|
23
|
+
serialize(): MPTreeBinary;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieve value from Merkle Patricia Tree
|
|
26
|
+
* @param key - The key of the element to retrieve
|
|
27
|
+
* @returns Value associated to the specified key
|
|
28
|
+
*/
|
|
29
|
+
get(key: Encoded.Generic<E>): TxUnpacked & {
|
|
30
|
+
tag: T;
|
|
31
|
+
} | undefined;
|
|
32
|
+
toObject(): Record<Encoded.Generic<E>, TxUnpacked & {
|
|
33
|
+
tag: T;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export default function genMPTreeField<E extends Encoding, T extends Tag>(encoding: E, tag: T): {
|
|
37
|
+
serialize: (value: MPTree<E, T>) => MPTreeBinary;
|
|
38
|
+
deserialize: (value: MPTreeBinary, o: {
|
|
39
|
+
unpackTx: typeof unpackTx;
|
|
40
|
+
}) => MPTree<E, T>;
|
|
41
|
+
};
|
|
42
|
+
export {};
|