@aeternity/aepp-sdk 13.0.0-alpha.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/aesophia_cli +0 -0
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +1833 -1543
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +5 -4
- package/es/AeSdkAepp.mjs +13 -17
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +11 -12
- package/es/AeSdkMethods.mjs +6 -8
- package/es/AeSdkMethods.mjs.map +1 -1
- package/es/AeSdkWallet.mjs +1 -1
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +5 -1
- package/es/Node.mjs +11 -5
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +11 -6
- package/es/account/Base.mjs +0 -17
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.mjs +12 -25
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.mjs.map +1 -1
- package/es/account/LedgerFactory.mjs.map +1 -1
- package/es/account/Memory.d.ts +2 -1
- package/es/account/Memory.mjs +9 -21
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +12 -14
- package/es/aens.mjs +17 -31
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +0 -16
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -16
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs +0 -17
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -5
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -16
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.d.ts +1 -1
- package/es/apis/compiler/compiler.mjs +4 -20
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +3 -2
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +1 -1
- package/es/apis/compiler/models/mappers.mjs +19 -2
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +15 -15
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.d.ts +1 -1
- package/es/apis/node/models/mappers.mjs +2 -1
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/parameters.d.ts +2 -2
- package/es/apis/node/models/parameters.mjs +2 -2
- package/es/apis/node/models/parameters.mjs.map +1 -1
- package/es/apis/node/node.mjs +3 -19
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +8 -8
- package/es/chain.mjs +20 -23
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +25 -12
- package/es/channel/Base.mjs +23 -26
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/Contract.mjs +8 -21
- package/es/channel/Contract.mjs.map +1 -1
- package/es/channel/Spend.d.ts +4 -2
- package/es/channel/Spend.mjs +0 -16
- package/es/channel/Spend.mjs.map +1 -1
- package/es/channel/handlers.mjs +6 -18
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +19 -2
- package/es/channel/internal.mjs +19 -19
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +30 -85
- package/es/contract/Contract.mjs +197 -215
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +10 -14
- package/es/contract/compiler/Base.mjs.map +1 -1
- package/es/contract/compiler/Cli.mjs +5 -11
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/contract/compiler/Http.mjs +6 -30
- package/es/contract/compiler/Http.mjs.map +1 -1
- package/es/contract/compiler/HttpNode.mjs.map +1 -1
- package/es/contract/compiler/getFileSystem.mjs.map +1 -1
- package/es/contract/delegation-signature.d.ts +43 -0
- package/es/contract/delegation-signature.mjs +45 -0
- package/es/contract/delegation-signature.mjs.map +1 -0
- package/es/contract/ga.d.ts +23 -7
- package/es/contract/ga.mjs +52 -27
- package/es/contract/ga.mjs.map +1 -1
- package/es/index-browser.d.ts +5 -4
- package/es/index-browser.mjs +7 -21
- package/es/index-browser.mjs.map +1 -1
- package/es/oracle.d.ts +12 -17
- package/es/oracle.mjs +28 -48
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +19 -27
- package/es/spend.mjs +20 -43
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/SchemaTypes.d.ts +37 -0
- package/es/tx/builder/SchemaTypes.mjs +2 -0
- package/es/tx/builder/SchemaTypes.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +4 -2
- package/es/tx/builder/constants.mjs +2 -0
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/abi-version.d.ts +11 -2
- package/es/tx/builder/field-types/abi-version.mjs +24 -4
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
- package/es/tx/builder/field-types/address.mjs.map +1 -1
- package/es/tx/builder/field-types/array.d.ts +1 -1
- package/es/tx/builder/field-types/array.mjs.map +1 -1
- package/es/tx/builder/field-types/boolean.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/es/tx/builder/field-types/coin-amount.mjs +4 -5
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +22 -3
- package/es/tx/builder/field-types/ct-version.mjs +32 -4
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
- package/es/tx/builder/field-types/deposit.d.ts +2 -1
- package/es/tx/builder/field-types/deposit.mjs +3 -2
- package/es/tx/builder/field-types/deposit.mjs.map +1 -1
- package/es/tx/builder/field-types/encoded.d.ts +1 -1
- package/es/tx/builder/field-types/encoded.mjs.map +1 -1
- package/es/tx/builder/field-types/entry.mjs +3 -0
- package/es/tx/builder/field-types/entry.mjs.map +1 -1
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +3 -1
- package/es/tx/builder/field-types/fee.mjs +5 -1
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/field.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/es/tx/builder/field-types/gas-limit.mjs +4 -2
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +3 -1
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +52 -13
- package/es/tx/builder/field-types/index.mjs +10 -2
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/map.d.ts +13 -0
- package/es/tx/builder/field-types/map.mjs +49 -0
- package/es/tx/builder/field-types/map.mjs.map +1 -0
- package/es/tx/builder/field-types/mptree.d.ts +7 -2
- package/es/tx/builder/field-types/mptree.mjs +5 -7
- package/es/tx/builder/field-types/mptree.mjs.map +1 -1
- package/es/tx/builder/field-types/name-fee.d.ts +1 -1
- package/es/tx/builder/field-types/name-fee.mjs +2 -2
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/name-id.mjs.map +1 -1
- package/es/tx/builder/field-types/name.mjs.map +1 -1
- package/es/tx/builder/field-types/nonce.d.ts +14 -0
- package/es/tx/builder/field-types/nonce.mjs +29 -0
- package/es/tx/builder/field-types/nonce.mjs.map +1 -0
- package/es/tx/builder/field-types/pointers.mjs.map +1 -1
- package/es/tx/builder/field-types/raw.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/es/tx/builder/field-types/short-u-int-const.mjs +12 -8
- package/es/tx/builder/field-types/short-u-int-const.mjs.map +1 -1
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/string.mjs.map +1 -1
- package/es/tx/builder/field-types/ttl.d.ts +11 -0
- package/es/tx/builder/field-types/ttl.mjs +21 -0
- package/es/tx/builder/field-types/ttl.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/wrapped.d.ts +14 -0
- package/es/tx/builder/field-types/wrapped.mjs +22 -0
- package/es/tx/builder/field-types/wrapped.mjs.map +1 -0
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +20 -20
- package/es/tx/builder/index.mjs +54 -64
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +2735 -2865
- package/es/tx/builder/schema.generated.d.ts +2011 -0
- package/es/tx/builder/schema.generated.mjs +2 -0
- package/es/tx/builder/schema.generated.mjs.map +1 -0
- package/es/tx/builder/schema.mjs +459 -155
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/execution-cost.d.ts +35 -0
- package/es/tx/execution-cost.mjs +123 -0
- package/es/tx/execution-cost.mjs.map +1 -0
- package/es/tx/transaction-signer.d.ts +6 -0
- package/es/tx/transaction-signer.mjs +27 -0
- package/es/tx/transaction-signer.mjs.map +1 -0
- package/es/tx/validator.mjs +60 -109
- package/es/tx/validator.mjs.map +1 -1
- package/es/utils/amount-formatter.mjs +0 -16
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +3 -2
- package/es/utils/autorest.mjs +43 -11
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bytes.mjs +0 -16
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.mjs +0 -16
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +14 -31
- package/es/utils/errors.mjs +3 -33
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/other.d.ts +1 -1
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.mjs +0 -17
- package/es/utils/string.mjs.map +1 -1
- package/package.json +34 -30
- package/src/AeSdkAepp.ts +16 -14
- package/src/AeSdkMethods.ts +11 -16
- package/src/AeSdkWallet.ts +1 -1
- package/src/Node.ts +17 -6
- package/src/account/Base.ts +11 -22
- package/src/account/Generalized.ts +9 -24
- package/src/account/Memory.ts +14 -21
- package/src/aens.ts +31 -47
- package/src/aepp-wallet-communication/connection/Browser.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +0 -17
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +0 -17
- package/src/aepp-wallet-communication/connection-proxy.ts +0 -17
- package/src/aepp-wallet-communication/rpc/types.ts +7 -2
- package/src/aepp-wallet-communication/wallet-detector.ts +0 -17
- package/src/apis/compiler/compiler.ts +3 -27
- package/src/apis/compiler/models/index.ts +3 -2
- package/src/apis/compiler/models/mappers.ts +15 -2
- package/src/apis/node/models/index.ts +16 -15
- package/src/apis/node/models/mappers.ts +2 -1
- package/src/apis/node/models/parameters.ts +2 -2
- package/src/apis/node/node.ts +3 -27
- package/src/chain.ts +29 -28
- package/src/channel/Base.ts +33 -33
- package/src/channel/Contract.ts +8 -23
- package/src/channel/Spend.ts +2 -17
- package/src/channel/handlers.ts +5 -18
- package/src/channel/internal.ts +40 -22
- package/src/contract/Contract.ts +161 -170
- package/src/contract/compiler/Base.ts +10 -14
- package/src/contract/compiler/Cli.ts +5 -11
- package/src/contract/compiler/Http.ts +6 -25
- package/src/contract/delegation-signature.ts +56 -0
- package/src/contract/ga.ts +53 -32
- package/src/index-browser.ts +15 -21
- package/src/oracle.ts +46 -56
- package/src/spend.ts +33 -67
- package/src/tx/builder/SchemaTypes.ts +79 -0
- package/src/tx/builder/constants.ts +2 -0
- package/src/tx/builder/field-types/abi-version.ts +29 -6
- package/src/tx/builder/field-types/array.ts +1 -1
- package/src/tx/builder/field-types/coin-amount.ts +6 -4
- package/src/tx/builder/field-types/ct-version.ts +37 -4
- package/src/tx/builder/field-types/deposit.ts +3 -1
- package/src/tx/builder/field-types/encoded.ts +1 -1
- package/src/tx/builder/field-types/entry.ts +8 -3
- package/src/tx/builder/field-types/fee.ts +6 -4
- package/src/tx/builder/field-types/gas-limit.ts +2 -2
- package/src/tx/builder/field-types/index.ts +15 -1
- package/src/tx/builder/field-types/map.ts +45 -0
- package/src/tx/builder/field-types/mptree.ts +4 -3
- package/src/tx/builder/field-types/name-fee.ts +2 -1
- package/src/tx/builder/field-types/nonce.ts +40 -0
- package/src/tx/builder/field-types/short-u-int-const.ts +18 -8
- package/src/tx/builder/field-types/ttl.ts +24 -0
- package/src/tx/builder/field-types/wrapped.ts +32 -0
- package/src/tx/builder/index.ts +57 -71
- package/src/tx/builder/schema.generated.ts +2013 -0
- package/src/tx/builder/schema.ts +544 -624
- package/src/tx/execution-cost.ts +146 -0
- package/src/tx/transaction-signer.ts +27 -0
- package/src/tx/validator.ts +60 -91
- package/src/utils/amount-formatter.ts +0 -16
- package/src/utils/autorest.ts +52 -11
- package/src/utils/bytes.ts +0 -16
- package/src/utils/crypto.ts +0 -16
- package/src/utils/errors.ts +16 -45
- package/src/utils/string.ts +0 -17
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +5 -4
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.2/Node.d.ts +5 -1
- package/types-legacy/ts4.2/account/Base.d.ts +11 -6
- package/types-legacy/ts4.2/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.2/aens.d.ts +12 -14
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.2/chain.d.ts +8 -8
- package/types-legacy/ts4.2/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.2/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.2/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.2/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +10 -14
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.2/index-browser.d.ts +5 -4
- package/types-legacy/ts4.2/oracle.d.ts +12 -17
- package/types-legacy/ts4.2/spend.d.ts +19 -27
- package/types-legacy/ts4.2/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.2/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.2/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.2/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.2/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.2/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.2/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.2/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.2/utils/other.d.ts +1 -1
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +5 -4
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +11 -12
- package/types-legacy/ts4.5/Node.d.ts +5 -1
- package/types-legacy/ts4.5/account/Base.d.ts +11 -6
- package/types-legacy/ts4.5/account/Memory.d.ts +2 -1
- package/types-legacy/ts4.5/aens.d.ts +12 -14
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +6 -2
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +1 -1
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +3 -2
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +15 -15
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +1 -1
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.5/chain.d.ts +8 -8
- package/types-legacy/ts4.5/channel/Base.d.ts +25 -12
- package/types-legacy/ts4.5/channel/Spend.d.ts +4 -2
- package/types-legacy/ts4.5/channel/internal.d.ts +22 -2
- package/types-legacy/ts4.5/contract/Contract.d.ts +29 -84
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +10 -14
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +43 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +23 -7
- package/types-legacy/ts4.5/index-browser.d.ts +5 -4
- package/types-legacy/ts4.5/oracle.d.ts +12 -17
- package/types-legacy/ts4.5/spend.d.ts +19 -27
- package/types-legacy/ts4.5/tx/builder/SchemaTypes.d.ts +37 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/abi-version.d.ts +11 -2
- package/types-legacy/ts4.5/tx/builder/field-types/array.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +3 -4
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +33 -3
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +2 -1
- package/types-legacy/ts4.5/tx/builder/field-types/encoded.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +3 -2
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +3 -1
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +52 -13
- package/types-legacy/ts4.5/tx/builder/field-types/map.d.ts +13 -0
- package/types-legacy/ts4.5/tx/builder/field-types/mptree.d.ts +7 -2
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/nonce.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int-const.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/wrapped.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +23 -20
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +2962 -4629
- package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +2011 -0
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +35 -0
- package/types-legacy/ts4.5/tx/transaction-signer.d.ts +6 -0
- package/types-legacy/ts4.5/utils/autorest.d.ts +3 -2
- package/types-legacy/ts4.5/utils/errors.d.ts +14 -31
- package/types-legacy/ts4.5/utils/other.d.ts +1 -1
- package/es/tx/index.d.ts +0 -19
- package/es/tx/index.mjs +0 -115
- package/es/tx/index.mjs.map +0 -1
- package/src/apis/compiler/code-model-v4.yaml +0 -2442
- package/src/apis/node/code-model-v4.yaml +0 -10080
- package/src/tx/index.ts +0 -129
- package/types-legacy/ts4.2/tx/index.d.ts +0 -19
- package/types-legacy/ts4.5/tx/index.d.ts +0 -19
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { w3cwebsocket as W3CWebSocket } from 'websocket';
|
|
4
|
-
import {
|
|
4
|
+
import { Tag } from '../tx/builder/constants';
|
|
5
|
+
import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm, ChannelMessage, ChannelEvents } from './internal';
|
|
5
6
|
import { Encoded } from '../utils/encoder';
|
|
6
|
-
|
|
7
|
+
import { TxUnpacked } from '../tx/builder/schema.generated';
|
|
7
8
|
/**
|
|
8
9
|
* Channel
|
|
9
10
|
* @example
|
|
@@ -31,14 +32,14 @@ export default class Channel {
|
|
|
31
32
|
_nextRpcMessageId: number;
|
|
32
33
|
_rpcCallbacks: Map<number, (message: object) => void>;
|
|
33
34
|
_fsmId?: Encoded.Bytearray;
|
|
34
|
-
_messageQueue:
|
|
35
|
+
_messageQueue: ChannelMessage[];
|
|
35
36
|
_isMessageQueueLocked: boolean;
|
|
36
37
|
_actionQueue: ChannelAction[];
|
|
37
38
|
_isActionQueueLocked: boolean;
|
|
38
39
|
_status: ChannelStatus;
|
|
39
40
|
_fsm: ChannelFsm;
|
|
40
41
|
_websocket: W3CWebSocket;
|
|
41
|
-
_state
|
|
42
|
+
_state: Encoded.Transaction | '';
|
|
42
43
|
_options: ChannelOptions;
|
|
43
44
|
_channelId?: Encoded.Channel;
|
|
44
45
|
/**
|
|
@@ -99,24 +100,29 @@ export default class Channel {
|
|
|
99
100
|
* Possible events:
|
|
100
101
|
*
|
|
101
102
|
* - "error"
|
|
103
|
+
* - "stateChanged"
|
|
104
|
+
* - "statusChanged"
|
|
105
|
+
* - "message"
|
|
106
|
+
* - "peerDisconnected"
|
|
102
107
|
* - "onChainTx"
|
|
103
108
|
* - "ownWithdrawLocked"
|
|
104
109
|
* - "withdrawLocked"
|
|
105
110
|
* - "ownDepositLocked"
|
|
106
111
|
* - "depositLocked"
|
|
112
|
+
* - "channelReestablished"
|
|
113
|
+
* - "newContract"
|
|
107
114
|
*
|
|
108
|
-
* TODO: the event list looks outdated
|
|
109
115
|
*
|
|
110
116
|
* @param eventName - Event name
|
|
111
117
|
* @param callback - Callback function
|
|
112
118
|
*/
|
|
113
|
-
on(eventName:
|
|
119
|
+
on<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void;
|
|
114
120
|
/**
|
|
115
121
|
* Remove event listener function
|
|
116
122
|
* @param eventName - Event name
|
|
117
123
|
* @param callback - Callback function
|
|
118
124
|
*/
|
|
119
|
-
off(eventName:
|
|
125
|
+
off<E extends keyof ChannelEvents>(eventName: E, callback: ChannelEvents[E]): void;
|
|
120
126
|
/**
|
|
121
127
|
* Close the connection
|
|
122
128
|
*/
|
|
@@ -129,10 +135,18 @@ export default class Channel {
|
|
|
129
135
|
* Get current state
|
|
130
136
|
*/
|
|
131
137
|
state(): Promise<{
|
|
132
|
-
calls:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
calls: TxUnpacked & {
|
|
139
|
+
tag: Tag.CallsMtree;
|
|
140
|
+
};
|
|
141
|
+
halfSignedTx?: TxUnpacked & {
|
|
142
|
+
tag: Tag.SignedTx;
|
|
143
|
+
};
|
|
144
|
+
signedTx?: TxUnpacked & {
|
|
145
|
+
tag: Tag.SignedTx;
|
|
146
|
+
};
|
|
147
|
+
trees: TxUnpacked & {
|
|
148
|
+
tag: Tag.StateTrees;
|
|
149
|
+
};
|
|
136
150
|
}>;
|
|
137
151
|
/**
|
|
138
152
|
* Get current round
|
|
@@ -196,4 +210,3 @@ export default class Channel {
|
|
|
196
210
|
shutdown(sign: SignTx): Promise<Encoded.Transaction>;
|
|
197
211
|
static reconnect(options: ChannelOptions, txParams: any): Promise<Channel>;
|
|
198
212
|
}
|
|
199
|
-
export {};
|
|
@@ -2,8 +2,8 @@ import BigNumber from 'bignumber.js';
|
|
|
2
2
|
import { SignTx, ChannelState } from './internal';
|
|
3
3
|
import { Encoded } from '../utils/encoder';
|
|
4
4
|
import Channel from './Base';
|
|
5
|
-
import { unpackTx } from '../tx/builder';
|
|
6
5
|
import { Tag } from '../tx/builder/constants';
|
|
6
|
+
import { TxUnpacked } from '../tx/builder/schema.generated';
|
|
7
7
|
export default class ChannelSpend extends Channel {
|
|
8
8
|
/**
|
|
9
9
|
* Trigger a transfer update
|
|
@@ -63,7 +63,9 @@ export default class ChannelSpend extends Channel {
|
|
|
63
63
|
poi({ accounts, contracts }: {
|
|
64
64
|
accounts: Encoded.AccountAddress[];
|
|
65
65
|
contracts?: Encoded.ContractAddress[];
|
|
66
|
-
}): Promise<
|
|
66
|
+
}): Promise<TxUnpacked & {
|
|
67
|
+
tag: Tag.TreesPoi;
|
|
68
|
+
}>;
|
|
67
69
|
/**
|
|
68
70
|
* Get balances
|
|
69
71
|
*
|
|
@@ -2,6 +2,23 @@ import BigNumber from 'bignumber.js';
|
|
|
2
2
|
import type Channel from './Base';
|
|
3
3
|
import { Encoded } from '../utils/encoder';
|
|
4
4
|
import { BaseError } from '../utils/errors';
|
|
5
|
+
export interface ChannelEvents {
|
|
6
|
+
statusChanged: (status: ChannelStatus) => void;
|
|
7
|
+
stateChanged: (tx: Encoded.Transaction | '') => void;
|
|
8
|
+
depositLocked: () => void;
|
|
9
|
+
ownDepositLocked: () => void;
|
|
10
|
+
withdrawLocked: () => void;
|
|
11
|
+
ownWithdrawLocked: () => void;
|
|
12
|
+
peerDisconnected: () => void;
|
|
13
|
+
channelReestablished: () => void;
|
|
14
|
+
error: (error: Error) => void;
|
|
15
|
+
onChainTx: (tx: Encoded.Transaction, details: {
|
|
16
|
+
info: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
message: (message: string | Object) => void;
|
|
20
|
+
newContract: (contractAddress: Encoded.ContractAddress) => void;
|
|
21
|
+
}
|
|
5
22
|
export interface ChannelAction {
|
|
6
23
|
guard: (channel: Channel, state?: ChannelFsm) => boolean;
|
|
7
24
|
action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;
|
|
@@ -92,10 +109,13 @@ interface ChannelMessageError {
|
|
|
92
109
|
];
|
|
93
110
|
request: ChannelMessage;
|
|
94
111
|
}
|
|
95
|
-
export declare function emit(channel: Channel, ...args:
|
|
112
|
+
export declare function emit<E extends keyof ChannelEvents>(channel: Channel, ...args: [
|
|
113
|
+
E,
|
|
114
|
+
...Parameters<ChannelEvents[E]>
|
|
115
|
+
]): void;
|
|
96
116
|
export type ChannelStatus = 'connecting' | 'connected' | 'accepted' | 'halfSigned' | 'signed' | 'open' | 'closing' | 'closed' | 'died' | 'disconnected';
|
|
97
117
|
export declare function changeStatus(channel: Channel, newStatus: ChannelStatus): void;
|
|
98
|
-
export declare function changeState(channel: Channel, newState: Encoded.Transaction): void;
|
|
118
|
+
export declare function changeState(channel: Channel, newState: Encoded.Transaction | ''): void;
|
|
99
119
|
export declare function notify(channel: Channel, method: string, params?: object): void;
|
|
100
120
|
export declare function enqueueAction(channel: Channel, guard: ChannelAction['guard'], action: () => {
|
|
101
121
|
handler: ChannelHandler;
|
|
@@ -7,21 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Encoder as Calldata } from '@aeternity/aepp-calldata';
|
|
9
9
|
import { Tag, AensName } from '../tx/builder/constants';
|
|
10
|
-
import {
|
|
11
|
-
import { BuildTxOptions } from '../tx';
|
|
12
|
-
import { send, SendOptions } from '../spend';
|
|
10
|
+
import { BuildTxOptions } from '../tx/builder';
|
|
13
11
|
import { Encoded } from '../utils/encoder';
|
|
14
|
-
import { ContractCallObject as NodeContractCallObject,
|
|
12
|
+
import { ContractCallObject as NodeContractCallObject, Event as NodeEvent } from '../apis/node';
|
|
15
13
|
import CompilerBase, { Aci } from './compiler/Base';
|
|
16
14
|
import Node, { TransformNodeType } from '../Node';
|
|
17
|
-
import { txDryRun } from '../chain';
|
|
15
|
+
import { txDryRun, sendTransaction, SendTransactionOptions } from '../chain';
|
|
18
16
|
import AccountBase from '../account/Base';
|
|
19
|
-
|
|
17
|
+
import { TxUnpacked } from '../tx/builder/schema.generated';
|
|
20
18
|
interface Event extends NodeEvent {
|
|
21
19
|
address: Encoded.ContractAddress;
|
|
22
20
|
data: Encoded.ContractBytearray;
|
|
23
21
|
}
|
|
24
|
-
export interface ContractCallObject extends NodeContractCallObject {
|
|
22
|
+
export interface ContractCallObject extends TransformNodeType<NodeContractCallObject> {
|
|
25
23
|
returnValue: Encoded.ContractBytearray;
|
|
26
24
|
log: Event[];
|
|
27
25
|
}
|
|
@@ -33,11 +31,13 @@ interface DecodedEvent {
|
|
|
33
31
|
address: Encoded.ContractAddress;
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
|
-
type TxData = Awaited<ReturnType<typeof
|
|
34
|
+
type TxData = Awaited<ReturnType<typeof sendTransaction>>;
|
|
37
35
|
interface SendAndProcessReturnType {
|
|
38
|
-
result?:
|
|
36
|
+
result?: ContractCallObject;
|
|
39
37
|
hash: TxData['hash'];
|
|
40
|
-
tx:
|
|
38
|
+
tx: TxUnpacked & {
|
|
39
|
+
tag: Tag.ContractCallTx | Tag.ContractCreateTx;
|
|
40
|
+
};
|
|
41
41
|
txData: TxData;
|
|
42
42
|
rawTx: Encoded.Transaction;
|
|
43
43
|
}
|
|
@@ -45,15 +45,13 @@ export interface ContractMethodsBase {
|
|
|
45
45
|
[key: string]: (...args: any[]) => any;
|
|
46
46
|
}
|
|
47
47
|
type MethodsToContractApi<M extends ContractMethodsBase> = {
|
|
48
|
-
[Name in keyof M]: M[Name] extends (...args: infer Args) =>
|
|
48
|
+
[Name in keyof M]: M[Name] extends (...args: infer Args) => any ? (...args: [
|
|
49
49
|
...Args,
|
|
50
50
|
...[
|
|
51
51
|
] | [
|
|
52
52
|
Name extends 'init' ? Parameters<Contract<M>['$deploy']>[1] : Parameters<Contract<M>['$call']>[2]
|
|
53
53
|
]
|
|
54
|
-
]) =>
|
|
55
|
-
decodedResult?: Ret;
|
|
56
|
-
}> : never;
|
|
54
|
+
]) => ReturnType<Contract<M>['$call']> : never;
|
|
57
55
|
};
|
|
58
56
|
type ContractWithMethods<M extends ContractMethodsBase> = Contract<M> & MethodsToContractApi<M>;
|
|
59
57
|
type MethodNames<M extends ContractMethodsBase> = keyof M & string | 'init';
|
|
@@ -61,6 +59,15 @@ type MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>>
|
|
|
61
59
|
init: any;
|
|
62
60
|
} ? Parameters<M['init']> : [
|
|
63
61
|
] : Parameters<M[Fn]>;
|
|
62
|
+
interface GetContractNameByEventOptions {
|
|
63
|
+
contractAddressToName?: {
|
|
64
|
+
[key: string]: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
interface GetCallResultByHashReturnType<M extends ContractMethodsBase, Fn extends MethodNames<M>> {
|
|
68
|
+
decodedResult: ReturnType<M[Fn]>;
|
|
69
|
+
decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
|
|
70
|
+
}
|
|
64
71
|
/**
|
|
65
72
|
* Generate contract ACI object with predefined js methods for contract usage - can be used for
|
|
66
73
|
* creating a reference to already deployed contracts
|
|
@@ -79,56 +86,16 @@ type MethodParameters<M extends ContractMethodsBase, Fn extends MethodNames<M>>
|
|
|
79
86
|
* stateful or not
|
|
80
87
|
*/
|
|
81
88
|
declare class Contract<M extends ContractMethodsBase> {
|
|
82
|
-
|
|
83
|
-
* Helper to generate a signature to delegate
|
|
84
|
-
* - pre-claim/claim/transfer/revoke of a name to a contract.
|
|
85
|
-
* - register/extend/respond of an Oracle to a contract.
|
|
86
|
-
* @category contract
|
|
87
|
-
* @param ids - The list of id's to prepend
|
|
88
|
-
* @param _options - Options
|
|
89
|
-
* @param _options.omitAddress - Prepend delegation signature with an account address
|
|
90
|
-
* @param _options.onAccount - Account to use
|
|
91
|
-
* @returns Signature
|
|
92
|
-
* @example
|
|
93
|
-
* ```js
|
|
94
|
-
* const aeSdk = new AeSdk({ ... })
|
|
95
|
-
* const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })
|
|
96
|
-
* const aensName = 'example.chain'
|
|
97
|
-
* const onAccount = new MemoryAccount(...) // Sign with a specific account
|
|
98
|
-
* // Preclaim signature
|
|
99
|
-
* const preclaimSig = await contract.$createDelegationSignature([], { onAccount })
|
|
100
|
-
* // Claim, transfer and revoke signature
|
|
101
|
-
* const aensDelegationSig = await contract
|
|
102
|
-
* .$createDelegationSignature([aensName], { onAccount })
|
|
103
|
-
* ```
|
|
104
|
-
* @example
|
|
105
|
-
* ```js
|
|
106
|
-
* const aeSdk = new AeSdk({ ... })
|
|
107
|
-
* const contract = await aeSdk.initializeContract({ address: 'ct_asd2ks...' })
|
|
108
|
-
* const oracleQueryId = 'oq_...'
|
|
109
|
-
* const onAccount = new MemoryAccount(...) // Sign with a specific account
|
|
110
|
-
* // Oracle register and extend signature
|
|
111
|
-
* const oracleDelegationSig = await contract.$createDelegationSignature([], { onAccount })
|
|
112
|
-
* // Oracle respond signature
|
|
113
|
-
* const respondSig = await contract
|
|
114
|
-
* .$createDelegationSignature([oracleQueryId], { onAccount, omitAddress: true })
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
$createDelegationSignature(ids?: Array<Encoded.Any | AensName>, _options?: {
|
|
118
|
-
omitAddress?: boolean;
|
|
119
|
-
onAccount?: AccountBase;
|
|
120
|
-
}): Promise<Uint8Array>;
|
|
89
|
+
#private;
|
|
121
90
|
/**
|
|
122
91
|
* Compile contract
|
|
123
92
|
* @returns bytecode
|
|
124
93
|
*/
|
|
125
94
|
$compile(): Promise<Encoded.ContractBytearray>;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
protected _sendAndProcess(tx: Encoded.Transaction, options: SendOptions): Promise<SendAndProcessReturnType>;
|
|
131
|
-
_estimateGas<Fn extends MethodNames<M>>(name: Fn, params: MethodParameters<M, Fn>, options?: object): Promise<number>;
|
|
95
|
+
$getCallResultByTxHash<Fn extends MethodNames<M>>(hash: Encoded.TxHash, fnName: Fn, options?: Parameters<Contract<M>['$decodeEvents']>[1]): Promise<GetCallResultByHashReturnType<M, Fn> & {
|
|
96
|
+
result: ContractCallObject;
|
|
97
|
+
}>;
|
|
98
|
+
_estimateGas<Fn extends MethodNames<M>>(name: Fn, params: MethodParameters<M, Fn>, options?: Omit<Parameters<Contract<M>['$call']>[2], 'callStatic'>): Promise<number>;
|
|
132
99
|
/**
|
|
133
100
|
* Deploy contract
|
|
134
101
|
* @param params - Contract init function arguments array
|
|
@@ -141,12 +108,6 @@ declare class Contract<M extends ContractMethodsBase> {
|
|
|
141
108
|
address?: Encoded.ContractAddress;
|
|
142
109
|
decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
|
|
143
110
|
}>;
|
|
144
|
-
/**
|
|
145
|
-
* Get function schema from contract ACI object
|
|
146
|
-
* @param name - Function name
|
|
147
|
-
* @returns function ACI
|
|
148
|
-
*/
|
|
149
|
-
protected _getFunctionACI(name: string): Partial<FunctionAci>;
|
|
150
111
|
/**
|
|
151
112
|
* Call contract function
|
|
152
113
|
* @param fn - Function name
|
|
@@ -154,27 +115,11 @@ declare class Contract<M extends ContractMethodsBase> {
|
|
|
154
115
|
* @param options - Array of function arguments
|
|
155
116
|
* @returns CallResult
|
|
156
117
|
*/
|
|
157
|
-
$call<Fn extends MethodNames<M>>(fn: Fn, params: MethodParameters<M, Fn>, options?: Partial<BuildTxOptions<Tag.ContractCallTx, 'callerId' | 'contractId' | 'callData'>> & Parameters<Contract<M>['$decodeEvents']>[1] & Omit<
|
|
118
|
+
$call<Fn extends MethodNames<M>>(fn: Fn, params: MethodParameters<M, Fn>, options?: Partial<BuildTxOptions<Tag.ContractCallTx, 'callerId' | 'contractId' | 'callData'>> & Parameters<Contract<M>['$decodeEvents']>[1] & Omit<SendTransactionOptions, 'onAccount' | 'onNode'> & Omit<Parameters<typeof txDryRun>[2], 'onNode'> & {
|
|
158
119
|
onAccount?: AccountBase;
|
|
159
120
|
onNode?: Node;
|
|
160
121
|
callStatic?: boolean;
|
|
161
|
-
}): Promise<
|
|
162
|
-
decodedResult?: any;
|
|
163
|
-
decodedEvents?: ReturnType<Contract<M>['$decodeEvents']>;
|
|
164
|
-
} & SendAndProcessReturnType>;
|
|
165
|
-
/**
|
|
166
|
-
* @param ctAddress - Contract address that emitted event
|
|
167
|
-
* @param nameHash - Hash of emitted event name
|
|
168
|
-
* @param options - Options
|
|
169
|
-
* @returns Contract name
|
|
170
|
-
* @throws {@link MissingEventDefinitionError}
|
|
171
|
-
* @throws {@link AmbiguousEventDefinitionError}
|
|
172
|
-
*/
|
|
173
|
-
protected _getContractNameByEvent(ctAddress: Encoded.ContractAddress, nameHash: BigInt, { contractAddressToName }: {
|
|
174
|
-
contractAddressToName?: {
|
|
175
|
-
[key: string]: string;
|
|
176
|
-
};
|
|
177
|
-
}): string;
|
|
122
|
+
}): Promise<SendAndProcessReturnType & Partial<GetCallResultByHashReturnType<M, Fn>>>;
|
|
178
123
|
/**
|
|
179
124
|
* Decode Events
|
|
180
125
|
* @param events - Array of encoded events (callRes.result.log)
|
|
@@ -183,7 +128,7 @@ declare class Contract<M extends ContractMethodsBase> {
|
|
|
183
128
|
*/
|
|
184
129
|
$decodeEvents(events: Event[], { omitUnknown, ...opt }?: {
|
|
185
130
|
omitUnknown?: boolean;
|
|
186
|
-
} &
|
|
131
|
+
} & GetContractNameByEventOptions): DecodedEvent[];
|
|
187
132
|
static initialize<M extends ContractMethodsBase>({ onCompiler, onNode, bytecode, aci, address, sourceCodePath, sourceCode, fileSystem, validateBytecode, ...otherOptions }: Omit<ConstructorParameters<typeof Contract>[0], 'aci' | 'address'> & {
|
|
188
133
|
validateBytecode?: boolean;
|
|
189
134
|
aci?: Aci;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { Encoded } from '../../utils/encoder';
|
|
2
|
-
import { Aci as BaseAci } from '../../apis/compiler';
|
|
3
2
|
interface FunctionAci {
|
|
4
3
|
arguments: any[];
|
|
5
4
|
name: string;
|
|
6
5
|
payable: boolean;
|
|
7
|
-
returns:
|
|
6
|
+
returns: any;
|
|
8
7
|
stateful: boolean;
|
|
9
8
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
functions: FunctionAci[];
|
|
19
|
-
};
|
|
9
|
+
export type Aci = Array<{
|
|
10
|
+
contract?: {
|
|
11
|
+
name: string;
|
|
12
|
+
event?: any;
|
|
13
|
+
functions: FunctionAci[];
|
|
14
|
+
kind: string;
|
|
15
|
+
payable: boolean;
|
|
16
|
+
typedefs: any[];
|
|
20
17
|
};
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
}>;
|
|
23
19
|
/**
|
|
24
20
|
* A base class for all compiler implementations
|
|
25
21
|
*/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Encoded } from '../utils/encoder';
|
|
2
|
+
import { AensName } from '../tx/builder/constants';
|
|
3
|
+
import AccountBase from '../account/Base';
|
|
4
|
+
import Node from '../Node';
|
|
5
|
+
/**
|
|
6
|
+
* Helper to generate a signature to delegate
|
|
7
|
+
* - pre-claim/claim/transfer/revoke of a name to a contract.
|
|
8
|
+
* - register/extend/respond of an Oracle to a contract.
|
|
9
|
+
* @category contract
|
|
10
|
+
* @param contractAddress - Address of contract to delegate access
|
|
11
|
+
* @param ids - The list of id's to prepend
|
|
12
|
+
* @param options - Options
|
|
13
|
+
* @param options.omitAddress - Prepend delegation signature with an account address
|
|
14
|
+
* @param options.onAccount - Account to use
|
|
15
|
+
* @param options.onNode - Node to use
|
|
16
|
+
* @returns Signature
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* const aeSdk = new AeSdk({ ... })
|
|
20
|
+
* const contractAddress = 'ct_asd2ks...'
|
|
21
|
+
* const aensName = 'example.chain'
|
|
22
|
+
* const onAccount = new MemoryAccount(...) // Sign with a specific account
|
|
23
|
+
* // Preclaim signature
|
|
24
|
+
* const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })
|
|
25
|
+
* // Claim, transfer and revoke signature
|
|
26
|
+
* const aensDelegationSig = await aeSdk
|
|
27
|
+
* .createDelegationSignature(contractAddress, [aensName], { onAccount })
|
|
28
|
+
*
|
|
29
|
+
* const oracleQueryId = 'oq_...'
|
|
30
|
+
* const onAccount = new MemoryAccount(...) // Sign with a specific account
|
|
31
|
+
* // Oracle register and extend signature
|
|
32
|
+
* const oracleDelegationSig = await aeSdk
|
|
33
|
+
* .createDelegationSignature(contractAddress, [], { onAccount })
|
|
34
|
+
* // Oracle respond signature
|
|
35
|
+
* const respondSig = await aeSdk
|
|
36
|
+
* .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, options: {
|
|
40
|
+
omitAddress?: boolean;
|
|
41
|
+
onAccount: AccountBase;
|
|
42
|
+
onNode: Node;
|
|
43
|
+
}): Promise<Uint8Array>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
/**
|
|
2
3
|
* Generalized Account module - routines to use generalized account
|
|
3
4
|
*/
|
|
4
|
-
import { Tag } from '../tx/builder/constants';
|
|
5
|
-
import { BuildTxOptions } from '../tx';
|
|
5
|
+
import { Int, Tag } from '../tx/builder/constants';
|
|
6
|
+
import { BuildTxOptions } from '../tx/builder';
|
|
6
7
|
import { Encoded } from '../utils/encoder';
|
|
7
8
|
import AccountBase from '../account/Base';
|
|
8
9
|
import Contract from './Contract';
|
|
9
|
-
import { SendOptions } from '../spend';
|
|
10
10
|
import Node from '../Node';
|
|
11
|
+
import { SendTransactionOptions } from '../chain';
|
|
11
12
|
import CompilerBase from './compiler/Base';
|
|
12
13
|
/**
|
|
13
14
|
* Convert current account to GA
|
|
@@ -24,21 +25,36 @@ export declare function createGeneralizedAccount(authFnName: string, args: any[]
|
|
|
24
25
|
rawTx: Encoded.Transaction;
|
|
25
26
|
gaContractId: Encoded.ContractAddress;
|
|
26
27
|
}>>;
|
|
27
|
-
interface CreateGeneralizedAccountOptions extends BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,
|
|
28
|
+
interface CreateGeneralizedAccountOptions extends BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>, SendTransactionOptions, Pick<Parameters<typeof Contract.initialize>[0], 'bytecode' | 'aci' | 'sourceCodePath' | 'sourceCode' | 'fileSystem'> {
|
|
28
29
|
onAccount: AccountBase;
|
|
29
30
|
onCompiler: CompilerBase;
|
|
30
31
|
onNode: Node;
|
|
31
32
|
gasLimit?: number;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
* Build a transaction hash the same as `Auth.tx_hash`
|
|
35
|
+
* Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx payload
|
|
35
36
|
* @category contract
|
|
36
37
|
* @param transaction - tx-encoded transaction
|
|
37
38
|
* @param options - Options
|
|
39
|
+
* @param options.fee - GaMetaTx fee, required in Ceres
|
|
40
|
+
* @param options.gasPrice - GaMetaTx gasPrice, required in Ceres
|
|
38
41
|
* @param options.onNode - Node to use
|
|
39
42
|
* @returns Transaction hash
|
|
40
43
|
*/
|
|
41
|
-
export declare function buildAuthTxHash(transaction: Encoded.Transaction, { onNode }: {
|
|
44
|
+
export declare function buildAuthTxHash(transaction: Encoded.Transaction, { fee, gasPrice, onNode }: {
|
|
45
|
+
fee?: Int;
|
|
46
|
+
gasPrice?: Int;
|
|
42
47
|
onNode: Node;
|
|
43
|
-
}): Promise<
|
|
48
|
+
}): Promise<Buffer>;
|
|
49
|
+
/**
|
|
50
|
+
* Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx
|
|
51
|
+
* @category contract
|
|
52
|
+
* @param transaction - tx-encoded signed GaMeta transaction
|
|
53
|
+
* @param options - Options
|
|
54
|
+
* @param options.onNode - Node to use
|
|
55
|
+
* @returns Transaction hash
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildAuthTxHashByGaMetaTx(transaction: Encoded.Transaction, { onNode }: {
|
|
58
|
+
onNode: Node;
|
|
59
|
+
}): Promise<Buffer>;
|
|
44
60
|
export {};
|
|
@@ -2,14 +2,15 @@ export * from './chain';
|
|
|
2
2
|
export * from './utils/crypto';
|
|
3
3
|
export * from './utils/keystore';
|
|
4
4
|
export * from './utils/bytes';
|
|
5
|
-
export
|
|
6
|
-
export * from './tx/builder';
|
|
5
|
+
export { buildTx, buildTxAsync, buildTxHash, unpackTx, buildContractIdByContractTx, } from './tx/builder';
|
|
7
6
|
export * from './tx/builder/helpers';
|
|
8
7
|
export * from './tx/builder/constants';
|
|
9
|
-
export
|
|
8
|
+
export { ORACLE_TTL_TYPES, ORACLE_TTL, QUERY_TTL, RESPONSE_TTL, DRY_RUN_ACCOUNT, CallReturnType, } from './tx/builder/schema';
|
|
9
|
+
export { getExecutionCost, getExecutionCostBySignedTx, getExecutionCostUsingNode, } from './tx/execution-cost';
|
|
10
|
+
export { default as getTransactionSignerAddress } from './tx/transaction-signer';
|
|
10
11
|
export * from './utils/amount-formatter';
|
|
11
12
|
export * from './utils/hd-wallet';
|
|
12
|
-
export { encode, decode, Encoding } from './utils/encoder';
|
|
13
|
+
export { encode, decode, Encoding, Encoded, } from './utils/encoder';
|
|
13
14
|
export * from './aens';
|
|
14
15
|
export { default as Contract } from './contract/Contract';
|
|
15
16
|
export type { ContractMethodsBase } from './contract/Contract';
|
|
@@ -5,13 +5,11 @@
|
|
|
5
5
|
* https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol
|
|
6
6
|
* repository.
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import { send, SendOptions } from './spend';
|
|
8
|
+
import { BuildTxOptions } from './tx/builder';
|
|
10
9
|
import { ORACLE_TTL_TYPES } from './tx/builder/schema';
|
|
11
10
|
import { Tag } from './tx/builder/constants';
|
|
12
11
|
import { Encoded } from './utils/encoder';
|
|
13
|
-
import { _getPollInterval } from './chain';
|
|
14
|
-
import { BuildTxOptions } from './tx';
|
|
12
|
+
import { _getPollInterval, sendTransaction, SendTransactionOptions } from './chain';
|
|
15
13
|
import Node from './Node';
|
|
16
14
|
import AccountBase from './account/Base';
|
|
17
15
|
type OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];
|
|
@@ -25,7 +23,7 @@ type OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['orac
|
|
|
25
23
|
* @param options.onNode - Node to use
|
|
26
24
|
* @returns Callback to stop polling function
|
|
27
25
|
*/
|
|
28
|
-
export declare function pollForQueries(oracleId: Encoded.OracleAddress, onQuery: (
|
|
26
|
+
export declare function pollForQueries(oracleId: Encoded.OracleAddress, onQuery: (query: OracleQueries[number]) => void, { interval, onNode, ...options }: {
|
|
29
27
|
interval?: number;
|
|
30
28
|
onNode: Node;
|
|
31
29
|
} & Parameters<typeof _getPollInterval>[1]): () => void;
|
|
@@ -55,7 +53,7 @@ export declare function getQueryObject(oracleId: Encoded.OracleAddress, queryId:
|
|
|
55
53
|
interface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {
|
|
56
54
|
decodedQuery: string;
|
|
57
55
|
decodedResponse: string;
|
|
58
|
-
respond: (response: string, options?: Parameters<typeof respondToQuery>[
|
|
56
|
+
respond: (response: string, options?: Parameters<typeof respondToQuery>[2]) => ReturnType<typeof respondToQuery>;
|
|
59
57
|
pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) => ReturnType<typeof pollForQueryResponse>;
|
|
60
58
|
}
|
|
61
59
|
/**
|
|
@@ -71,8 +69,8 @@ interface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQue
|
|
|
71
69
|
* @param options.ttl - Transaction time to leave
|
|
72
70
|
* @returns Query object
|
|
73
71
|
*/
|
|
74
|
-
export declare function postQueryToOracle(oracleId: Encoded.OracleAddress, query: string, options: PostQueryToOracleOptions): Promise<Awaited<ReturnType<typeof
|
|
75
|
-
type PostQueryToOracleOptionsType = Parameters<typeof
|
|
72
|
+
export declare function postQueryToOracle(oracleId: Encoded.OracleAddress, query: string, options: PostQueryToOracleOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getQueryObject>>>;
|
|
73
|
+
type PostQueryToOracleOptionsType = Parameters<typeof sendTransaction>[1] & Parameters<typeof getQueryObject>[2] & BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'> & {
|
|
76
74
|
queryTtlType?: ORACLE_TTL_TYPES;
|
|
77
75
|
queryTtlValue?: number;
|
|
78
76
|
responseTtlType?: ORACLE_TTL_TYPES;
|
|
@@ -83,7 +81,6 @@ interface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {
|
|
|
83
81
|
/**
|
|
84
82
|
* Extend oracle ttl
|
|
85
83
|
* @category oracle
|
|
86
|
-
* @param oracleId - Oracle public key
|
|
87
84
|
* @param options - Options object
|
|
88
85
|
* @param options.fee - fee Transaction fee
|
|
89
86
|
* @param options.ttl - Transaction time to leave
|
|
@@ -91,8 +88,8 @@ interface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {
|
|
|
91
88
|
* @param options.oracleTtlValue - Oracle time to leave for extend
|
|
92
89
|
* @returns Oracle object
|
|
93
90
|
*/
|
|
94
|
-
export declare function extendOracleTtl(
|
|
95
|
-
type ExtendOracleTtlOptionsType =
|
|
91
|
+
export declare function extendOracleTtl(options: ExtendOracleTtlOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
|
|
92
|
+
type ExtendOracleTtlOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'> & {
|
|
96
93
|
oracleTtlType?: ORACLE_TTL_TYPES;
|
|
97
94
|
oracleTtlValue?: number;
|
|
98
95
|
};
|
|
@@ -101,7 +98,6 @@ interface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {
|
|
|
101
98
|
/**
|
|
102
99
|
* Extend oracle ttl
|
|
103
100
|
* @category oracle
|
|
104
|
-
* @param oracleId - Oracle public key
|
|
105
101
|
* @param queryId - Oracle query id
|
|
106
102
|
* @param response - Oracle query response
|
|
107
103
|
* @param options - Options object
|
|
@@ -110,8 +106,8 @@ interface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {
|
|
|
110
106
|
* @param options.ttl - Transaction time to leave
|
|
111
107
|
* @returns Oracle object
|
|
112
108
|
*/
|
|
113
|
-
export declare function respondToQuery(
|
|
114
|
-
type RespondToQueryOptionsType =
|
|
109
|
+
export declare function respondToQuery(queryId: Encoded.OracleQueryId, response: string, options: RespondToQueryOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
|
|
110
|
+
type RespondToQueryOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'> & {
|
|
115
111
|
responseTtlType?: ORACLE_TTL_TYPES;
|
|
116
112
|
responseTtlValue?: number;
|
|
117
113
|
};
|
|
@@ -150,9 +146,8 @@ interface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleBy
|
|
|
150
146
|
* @param options.ttl - Transaction time to leave
|
|
151
147
|
* @returns Oracle object
|
|
152
148
|
*/
|
|
153
|
-
export declare function registerOracle(queryFormat: string, responseFormat: string, options: RegisterOracleOptions): Promise<Awaited<ReturnType<typeof
|
|
154
|
-
type RegisterOracleOptionsType =
|
|
155
|
-
queryFee?: number | string | BigNumber;
|
|
149
|
+
export declare function registerOracle(queryFormat: string, responseFormat: string, options: RegisterOracleOptions): Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>;
|
|
150
|
+
type RegisterOracleOptionsType = SendTransactionOptions & Parameters<typeof getOracleObject>[1] & BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'oracleTtlType' | 'oracleTtlValue'> & {
|
|
156
151
|
oracleTtlType?: ORACLE_TTL_TYPES;
|
|
157
152
|
oracleTtlValue?: number;
|
|
158
153
|
};
|