@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
package/es/utils/other.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"other.mjs","names":["RestError","pause","duration","Promise","resolve","setTimeout","mapObject","object","fn","Object","fromEntries","entries","map","isWebpack4Buffer","concat","Uint8Array","from","error","concatBuffers","list","totalLength","el","isKeyOfObject","key","isItemOfArray","item","array","includes","isAccountNotFoundError","statusCode","message"],"sources":["../../src/utils/other.ts"],"sourcesContent":["import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n"],"mappings":";;;;AAAA,SAASA,SAAS,QAAQ,2BAA2B;AAErD,OAAO,MAAMC,KAAK,GAAG,MAAOC,QAAgB,IAAoB,IAAIC,OAAO,CAAEC,OAAO,IAAK;EACvFC,UAAU,CAACD,OAAO,EAAEF,QAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMI,SAAS,
|
|
1
|
+
{"version":3,"file":"other.mjs","names":["RestError","pause","duration","Promise","resolve","setTimeout","mapObject","object","fn","Object","fromEntries","entries","map","isWebpack4Buffer","_Buffer","concat","Uint8Array","from","error","concatBuffers","list","totalLength","el","isKeyOfObject","key","isItemOfArray","item","array","includes","isAccountNotFoundError","statusCode","message"],"sources":["../../src/utils/other.ts"],"sourcesContent":["import { RestError } from '@azure/core-rest-pipeline';\n\nexport const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T extends object>(\n key: string | number | symbol,\n object: T,\n): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n\nexport function isAccountNotFoundError(error: Error): boolean {\n return error instanceof RestError && error.statusCode === 404\n && error.message.includes('Account not found');\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\nexport type UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n"],"mappings":";;;;AAAA,SAASA,SAAS,QAAQ,2BAA2B;AAErD,OAAO,MAAMC,KAAK,GAAG,MAAOC,QAAgB,IAAoB,IAAIC,OAAO,CAAEC,OAAO,IAAK;EACvFC,UAAU,CAACD,OAAO,EAAEF,QAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMI,SAAS,GAAGA,CACvBC,MAA+B,EAC/BC,EAE+B,KACFC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,MAAM,CAAC,CAACK,GAAG,CAACJ,EAAE,CAAC,CAAC;;AAEjF;AACA,MAAMK,gBAAgB,GAAG,CAAC,MAAM;EAC9B,IAAI;IACFC,OAAA,CAAOC,MAAM,CAAC,CAACC,UAAU,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,OAAO,KAAK;EACd,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF,CAAC,GAAG;AAEJ,OAAO,MAAMC,aAAa,GAAGN,gBAAgB,GACzC,CAACO,IAA2B,EAAEC,WAAoB,KAClDP,OAAA,CAAOC,MAAM,CAACK,IAAI,CAACR,GAAG,CAAEU,EAAE,IAAKR,OAAA,CAAOG,IAAI,CAACK,EAAE,CAAC,CAAC,EAAED,WAAW,CAC7D,GACCP,OAAA,CAAOC,MAAM;;AAEjB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,aAAaA,CAC3BC,GAA6B,EAC7BjB,MAAS,EACO;EAChB,OAAOiB,GAAG,IAAIjB,MAAM;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkB,aAAaA,CAAIC,IAAS,EAAEC,KAAmB,EAAa;EAC1E,OAAOA,KAAK,CAACC,QAAQ,CAACF,IAAI,CAAC;AAC7B;AAEA,OAAO,SAASG,sBAAsBA,CAACX,KAAY,EAAW;EAC5D,OAAOA,KAAK,YAAYlB,SAAS,IAAIkB,KAAK,CAACY,UAAU,KAAK,GAAG,IACxDZ,KAAK,CAACa,OAAO,CAACH,QAAQ,CAAC,mBAAmB,CAAC;AAClD;;AAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semver-satisfies.mjs","names":["semverSatisfies","version","geVersion","ltVersion","getComponents","v","split","map","i","versionComponents","geComponents","ltComponents","base","Math","max","componentsToNumber","components","reverse","reduce","acc","n","idx","vNumber","geNumber","ltNumber"],"sources":["../../src/utils/semver-satisfies.ts"],"sourcesContent":["export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n"],"mappings":"AAAA,eAAe,SAASA,
|
|
1
|
+
{"version":3,"file":"semver-satisfies.mjs","names":["semverSatisfies","version","geVersion","ltVersion","getComponents","v","split","map","i","versionComponents","geComponents","ltComponents","base","Math","max","componentsToNumber","components","reverse","reduce","acc","n","idx","vNumber","geNumber","ltNumber"],"sources":["../../src/utils/semver-satisfies.ts"],"sourcesContent":["export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n"],"mappings":"AAAA,eAAe,SAASA,eAAeA,CACrCC,OAAe,EACfC,SAAiB,EACjBC,SAAiB,EACR;EACT,MAAMC,aAAa,GAAIC,CAAS,IAAeA,CAAC,CAC7CC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAACA,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAEC,CAAC,IAAK,CAACA,CAAC,CAAC;EAE7C,MAAMC,iBAAiB,GAAGL,aAAa,CAACH,OAAO,CAAC;EAChD,MAAMS,YAAY,GAAGN,aAAa,CAACF,SAAS,CAAC;EAC7C,MAAMS,YAAY,GAAGP,aAAa,CAACD,SAAS,CAAC;EAE7C,MAAMS,IAAI,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAGL,iBAAiB,EAAE,GAAGC,YAAY,EAAE,GAAGC,YAAY,CAAC,GAAG,CAAC;EACjF,MAAMI,kBAAkB,GAAIC,UAAoB,IAAaA,UAAU,CAACC,OAAO,EAAE,CAC9EC,MAAM,CAAC,CAACC,GAAG,EAAEC,CAAC,EAAEC,GAAG,KAAKF,GAAG,GAAGC,CAAC,GAAGR,IAAI,IAAIS,GAAG,EAAE,CAAC,CAAC;EAEpD,MAAMC,OAAO,GAAGP,kBAAkB,CAACN,iBAAiB,CAAC;EACrD,MAAMc,QAAQ,GAAGR,kBAAkB,CAACL,YAAY,CAAC;EACjD,MAAMc,QAAQ,GAAGT,kBAAkB,CAACJ,YAAY,CAAC;EACjD,OAAOW,OAAO,IAAIC,QAAQ,IAAID,OAAO,GAAGE,QAAQ;AAClD"}
|
package/es/utils/string.mjs
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright 2018 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
1
|
/**
|
|
19
2
|
* Convert string from snake_case to PascalCase
|
|
20
3
|
* @param s - String to convert
|
package/es/utils/string.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.mjs","names":["snakeToPascal","s","replace","match","toUpperCase","pascalToSnake","toLowerCase"],"sources":["../../src/utils/string.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"string.mjs","names":["snakeToPascal","s","replace","match","toUpperCase","pascalToSnake","toLowerCase"],"sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAACC,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,KAAK,IAAKA,KAAK,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACJ,CAAS,EAAU;EAC/C,OAAOA,CAAC,CAACC,OAAO,CAAC,QAAQ,EAAGC,KAAK,IAAM,IAAGA,KAAK,CAACG,WAAW,EAAG,EAAC,CAAC;AAClE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeternity/aepp-sdk",
|
|
3
|
-
"version": "13.0.0-
|
|
3
|
+
"version": "13.0.0-beta.0",
|
|
4
4
|
"description": "SDK for the æternity blockchain",
|
|
5
5
|
"main": "dist/aepp-sdk.js",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
"build:assets": "node tooling/fetch-aesophia-cli.mjs",
|
|
35
35
|
"build:types": "tsc && node tooling/downlevel/run.mjs",
|
|
36
36
|
"build:es": "babel src --config-file ./babel.esm.config.js --out-dir es --extensions .js,.ts --out-file-extension .mjs --source-maps true",
|
|
37
|
-
"build:api": "node tooling/autorest/compiler-prepare.mjs && autorest tooling/autorest/compiler.yaml
|
|
38
|
-
"build
|
|
37
|
+
"build:api": "node tooling/autorest/compiler-prepare.mjs && autorest tooling/autorest/compiler.yaml && autorest tooling/autorest/node.yaml",
|
|
38
|
+
"build:generate": "tooling/generate-schema.ts",
|
|
39
|
+
"build": "npm run build:api && npm run build:generate && webpack && npm run build:types && npm run build:es && npm run build:assets",
|
|
39
40
|
"docs:examples": "node tooling/docs/examples-to-md.js examples/node/*.mjs",
|
|
40
41
|
"docs:api": "typedoc",
|
|
41
42
|
"commitlint": "commitlint --from develop",
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
"prepare": "npm run build",
|
|
49
50
|
"prepublishOnly": "test/examples.sh && npm run docs:examples && npm run docs:api",
|
|
50
51
|
"release": "standard-version --skip.tag --infile docs/CHANGELOG.md",
|
|
51
|
-
"release-alpha": "npm run release -- --prerelease alpha"
|
|
52
|
+
"release-alpha": "npm run release -- --prerelease alpha",
|
|
53
|
+
"release-beta": "npm run release -- --prerelease beta"
|
|
52
54
|
},
|
|
53
55
|
"license": "ISC",
|
|
54
56
|
"keywords": [
|
|
@@ -58,18 +60,19 @@
|
|
|
58
60
|
"SDK"
|
|
59
61
|
],
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"@aeternity/aepp-calldata": "
|
|
63
|
+
"@aeternity/aepp-calldata": "github:aeternity/aepp-calldata-js#3320455210221e59bff1198389ccfd5851598513",
|
|
62
64
|
"@aeternity/argon2": "^0.0.1",
|
|
63
65
|
"@aeternity/uuid": "^0.0.1",
|
|
64
66
|
"@azure/core-client": "1.6.0",
|
|
65
|
-
"@azure/core-rest-pipeline": "^1.10.
|
|
66
|
-
"@babel/runtime-corejs3": "^7.
|
|
67
|
-
"@ledgerhq/hw-transport": "^6.
|
|
67
|
+
"@azure/core-rest-pipeline": "^1.10.1",
|
|
68
|
+
"@babel/runtime-corejs3": "^7.21.0",
|
|
69
|
+
"@ledgerhq/hw-transport": "^6.28.1",
|
|
68
70
|
"@types/aes-js": "^3.1.1",
|
|
69
71
|
"@types/json-bigint": "^1.0.1",
|
|
72
|
+
"@types/node": "~18.11.9",
|
|
70
73
|
"@types/sha.js": "^2.4.0",
|
|
71
|
-
"@types/uuid": "^9.0.
|
|
72
|
-
"@types/webextension-polyfill": "^0.
|
|
74
|
+
"@types/uuid": "^9.0.1",
|
|
75
|
+
"@types/webextension-polyfill": "^0.10.0",
|
|
73
76
|
"@types/websocket": "^1.0.5",
|
|
74
77
|
"aes-js": "^3.1.2",
|
|
75
78
|
"bignumber.js": "^9.1.1",
|
|
@@ -92,36 +95,35 @@
|
|
|
92
95
|
"url": "https://github.com/aeternity/aepp-sdk-js"
|
|
93
96
|
},
|
|
94
97
|
"devDependencies": {
|
|
95
|
-
"@babel/cli": "^7.
|
|
96
|
-
"@babel/core": "^7.
|
|
98
|
+
"@babel/cli": "^7.21.0",
|
|
99
|
+
"@babel/core": "^7.21.0",
|
|
97
100
|
"@babel/node": "^7.20.7",
|
|
98
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
101
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
99
102
|
"@babel/preset-env": "^7.20.2",
|
|
100
|
-
"@babel/preset-typescript": "^7.
|
|
101
|
-
"@babel/register": "^7.
|
|
102
|
-
"@commitlint/cli": "^17.
|
|
103
|
-
"@commitlint/config-conventional": "^17.
|
|
104
|
-
"@ledgerhq/hw-transport-mocker": "^6.27.
|
|
105
|
-
"@ledgerhq/hw-transport-node-hid-singleton": "^6.28.
|
|
106
|
-
"@ledgerhq/hw-transport-webusb": "^6.27.
|
|
103
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
104
|
+
"@babel/register": "^7.21.0",
|
|
105
|
+
"@commitlint/cli": "^17.4.4",
|
|
106
|
+
"@commitlint/config-conventional": "^17.4.4",
|
|
107
|
+
"@ledgerhq/hw-transport-mocker": "^6.27.12",
|
|
108
|
+
"@ledgerhq/hw-transport-node-hid-singleton": "^6.28.9",
|
|
109
|
+
"@ledgerhq/hw-transport-webusb": "^6.27.12",
|
|
107
110
|
"@types/chai": "^4.3.4",
|
|
108
111
|
"@types/chai-as-promised": "^7.1.5",
|
|
109
112
|
"@types/mocha": "^10.0.1",
|
|
110
113
|
"@types/node-hid": "^1.3.1",
|
|
111
114
|
"@types/sinon": "^10.0.13",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
113
|
-
"@typescript-eslint/parser": "^5.
|
|
114
|
-
"autorest": "^3.6.
|
|
115
|
-
"babel-loader": "^9.1.
|
|
115
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
116
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
117
|
+
"autorest": "^3.6.3",
|
|
118
|
+
"babel-loader": "^9.1.2",
|
|
116
119
|
"babel-plugin-add-import-extension": "^1.6.0",
|
|
117
120
|
"babel-plugin-import-globals": "^2.0.0",
|
|
118
121
|
"babel-plugin-transform-default-named-imports": "^1.2.2",
|
|
119
122
|
"babel-plugin-transform-import-meta": "^2.2.0",
|
|
120
123
|
"chai": "^4.3.7",
|
|
121
124
|
"chai-as-promised": "^7.1.1",
|
|
122
|
-
"cross-fetch": "^3.1.5",
|
|
123
125
|
"downlevel-dts": "github:aeternity/downlevel-dts",
|
|
124
|
-
"eslint": "^8.
|
|
126
|
+
"eslint": "^8.35.0",
|
|
125
127
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
126
128
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
127
129
|
"eslint-plugin-rulesdir": "^0.2.2",
|
|
@@ -132,11 +134,12 @@
|
|
|
132
134
|
"sinon": "^15.0.1",
|
|
133
135
|
"source-map": "^0.7.4",
|
|
134
136
|
"standard-version": "^9.5.0",
|
|
135
|
-
"
|
|
137
|
+
"ts-node": "^10.9.1",
|
|
138
|
+
"typedoc": "^0.23.26",
|
|
136
139
|
"typedoc-plugin-missing-exports": "^1.0.0",
|
|
137
|
-
"typescript": "^4.9.
|
|
140
|
+
"typescript": "^4.9.5",
|
|
138
141
|
"webpack": "^5.75.0",
|
|
139
|
-
"webpack-bundle-analyzer": "^4.
|
|
142
|
+
"webpack-bundle-analyzer": "^4.8.0",
|
|
140
143
|
"webpack-cli": "^5.0.1"
|
|
141
144
|
},
|
|
142
145
|
"files": [
|
|
@@ -166,5 +169,6 @@
|
|
|
166
169
|
},
|
|
167
170
|
"engines": {
|
|
168
171
|
"node": ">=14.19.0"
|
|
169
|
-
}
|
|
172
|
+
},
|
|
173
|
+
"packageManager": "npm@8.19.3"
|
|
170
174
|
}
|
package/src/AeSdkMethods.ts
CHANGED
|
@@ -3,15 +3,14 @@ import * as aensMethods from './aens';
|
|
|
3
3
|
import * as spendMethods from './spend';
|
|
4
4
|
import * as oracleMethods from './oracle';
|
|
5
5
|
import Contract, { ContractMethodsBase } from './contract/Contract';
|
|
6
|
+
import createDelegationSignature from './contract/delegation-signature';
|
|
6
7
|
import * as contractGaMethods from './contract/ga';
|
|
7
|
-
import {
|
|
8
|
+
import { buildTxAsync } from './tx/builder';
|
|
8
9
|
import { mapObject, UnionToIntersection } from './utils/other';
|
|
9
10
|
import Node from './Node';
|
|
10
|
-
import {
|
|
11
|
-
import { Tag } from './tx/builder/constants';
|
|
11
|
+
import { TxParamsAsync } from './tx/builder/schema.generated';
|
|
12
12
|
import AccountBase from './account/Base';
|
|
13
13
|
import { Encoded } from './utils/encoder';
|
|
14
|
-
import CompilerBase from './contract/compiler/Base';
|
|
15
14
|
import { ArgumentError, NotImplementedError, TypeError } from './utils/errors';
|
|
16
15
|
|
|
17
16
|
export type OnAccount = Encoded.AccountAddress | AccountBase | undefined;
|
|
@@ -40,6 +39,7 @@ const methods = {
|
|
|
40
39
|
...aensMethods,
|
|
41
40
|
...spendMethods,
|
|
42
41
|
...oracleMethods,
|
|
42
|
+
createDelegationSignature,
|
|
43
43
|
...contractGaMethods,
|
|
44
44
|
} as const;
|
|
45
45
|
|
|
@@ -70,7 +70,7 @@ interface AeSdkMethodsOptions
|
|
|
70
70
|
* their context (current account, network, and compiler to use).
|
|
71
71
|
*/
|
|
72
72
|
class AeSdkMethods {
|
|
73
|
-
_options: AeSdkMethodsOptions = {
|
|
73
|
+
_options: AeSdkMethodsOptions = {};
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @param options - Options
|
|
@@ -100,15 +100,8 @@ class AeSdkMethods {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
async buildTx
|
|
104
|
-
|
|
105
|
-
options: Omit<Parameters<typeof _buildTx<TxType>>[1], 'onNode'> & { onNode?: Node },
|
|
106
|
-
): Promise<Encoded.Transaction> {
|
|
107
|
-
// @ts-expect-error TODO: need to figure out what's wrong here
|
|
108
|
-
return _buildTx<TxType>(txType, {
|
|
109
|
-
...this._getOptions(),
|
|
110
|
-
...options,
|
|
111
|
-
});
|
|
103
|
+
async buildTx(options: TxParamsAsync): Promise<Encoded.Transaction> {
|
|
104
|
+
return buildTxAsync({ ...this._getOptions(), ...options });
|
|
112
105
|
}
|
|
113
106
|
|
|
114
107
|
async initializeContract<Methods extends ContractMethodsBase>(
|
|
@@ -133,9 +126,11 @@ type RequiredKeys<T> = {
|
|
|
133
126
|
|
|
134
127
|
type OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;
|
|
135
128
|
|
|
129
|
+
type ReplaceOnAccount<Options> = Options extends { onAccount: any }
|
|
130
|
+
? Omit<Options, 'onAccount'> & { onAccount: OnAccount } : Options;
|
|
131
|
+
|
|
136
132
|
type MakeOptional<Options> = OptionalIfNotRequired<[
|
|
137
|
-
Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'>
|
|
138
|
-
& { onNode?: Node; onCompiler?: CompilerBase; onAccount?: OnAccount },
|
|
133
|
+
Omit<Options, 'onNode' | 'onCompiler' | 'onAccount'> & Partial<ReplaceOnAccount<Options>>,
|
|
139
134
|
]>;
|
|
140
135
|
|
|
141
136
|
type TransformMethods <Methods extends { [key: string]: Function }> =
|
package/src/AeSdkWallet.ts
CHANGED
|
@@ -254,7 +254,7 @@ export default class AeSdkWallet extends AeSdk {
|
|
|
254
254
|
}
|
|
255
255
|
try {
|
|
256
256
|
return jsonBig.parse(jsonBig.stringify({
|
|
257
|
-
transactionHash: await this.
|
|
257
|
+
transactionHash: await this.sendTransaction(tx, { ...parameters, verify: false }),
|
|
258
258
|
}));
|
|
259
259
|
} catch (error) {
|
|
260
260
|
const validation = await verifyTransaction(tx, this.api);
|
package/src/Node.ts
CHANGED
|
@@ -3,7 +3,7 @@ import BigNumber from 'bignumber.js';
|
|
|
3
3
|
import { OperationArguments, OperationSpec } from '@azure/core-client';
|
|
4
4
|
import {
|
|
5
5
|
genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,
|
|
6
|
-
genVersionCheckPolicy,
|
|
6
|
+
genVersionCheckPolicy, genRetryOnFailurePolicy,
|
|
7
7
|
} from './utils/autorest';
|
|
8
8
|
import { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';
|
|
9
9
|
import { mapObject } from './utils/other';
|
|
@@ -111,16 +111,24 @@ export interface NodeInfo {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {
|
|
114
|
-
#networkIdPromise?: Promise<string>;
|
|
114
|
+
#networkIdPromise?: Promise<string | Error>;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* @param url - Url for node API
|
|
118
118
|
* @param options - Options
|
|
119
119
|
* @param options.ignoreVersion - Don't check node version
|
|
120
|
+
* @param options.retryCount - Amount of extra requests to do in case of failure
|
|
121
|
+
* @param options.retryOverallDelay - Time in ms to wait between all retries
|
|
120
122
|
*/
|
|
121
123
|
constructor(
|
|
122
124
|
url: string,
|
|
123
|
-
{
|
|
125
|
+
{
|
|
126
|
+
ignoreVersion = false, retryCount = 3, retryOverallDelay = 800, ...options
|
|
127
|
+
}: NodeOptionalParams & {
|
|
128
|
+
ignoreVersion?: boolean;
|
|
129
|
+
retryCount?: number;
|
|
130
|
+
retryOverallDelay?: number;
|
|
131
|
+
} = {},
|
|
124
132
|
) {
|
|
125
133
|
// eslint-disable-next-line constructor-super
|
|
126
134
|
super(url, {
|
|
@@ -128,14 +136,15 @@ export default class Node extends (NodeTransformed as unknown as NodeTransformed
|
|
|
128
136
|
additionalPolicies: [
|
|
129
137
|
genRequestQueuesPolicy(),
|
|
130
138
|
genCombineGetRequestsPolicy(),
|
|
139
|
+
genRetryOnFailurePolicy(retryCount, retryOverallDelay),
|
|
131
140
|
genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),
|
|
132
141
|
],
|
|
133
142
|
...options,
|
|
134
143
|
});
|
|
135
144
|
if (!ignoreVersion) {
|
|
136
145
|
const statusPromise = this.getStatus();
|
|
137
|
-
const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion);
|
|
138
|
-
this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId);
|
|
146
|
+
const versionPromise = statusPromise.then(({ nodeVersion }) => nodeVersion, (error) => error);
|
|
147
|
+
this.#networkIdPromise = statusPromise.then(({ networkId }) => networkId, (error) => error);
|
|
139
148
|
this.pipeline.addPolicy(
|
|
140
149
|
genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),
|
|
141
150
|
);
|
|
@@ -145,7 +154,9 @@ export default class Node extends (NodeTransformed as unknown as NodeTransformed
|
|
|
145
154
|
|
|
146
155
|
async getNetworkId(): Promise<string> {
|
|
147
156
|
this.#networkIdPromise ??= this.getStatus().then(({ networkId }) => networkId);
|
|
148
|
-
|
|
157
|
+
const networkId = await this.#networkIdPromise;
|
|
158
|
+
if (networkId instanceof Error) throw networkId;
|
|
159
|
+
return networkId;
|
|
149
160
|
}
|
|
150
161
|
|
|
151
162
|
async getNodeInfo(): Promise<NodeInfo> {
|
package/src/account/Base.ts
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2022 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
1
|
import { Encoded } from '../utils/encoder';
|
|
18
2
|
import Node from '../Node';
|
|
19
3
|
import CompilerBase from '../contract/compiler/Base';
|
|
4
|
+
import { Int } from '../tx/builder/constants';
|
|
5
|
+
|
|
6
|
+
interface AuthData {
|
|
7
|
+
fee?: Int;
|
|
8
|
+
gasLimit?: number;
|
|
9
|
+
gasPrice?: Int;
|
|
10
|
+
callData?: Encoded.ContractBytearray;
|
|
11
|
+
sourceCode?: string;
|
|
12
|
+
args?: any[];
|
|
13
|
+
}
|
|
20
14
|
|
|
21
15
|
/**
|
|
22
16
|
* Account is one of the three basic building blocks of an
|
|
@@ -36,12 +30,7 @@ export default abstract class AccountBase {
|
|
|
36
30
|
options: {
|
|
37
31
|
innerTx?: boolean;
|
|
38
32
|
networkId?: string;
|
|
39
|
-
authData?:
|
|
40
|
-
gasLimit?: number;
|
|
41
|
-
callData?: Encoded.ContractBytearray;
|
|
42
|
-
sourceCode?: string;
|
|
43
|
-
args?: any[];
|
|
44
|
-
};
|
|
33
|
+
authData?: AuthData | ((tx: Encoded.Transaction) => Promise<AuthData>);
|
|
45
34
|
onNode?: Node;
|
|
46
35
|
onCompiler?: CompilerBase;
|
|
47
36
|
aeppOrigin?: string;
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2022 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
1
|
import AccountBase from './Base';
|
|
18
2
|
import {
|
|
19
3
|
ArgumentError,
|
|
@@ -24,9 +8,8 @@ import {
|
|
|
24
8
|
import { decode, Encoded } from '../utils/encoder';
|
|
25
9
|
import { getAccount } from '../chain';
|
|
26
10
|
import Contract from '../contract/Contract';
|
|
27
|
-
import {
|
|
11
|
+
import { buildTxAsync, buildTx } from '../tx/builder';
|
|
28
12
|
import { Tag } from '../tx/builder/constants';
|
|
29
|
-
import { buildTx } from '../tx/builder';
|
|
30
13
|
|
|
31
14
|
/**
|
|
32
15
|
* Generalized account class
|
|
@@ -63,8 +46,8 @@ export default class AccountGeneralized extends AccountBase {
|
|
|
63
46
|
throw new ArgumentError('authData, onCompiler, onNode', 'provided', null);
|
|
64
47
|
}
|
|
65
48
|
const {
|
|
66
|
-
callData, sourceCode, args, gasLimit,
|
|
67
|
-
} = authData;
|
|
49
|
+
callData, sourceCode, args, fee, gasLimit, gasPrice,
|
|
50
|
+
} = typeof authData === 'function' ? await authData(tx) : authData;
|
|
68
51
|
|
|
69
52
|
const authCallData = callData ?? await (async () => {
|
|
70
53
|
if (this.#authFun == null) {
|
|
@@ -85,12 +68,14 @@ export default class AccountGeneralized extends AccountBase {
|
|
|
85
68
|
return contract._calldata.encode(contract._name, this.#authFun, args);
|
|
86
69
|
})();
|
|
87
70
|
|
|
88
|
-
const gaMetaTx = await
|
|
89
|
-
|
|
71
|
+
const gaMetaTx = await buildTxAsync({
|
|
72
|
+
tag: Tag.GaMetaTx,
|
|
73
|
+
tx: { tag: Tag.SignedTx, encodedTx: decode(tx), signatures: [] },
|
|
90
74
|
gaId: this.address,
|
|
91
75
|
authData: authCallData,
|
|
76
|
+
fee,
|
|
92
77
|
gasLimit,
|
|
93
|
-
|
|
78
|
+
gasPrice,
|
|
94
79
|
onNode,
|
|
95
80
|
});
|
|
96
81
|
return buildTx({ tag: Tag.SignedTx, encodedTx: decode(gaMetaTx), signatures: [] });
|
package/src/account/Memory.ts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2022 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
1
|
import AccountBase from './Base';
|
|
18
2
|
import {
|
|
19
3
|
generateKeyPairFromSecret, sign, generateKeyPair, hash, messageToHash,
|
|
@@ -28,6 +12,17 @@ import { Tag } from '../tx/builder/constants';
|
|
|
28
12
|
|
|
29
13
|
const secretKeys = new WeakMap();
|
|
30
14
|
|
|
15
|
+
export function getBufferToSign(
|
|
16
|
+
transaction: Encoded.Transaction,
|
|
17
|
+
networkId: string,
|
|
18
|
+
innerTx: boolean,
|
|
19
|
+
): Uint8Array {
|
|
20
|
+
const prefixes = [networkId];
|
|
21
|
+
if (innerTx) prefixes.push('inner_tx');
|
|
22
|
+
const rlpBinaryTx = decode(transaction);
|
|
23
|
+
return concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
|
|
24
|
+
}
|
|
25
|
+
|
|
31
26
|
/**
|
|
32
27
|
* In-memory account class
|
|
33
28
|
*/
|
|
@@ -63,16 +58,14 @@ export default class AccountMemory extends AccountBase {
|
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
override async signTransaction(
|
|
66
|
-
|
|
61
|
+
transaction: Encoded.Transaction,
|
|
67
62
|
{ innerTx, networkId, ...options }: { innerTx?: boolean; networkId?: string } = {},
|
|
68
63
|
): Promise<Encoded.Transaction> {
|
|
69
64
|
if (networkId == null) {
|
|
70
65
|
throw new ArgumentError('networkId', 'provided', networkId);
|
|
71
66
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const rlpBinaryTx = decode(tx);
|
|
75
|
-
const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);
|
|
67
|
+
const rlpBinaryTx = decode(transaction);
|
|
68
|
+
const txWithNetworkId = getBufferToSign(transaction, networkId, innerTx === true);
|
|
76
69
|
|
|
77
70
|
const signatures = [await this.sign(txWithNetworkId, options)];
|
|
78
71
|
return buildTx({ tag: Tag.SignedTx, encodedTx: rlpBinaryTx, signatures });
|