@aeternity/aepp-sdk 13.2.1 → 13.3.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/LICENSE +1 -1
- package/README.md +1 -1
- package/bin/aesophia_cli +0 -0
- package/bin/aesophia_cli_8 +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 +7288 -9464
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +3 -0
- package/es/AeSdk.mjs +12 -12
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +0 -1
- package/es/AeSdkAepp.mjs +12 -16
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.d.ts +61 -6
- package/es/AeSdkBase.mjs +150 -69
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +19 -7
- package/es/AeSdkMethods.mjs +39 -38
- package/es/AeSdkMethods.mjs.map +1 -1
- package/es/AeSdkWallet.mjs +86 -55
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Middleware.d.ts +1 -1
- package/es/Middleware.mjs +32 -28
- package/es/Middleware.mjs.map +1 -1
- package/es/MiddlewareSubscriber.mjs +5 -14
- package/es/MiddlewareSubscriber.mjs.map +1 -1
- package/es/Node.d.ts +11 -3
- package/es/Node.mjs +65 -57
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +39 -3
- package/es/account/Base.mjs +35 -1
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.d.ts +2 -0
- package/es/account/Generalized.mjs +15 -6
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.d.ts +2 -0
- package/es/account/Ledger.mjs +14 -5
- package/es/account/Ledger.mjs.map +1 -1
- package/es/account/LedgerFactory.mjs +4 -6
- package/es/account/LedgerFactory.mjs.map +1 -1
- package/es/account/Memory.d.ts +15 -4
- package/es/account/Memory.mjs +96 -31
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +16 -5
- package/es/account/Rpc.mjs +94 -21
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +17 -44
- package/es/aens.mjs +32 -71
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +3 -4
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +7 -5
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +8 -9
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +7 -7
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +14 -0
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.d.ts +2 -0
- package/es/aepp-wallet-communication/schema.mjs +2 -0
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/es/aepp-wallet-communication/wallet-detector.mjs +13 -9
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +1 -0
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.mjs +13 -0
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/compiler/models/parameters.mjs.map +1 -1
- package/es/apis/middleware/middleware.d.ts +23 -5
- package/es/apis/middleware/middleware.mjs +114 -18
- package/es/apis/middleware/middleware.mjs.map +1 -1
- package/es/apis/middleware/models/index.d.ts +164 -15
- package/es/apis/middleware/models/index.mjs +53 -3
- package/es/apis/middleware/models/index.mjs.map +1 -1
- package/es/apis/middleware/models/mappers.d.ts +8 -1
- package/es/apis/middleware/models/mappers.mjs +376 -3
- package/es/apis/middleware/models/mappers.mjs.map +1 -1
- package/es/apis/middleware/models/parameters.d.ts +6 -3
- package/es/apis/middleware/models/parameters.mjs +38 -11
- package/es/apis/middleware/models/parameters.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +66 -2
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.d.ts +5 -1
- package/es/apis/node/models/mappers.mjs +229 -7
- 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.d.ts +24 -3
- package/es/apis/node/node.mjs +135 -3
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +14 -44
- package/es/chain.mjs +125 -219
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +3 -47
- package/es/channel/Base.mjs +21 -54
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/Contract.d.ts +16 -25
- package/es/channel/Contract.mjs +39 -63
- package/es/channel/Contract.mjs.map +1 -1
- package/es/channel/Spend.d.ts +0 -8
- package/es/channel/Spend.mjs +17 -29
- package/es/channel/Spend.mjs.map +1 -1
- package/es/channel/handlers.mjs +1 -1
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +104 -5
- package/es/channel/internal.mjs +26 -34
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +10 -2
- package/es/contract/Contract.mjs +83 -79
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +14 -8
- package/es/contract/compiler/Base.mjs.map +1 -1
- package/es/contract/compiler/Cli.d.ts +12 -11
- package/es/contract/compiler/Cli.mjs +52 -25
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/contract/compiler/Cli8.d.ts +13 -0
- package/es/contract/compiler/Cli8.mjs +22 -0
- package/es/contract/compiler/Cli8.mjs.map +1 -0
- package/es/contract/compiler/Http.d.ts +3 -9
- package/es/contract/compiler/Http.mjs +28 -16
- package/es/contract/compiler/Http.mjs.map +1 -1
- package/es/contract/compiler/HttpNode.d.ts +2 -5
- package/es/contract/compiler/HttpNode.mjs.map +1 -1
- package/es/contract/delegation-signature.d.ts +2 -1
- package/es/contract/delegation-signature.mjs +18 -14
- package/es/contract/delegation-signature.mjs.map +1 -1
- package/es/contract/ga.d.ts +1 -2
- package/es/contract/ga.mjs +23 -25
- package/es/contract/ga.mjs.map +1 -1
- package/es/deprecated.d.ts +48 -0
- package/es/deprecated.mjs +66 -1
- package/es/deprecated.mjs.map +1 -1
- package/es/index-browser.d.ts +11 -6
- package/es/index-browser.mjs +10 -6
- package/es/index-browser.mjs.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.mjs +1 -0
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +6 -37
- package/es/oracle.mjs +32 -66
- package/es/oracle.mjs.map +1 -1
- package/es/send-transaction.d.ts +53 -0
- package/es/send-transaction.mjs +109 -0
- package/es/send-transaction.mjs.map +1 -0
- package/es/spend.d.ts +4 -3
- package/es/spend.mjs +6 -1
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/common.d.ts +29 -0
- package/es/tx/builder/common.mjs +42 -0
- package/es/tx/builder/common.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +6 -5
- package/es/tx/builder/constants.mjs +7 -15
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/delegation/index.d.ts +20 -0
- package/es/tx/builder/delegation/index.mjs +24 -0
- package/es/tx/builder/delegation/index.mjs.map +1 -0
- package/es/tx/builder/delegation/schema.d.ts +130 -0
- package/es/tx/builder/delegation/schema.generated.d.ts +141 -0
- package/es/tx/builder/delegation/schema.generated.mjs +2 -0
- package/es/tx/builder/delegation/schema.generated.mjs.map +1 -0
- package/es/tx/builder/delegation/schema.mjs +54 -0
- package/es/tx/builder/delegation/schema.mjs.map +1 -0
- package/es/tx/builder/field-types/abi-version.mjs +8 -11
- package/es/tx/builder/field-types/abi-version.mjs.map +1 -1
- package/es/tx/builder/field-types/address.mjs +1 -4
- package/es/tx/builder/field-types/address.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +2 -2
- package/es/tx/builder/field-types/coin-amount.mjs +6 -6
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +1 -1
- package/es/tx/builder/field-types/ct-version.mjs +4 -5
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
- package/es/tx/builder/field-types/entry.mjs +7 -13
- package/es/tx/builder/field-types/entry.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +19 -11
- package/es/tx/builder/field-types/fee.mjs +57 -39
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.mjs +13 -15
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +10 -2
- package/es/tx/builder/field-types/gas-price.mjs +53 -4
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +31 -29
- package/es/tx/builder/field-types/index.mjs +31 -29
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/map.mjs +20 -31
- package/es/tx/builder/field-types/map.mjs.map +1 -1
- package/es/tx/builder/field-types/mptree.mjs +14 -29
- 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 +1 -1
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/nonce.d.ts +1 -0
- package/es/tx/builder/field-types/nonce.mjs +2 -0
- package/es/tx/builder/field-types/nonce.mjs.map +1 -1
- package/es/tx/builder/field-types/pointers.mjs +4 -7
- package/es/tx/builder/field-types/pointers.mjs.map +1 -1
- package/es/tx/builder/field-types/pointers2.d.ts +23 -0
- package/es/tx/builder/field-types/pointers2.mjs +65 -0
- package/es/tx/builder/field-types/pointers2.mjs.map +1 -0
- package/es/tx/builder/field-types/query-fee.d.ts +19 -0
- package/es/tx/builder/field-types/query-fee.mjs +20 -0
- package/es/tx/builder/field-types/query-fee.mjs.map +1 -0
- package/es/tx/builder/field-types/ttl.d.ts +9 -1
- package/es/tx/builder/field-types/ttl.mjs +19 -8
- package/es/tx/builder/field-types/ttl.mjs.map +1 -1
- package/es/tx/builder/field-types/with-default.d.ts +7 -0
- package/es/tx/builder/field-types/with-default.mjs +9 -0
- package/es/tx/builder/field-types/with-default.mjs.map +1 -0
- package/es/tx/builder/field-types/with-formatting.d.ts +7 -0
- package/es/tx/builder/field-types/with-formatting.mjs +9 -0
- package/es/tx/builder/field-types/with-formatting.mjs.map +1 -0
- package/es/tx/builder/field-types/wrapped.mjs +6 -8
- package/es/tx/builder/field-types/wrapped.mjs.map +1 -1
- package/es/tx/builder/helpers.d.ts +2 -2
- package/es/tx/builder/helpers.mjs +12 -21
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +17 -10
- package/es/tx/builder/index.mjs +39 -65
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +478 -257
- package/es/tx/builder/schema.generated.d.ts +39 -3
- package/es/tx/builder/schema.generated.mjs.map +1 -1
- package/es/tx/builder/schema.mjs +48 -36
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/execution-cost.d.ts +6 -5
- package/es/tx/execution-cost.mjs +16 -17
- package/es/tx/execution-cost.mjs.map +1 -1
- package/es/tx/transaction-signer.mjs +1 -4
- package/es/tx/transaction-signer.mjs.map +1 -1
- package/es/tx/validator.mjs +61 -42
- package/es/tx/validator.mjs.map +1 -1
- package/es/utils/amount-formatter.mjs +15 -22
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +2 -3
- package/es/utils/autorest.mjs +41 -25
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bytes.mjs +1 -2
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +9 -5
- package/es/utils/crypto.mjs +18 -14
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/errors.d.ts +6 -0
- package/es/utils/errors.mjs +12 -6
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +2 -0
- package/es/utils/hd-wallet.mjs +6 -5
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs +2 -10
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/jwt.d.ts +53 -0
- package/es/utils/jwt.mjs +120 -0
- package/es/utils/jwt.mjs.map +1 -0
- package/es/utils/keystore.d.ts +6 -2
- package/es/utils/keystore.mjs +8 -16
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/typed-data.d.ts +0 -2
- package/es/utils/typed-data.mjs +8 -23
- package/es/utils/typed-data.mjs.map +1 -1
- package/es/utils/wrap-proxy.d.ts +2 -0
- package/es/utils/wrap-proxy.mjs +15 -0
- package/es/utils/wrap-proxy.mjs.map +1 -0
- package/package.json +57 -51
- package/src/AeSdk.ts +3 -0
- package/src/AeSdkAepp.ts +0 -1
- package/src/AeSdkBase.ts +97 -10
- package/src/AeSdkMethods.ts +37 -33
- package/src/AeSdkWallet.ts +22 -3
- package/src/Middleware.ts +17 -9
- package/src/MiddlewareSubscriber.ts +1 -1
- package/src/Node.ts +51 -21
- package/src/account/Base.ts +62 -3
- package/src/account/Generalized.ts +10 -0
- package/src/account/Ledger.ts +10 -0
- package/src/account/Memory.ts +83 -9
- package/src/account/Rpc.ts +69 -6
- package/src/aens.ts +35 -56
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +3 -0
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +2 -2
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +4 -2
- package/src/aepp-wallet-communication/rpc/types.ts +14 -1
- package/src/aepp-wallet-communication/schema.ts +2 -0
- package/src/aepp-wallet-communication/wallet-detector.ts +10 -10
- package/src/apis/compiler/compiler.ts +93 -93
- package/src/apis/compiler/models/index.ts +1 -0
- package/src/apis/compiler/models/mappers.ts +178 -165
- package/src/apis/compiler/models/parameters.ts +18 -18
- package/src/apis/middleware/middleware.ts +462 -341
- package/src/apis/middleware/models/index.ts +258 -56
- package/src/apis/middleware/models/mappers.ts +2357 -1919
- package/src/apis/middleware/models/parameters.ts +172 -142
- package/src/apis/node/models/index.ts +79 -2
- package/src/apis/node/models/mappers.ts +1529 -1302
- package/src/apis/node/models/parameters.ts +51 -51
- package/src/apis/node/node.ts +420 -275
- package/src/chain.ts +42 -128
- package/src/channel/Base.ts +14 -47
- package/src/channel/Contract.ts +18 -26
- package/src/channel/Spend.ts +0 -8
- package/src/channel/internal.ts +115 -13
- package/src/contract/Contract.ts +36 -12
- package/src/contract/compiler/Base.ts +15 -8
- package/src/contract/compiler/Cli.ts +44 -23
- package/src/contract/compiler/Cli8.ts +17 -0
- package/src/contract/compiler/Http.ts +24 -14
- package/src/contract/compiler/HttpNode.ts +2 -2
- package/src/contract/delegation-signature.ts +11 -5
- package/src/contract/ga.ts +4 -3
- package/src/deprecated.ts +55 -1
- package/src/index-browser.ts +18 -11
- package/src/index.ts +1 -0
- package/src/oracle.ts +11 -54
- package/src/send-transaction.ts +136 -0
- package/src/spend.ts +25 -11
- package/src/tx/builder/common.ts +74 -0
- package/src/tx/builder/constants.ts +7 -9
- package/src/tx/builder/delegation/index.ts +28 -0
- package/src/tx/builder/delegation/schema.generated.ts +143 -0
- package/src/tx/builder/delegation/schema.ts +61 -0
- package/src/tx/builder/field-types/coin-amount.ts +3 -2
- package/src/tx/builder/field-types/ct-version.ts +1 -1
- package/src/tx/builder/field-types/entry.ts +1 -4
- package/src/tx/builder/field-types/fee.ts +72 -44
- package/src/tx/builder/field-types/gas-limit.ts +4 -4
- package/src/tx/builder/field-types/gas-price.ts +59 -3
- package/src/tx/builder/field-types/index.ts +31 -59
- package/src/tx/builder/field-types/name-fee.ts +1 -1
- package/src/tx/builder/field-types/nonce.ts +7 -1
- package/src/tx/builder/field-types/pointers2.ts +62 -0
- package/src/tx/builder/field-types/query-fee.ts +25 -0
- package/src/tx/builder/field-types/ttl.ts +13 -3
- package/src/tx/builder/field-types/with-default.ts +18 -0
- package/src/tx/builder/field-types/with-formatting.ts +18 -0
- package/src/tx/builder/helpers.ts +2 -2
- package/src/tx/builder/index.ts +42 -59
- package/src/tx/builder/schema.generated.ts +39 -3
- package/src/tx/builder/schema.ts +55 -29
- package/src/tx/execution-cost.ts +6 -5
- package/src/tx/validator.ts +31 -5
- package/src/utils/autorest.ts +37 -28
- package/src/utils/crypto.ts +24 -14
- package/src/utils/errors.ts +10 -0
- package/src/utils/hd-wallet.ts +2 -0
- package/src/utils/jwt.ts +126 -0
- package/src/utils/keystore.ts +6 -2
- package/src/utils/typed-data.ts +4 -30
- package/src/utils/wrap-proxy.ts +24 -0
- package/types-legacy/ts4.2/AeSdk.d.ts +3 -0
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +0 -1
- package/types-legacy/ts4.2/AeSdkBase.d.ts +61 -6
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +19 -7
- package/types-legacy/ts4.2/Middleware.d.ts +1 -1
- package/types-legacy/ts4.2/Node.d.ts +15 -2
- package/types-legacy/ts4.2/account/Base.d.ts +39 -3
- package/types-legacy/ts4.2/account/Generalized.d.ts +2 -0
- package/types-legacy/ts4.2/account/Ledger.d.ts +2 -0
- package/types-legacy/ts4.2/account/Memory.d.ts +15 -4
- package/types-legacy/ts4.2/account/Rpc.d.ts +16 -5
- package/types-legacy/ts4.2/aens.d.ts +17 -44
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +14 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +2 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +1 -0
- package/types-legacy/ts4.2/apis/middleware/middleware.d.ts +23 -5
- package/types-legacy/ts4.2/apis/middleware/models/index.d.ts +164 -15
- package/types-legacy/ts4.2/apis/middleware/models/mappers.d.ts +8 -1
- package/types-legacy/ts4.2/apis/middleware/models/parameters.d.ts +6 -3
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +66 -2
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +5 -1
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.2/apis/node/node.d.ts +24 -3
- package/types-legacy/ts4.2/chain.d.ts +14 -44
- package/types-legacy/ts4.2/channel/Base.d.ts +3 -47
- package/types-legacy/ts4.2/channel/Contract.d.ts +16 -25
- package/types-legacy/ts4.2/channel/Spend.d.ts +0 -8
- package/types-legacy/ts4.2/channel/internal.d.ts +104 -5
- package/types-legacy/ts4.2/contract/Contract.d.ts +10 -2
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +14 -8
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +12 -11
- package/types-legacy/ts4.2/contract/compiler/Cli8.d.ts +13 -0
- package/types-legacy/ts4.2/contract/compiler/Http.d.ts +3 -9
- package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +2 -5
- package/types-legacy/ts4.2/contract/delegation-signature.d.ts +2 -1
- package/types-legacy/ts4.2/contract/ga.d.ts +1 -2
- package/types-legacy/ts4.2/deprecated.d.ts +48 -0
- package/types-legacy/ts4.2/index-browser.d.ts +11 -6
- package/types-legacy/ts4.2/index.d.ts +1 -0
- package/types-legacy/ts4.2/oracle.d.ts +6 -37
- package/types-legacy/ts4.2/send-transaction.d.ts +53 -0
- package/types-legacy/ts4.2/spend.d.ts +4 -3
- package/types-legacy/ts4.2/tx/builder/common.d.ts +32 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +6 -5
- package/types-legacy/ts4.2/tx/builder/delegation/index.d.ts +20 -0
- package/types-legacy/ts4.2/tx/builder/delegation/schema.d.ts +136 -0
- package/types-legacy/ts4.2/tx/builder/delegation/schema.generated.d.ts +141 -0
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +2 -2
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +19 -11
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +10 -2
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +31 -29
- 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 +1 -0
- package/types-legacy/ts4.2/tx/builder/field-types/pointers2.d.ts +26 -0
- package/types-legacy/ts4.2/tx/builder/field-types/query-fee.d.ts +19 -0
- package/types-legacy/ts4.2/tx/builder/field-types/ttl.d.ts +9 -1
- package/types-legacy/ts4.2/tx/builder/field-types/with-default.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/with-formatting.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/helpers.d.ts +2 -2
- package/types-legacy/ts4.2/tx/builder/index.d.ts +17 -10
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +482 -257
- package/types-legacy/ts4.2/tx/builder/schema.generated.d.ts +39 -3
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +6 -5
- package/types-legacy/ts4.2/utils/autorest.d.ts +2 -3
- package/types-legacy/ts4.2/utils/crypto.d.ts +9 -5
- package/types-legacy/ts4.2/utils/errors.d.ts +6 -0
- package/types-legacy/ts4.2/utils/hd-wallet.d.ts +2 -0
- package/types-legacy/ts4.2/utils/jwt.d.ts +53 -0
- package/types-legacy/ts4.2/utils/keystore.d.ts +6 -2
- package/types-legacy/ts4.2/utils/typed-data.d.ts +0 -2
- package/types-legacy/ts4.2/utils/wrap-proxy.d.ts +2 -0
- package/types-legacy/ts4.5/AeSdk.d.ts +3 -0
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +0 -1
- package/types-legacy/ts4.5/AeSdkBase.d.ts +61 -6
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +19 -7
- package/types-legacy/ts4.5/Middleware.d.ts +1 -1
- package/types-legacy/ts4.5/Node.d.ts +15 -2
- package/types-legacy/ts4.5/account/Base.d.ts +39 -3
- package/types-legacy/ts4.5/account/Generalized.d.ts +2 -0
- package/types-legacy/ts4.5/account/Ledger.d.ts +2 -0
- package/types-legacy/ts4.5/account/Memory.d.ts +15 -4
- package/types-legacy/ts4.5/account/Rpc.d.ts +16 -5
- package/types-legacy/ts4.5/aens.d.ts +17 -44
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +3 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +14 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +2 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +1 -0
- package/types-legacy/ts4.5/apis/middleware/middleware.d.ts +23 -5
- package/types-legacy/ts4.5/apis/middleware/models/index.d.ts +164 -15
- package/types-legacy/ts4.5/apis/middleware/models/mappers.d.ts +8 -1
- package/types-legacy/ts4.5/apis/middleware/models/parameters.d.ts +6 -3
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +66 -2
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +5 -1
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +2 -2
- package/types-legacy/ts4.5/apis/node/node.d.ts +24 -3
- package/types-legacy/ts4.5/chain.d.ts +14 -44
- package/types-legacy/ts4.5/channel/Base.d.ts +3 -47
- package/types-legacy/ts4.5/channel/Contract.d.ts +16 -25
- package/types-legacy/ts4.5/channel/Spend.d.ts +0 -8
- package/types-legacy/ts4.5/channel/internal.d.ts +104 -5
- package/types-legacy/ts4.5/contract/Contract.d.ts +10 -2
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +14 -8
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +12 -11
- package/types-legacy/ts4.5/contract/compiler/Cli8.d.ts +13 -0
- package/types-legacy/ts4.5/contract/compiler/Http.d.ts +3 -9
- package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +2 -5
- package/types-legacy/ts4.5/contract/delegation-signature.d.ts +2 -1
- package/types-legacy/ts4.5/contract/ga.d.ts +1 -2
- package/types-legacy/ts4.5/deprecated.d.ts +48 -0
- package/types-legacy/ts4.5/index-browser.d.ts +11 -6
- package/types-legacy/ts4.5/index.d.ts +1 -0
- package/types-legacy/ts4.5/oracle.d.ts +6 -37
- package/types-legacy/ts4.5/send-transaction.d.ts +53 -0
- package/types-legacy/ts4.5/spend.d.ts +4 -3
- package/types-legacy/ts4.5/tx/builder/common.d.ts +32 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +6 -5
- package/types-legacy/ts4.5/tx/builder/delegation/index.d.ts +20 -0
- package/types-legacy/ts4.5/tx/builder/delegation/schema.d.ts +136 -0
- package/types-legacy/ts4.5/tx/builder/delegation/schema.generated.d.ts +141 -0
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +2 -2
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +19 -11
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +10 -2
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +31 -29
- 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 +1 -0
- package/types-legacy/ts4.5/tx/builder/field-types/pointers2.d.ts +26 -0
- package/types-legacy/ts4.5/tx/builder/field-types/query-fee.d.ts +19 -0
- package/types-legacy/ts4.5/tx/builder/field-types/ttl.d.ts +9 -1
- package/types-legacy/ts4.5/tx/builder/field-types/with-default.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/with-formatting.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/helpers.d.ts +2 -2
- package/types-legacy/ts4.5/tx/builder/index.d.ts +17 -10
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +482 -257
- package/types-legacy/ts4.5/tx/builder/schema.generated.d.ts +39 -3
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +6 -5
- package/types-legacy/ts4.5/utils/autorest.d.ts +2 -3
- package/types-legacy/ts4.5/utils/crypto.d.ts +9 -5
- package/types-legacy/ts4.5/utils/errors.d.ts +6 -0
- package/types-legacy/ts4.5/utils/hd-wallet.d.ts +2 -0
- package/types-legacy/ts4.5/utils/jwt.d.ts +53 -0
- package/types-legacy/ts4.5/utils/keystore.d.ts +6 -2
- package/types-legacy/ts4.5/utils/typed-data.d.ts +0 -2
- package/types-legacy/ts4.5/utils/wrap-proxy.d.ts +2 -0
- package/es/tx/builder/field-types/deposit.d.ts +0 -15
- package/es/tx/builder/field-types/deposit.mjs +0 -18
- package/es/tx/builder/field-types/deposit.mjs.map +0 -1
- package/src/tx/builder/field-types/deposit.ts +0 -23
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +0 -15
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RestError } from '@azure/core-rest-pipeline';
|
|
1
|
+
import { RestError, userAgentPolicyName, setClientRequestIdPolicyName } from '@azure/core-rest-pipeline';
|
|
2
2
|
import { Compiler as CompilerApi } from "../../apis/compiler/index.mjs";
|
|
3
3
|
import { genErrorFormatterPolicy, genVersionCheckPolicy } from "../../utils/autorest.mjs";
|
|
4
4
|
import CompilerBase from "./Base.mjs";
|
|
@@ -16,14 +16,19 @@ export default class CompilerHttp extends CompilerBase {
|
|
|
16
16
|
* @param options - Options
|
|
17
17
|
* @param options.ignoreVersion - Don't check compiler version
|
|
18
18
|
*/
|
|
19
|
-
constructor(compilerUrl
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
+
constructor(compilerUrl, {
|
|
20
|
+
ignoreVersion = false
|
|
21
|
+
} = {}) {
|
|
23
22
|
super();
|
|
23
|
+
let version;
|
|
24
|
+
const getVersion = async opts => {
|
|
25
|
+
if (version != null) return version;
|
|
26
|
+
version = (await this.api.apiVersion(opts)).apiVersion;
|
|
27
|
+
return version;
|
|
28
|
+
};
|
|
24
29
|
this.api = new CompilerApi(compilerUrl, {
|
|
25
30
|
allowInsecureConnection: true,
|
|
26
|
-
additionalPolicies: [genErrorFormatterPolicy(body => {
|
|
31
|
+
additionalPolicies: [...(ignoreVersion ? [] : [genVersionCheckPolicy('compiler', getVersion, '7.3.0', '9.0.0')]), genErrorFormatterPolicy(body => {
|
|
27
32
|
let message = '';
|
|
28
33
|
if ('reason' in body) {
|
|
29
34
|
message += ` ${body.reason}${body.parameter != null ? ` in ${body.parameter}` : ''
|
|
@@ -36,24 +41,31 @@ export default class CompilerHttp extends CompilerBase {
|
|
|
36
41
|
return message;
|
|
37
42
|
})]
|
|
38
43
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, error => error);
|
|
46
|
-
this.api.pipeline.addPolicy(genVersionCheckPolicy('compiler', '/api-version', versionPromise, '7.3.0', '8.0.0'));
|
|
47
|
-
}
|
|
44
|
+
this.api.pipeline.removePolicy({
|
|
45
|
+
name: userAgentPolicyName
|
|
46
|
+
});
|
|
47
|
+
this.api.pipeline.removePolicy({
|
|
48
|
+
name: setClientRequestIdPolicyName
|
|
49
|
+
});
|
|
48
50
|
}
|
|
49
51
|
async compileBySourceCode(sourceCode, fileSystem) {
|
|
50
52
|
try {
|
|
51
|
-
|
|
53
|
+
var _cmpOut$warnings;
|
|
54
|
+
const cmpOut = await this.api.compileContract({
|
|
52
55
|
code: sourceCode,
|
|
53
56
|
options: {
|
|
54
57
|
fileSystem
|
|
55
58
|
}
|
|
56
59
|
});
|
|
60
|
+
(_cmpOut$warnings = cmpOut.warnings) !== null && _cmpOut$warnings !== void 0 ? _cmpOut$warnings : cmpOut.warnings = []; // TODO: remove after requiring http compiler above or equal to 8.0.0
|
|
61
|
+
const warnings = cmpOut.warnings.map(({
|
|
62
|
+
type,
|
|
63
|
+
...warning
|
|
64
|
+
}) => warning);
|
|
65
|
+
const res = {
|
|
66
|
+
...cmpOut,
|
|
67
|
+
warnings
|
|
68
|
+
};
|
|
57
69
|
// TODO: should be fixed when the compiledAci interface gets updated
|
|
58
70
|
return res;
|
|
59
71
|
} catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Http.mjs","names":["RestError","Compiler","CompilerApi","genErrorFormatterPolicy","genVersionCheckPolicy","CompilerBase","CompilerError","NotImplementedError","CompilerHttp","constructor","compilerUrl","ignoreVersion","
|
|
1
|
+
{"version":3,"file":"Http.mjs","names":["RestError","userAgentPolicyName","setClientRequestIdPolicyName","Compiler","CompilerApi","genErrorFormatterPolicy","genVersionCheckPolicy","CompilerBase","CompilerError","NotImplementedError","CompilerHttp","constructor","compilerUrl","ignoreVersion","version","getVersion","opts","api","apiVersion","allowInsecureConnection","additionalPolicies","body","message","reason","parameter","info","JSON","stringify","Array","isArray","map","e","type","pos","line","col","context","join","pipeline","removePolicy","name","compileBySourceCode","sourceCode","fileSystem","_cmpOut$warnings","cmpOut","compileContract","code","options","warnings","warning","res","error","statusCode","compile","path","generateAciBySourceCode","generateACI","generateAci","validateBySourceCode","bytecode","validateByteCode","source","validate"],"sources":["../../../src/contract/compiler/Http.ts"],"sourcesContent":["import {\n RestError, userAgentPolicyName, setClientRequestIdPolicyName,\n} from '@azure/core-rest-pipeline';\nimport { OperationOptions } from '@azure/core-client';\nimport {\n Compiler as CompilerApi,\n ErrorModel,\n CompilerError as CompilerErrorApi,\n} from '../../apis/compiler';\nimport { genErrorFormatterPolicy, genVersionCheckPolicy } from '../../utils/autorest';\nimport CompilerBase, { Aci, CompileResult } from './Base';\nimport { Encoded } from '../../utils/encoder';\nimport { CompilerError, NotImplementedError } from '../../utils/errors';\n\ntype GeneralCompilerError = ErrorModel & {\n info?: object;\n parameter?: string;\n};\n\n/**\n * Contract Compiler over HTTP\n *\n * This class include api call's related to contract compiler functionality.\n * @category contract\n * @example CompilerHttp('COMPILER_URL')\n */\nexport default class CompilerHttp extends CompilerBase {\n readonly api: CompilerApi;\n\n /**\n * @param compilerUrl - Url for compiler API\n * @param options - Options\n * @param options.ignoreVersion - Don't check compiler version\n */\n constructor(compilerUrl: string, { ignoreVersion = false }: { ignoreVersion?: boolean } = {}) {\n super();\n\n let version: string | undefined;\n const getVersion = async (opts: OperationOptions): Promise<string> => {\n if (version != null) return version;\n version = (await this.api.apiVersion(opts)).apiVersion;\n return version;\n };\n\n this.api = new CompilerApi(compilerUrl, {\n allowInsecureConnection: true,\n additionalPolicies: [\n ...ignoreVersion ? [] : [genVersionCheckPolicy('compiler', getVersion, '7.3.0', '9.0.0')],\n genErrorFormatterPolicy((body: GeneralCompilerError | CompilerErrorApi[]) => {\n let message = '';\n if ('reason' in body) {\n message += ` ${body.reason\n }${body.parameter != null ? ` in ${body.parameter}` : ''\n // TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78\n }${body.info != null ? ` (${JSON.stringify(body.info)})` : ''}`;\n }\n if (Array.isArray(body)) {\n message += `\\n${body\n .map((e) => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context != null ? ` (${e.context})` : ''}`)\n .join('\\n')}`;\n }\n return message;\n }),\n ],\n });\n this.api.pipeline.removePolicy({ name: userAgentPolicyName });\n this.api.pipeline.removePolicy({ name: setClientRequestIdPolicyName });\n }\n\n async compileBySourceCode(\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): CompileResult {\n try {\n const cmpOut = await this.api.compileContract({ code: sourceCode, options: { fileSystem } });\n cmpOut.warnings ??= []; // TODO: remove after requiring http compiler above or equal to 8.0.0\n const warnings = cmpOut.warnings.map(({ type, ...warning }) => warning);\n const res = { ...cmpOut, warnings };\n // TODO: should be fixed when the compiledAci interface gets updated\n return res as Awaited<CompileResult>;\n } catch (error) {\n if (error instanceof RestError && error.statusCode === 400) {\n throw new CompilerError(error.message);\n }\n throw error;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async compile(path: string): CompileResult {\n throw new NotImplementedError('File system access, use CompilerHttpNode instead');\n }\n\n async generateAciBySourceCode(\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<Aci> {\n try {\n return await this.api.generateACI({ code: sourceCode, options: { fileSystem } });\n } catch (error) {\n if (error instanceof RestError && error.statusCode === 400) {\n throw new CompilerError(error.message);\n }\n throw error;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async generateAci(path: string): Promise<Aci> {\n throw new NotImplementedError('File system access, use CompilerHttpNode instead');\n }\n\n async validateBySourceCode(\n bytecode: Encoded.ContractBytearray,\n sourceCode: string,\n fileSystem?: Record<string, string>,\n ): Promise<boolean> {\n try {\n await this.api.validateByteCode({ bytecode, source: sourceCode, options: { fileSystem } });\n return true;\n } catch {\n return false;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean> {\n throw new NotImplementedError('File system access, use CompilerHttpNode instead');\n }\n\n async version(): Promise<string> {\n return (await this.api.version()).version;\n }\n}\n"],"mappings":"AAAA,SACEA,SAAS,EAAEC,mB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EACnF;EAEA,MAAMK,OAAOA,CAAA,EAAoB;IAC/B,OAAO,CAAC,MAAM,IAAI,CAACG,GAAG,CAACH,OAAO,CAAC,CAAC,EAAEA,OAAO;EAC3C;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import HttpBrowser from './Http';
|
|
2
|
-
import { Aci } from './Base';
|
|
2
|
+
import { Aci, CompileResult } from './Base';
|
|
3
3
|
import { Encoded } from '../../utils/encoder';
|
|
4
4
|
/**
|
|
5
5
|
* Contract Compiler over HTTP for Nodejs
|
|
@@ -9,10 +9,7 @@ import { Encoded } from '../../utils/encoder';
|
|
|
9
9
|
* @example CompilerHttpNode('COMPILER_URL')
|
|
10
10
|
*/
|
|
11
11
|
export default class CompilerHttpNode extends HttpBrowser {
|
|
12
|
-
compile(path: string):
|
|
13
|
-
bytecode: Encoded.ContractBytearray;
|
|
14
|
-
aci: Aci;
|
|
15
|
-
}>;
|
|
12
|
+
compile(path: string): CompileResult;
|
|
16
13
|
generateAci(path: string): Promise<Aci>;
|
|
17
14
|
validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean>;
|
|
18
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpNode.mjs","names":["_fsPromises","readFile","HttpBrowser","getFileSystem","CompilerHttpNode","compile","path","fileSystem","sourceCode","compileBySourceCode","generateAci","generateAciBySourceCode","validate","bytecode","validateBySourceCode"],"sources":["../../../src/contract/compiler/HttpNode.ts"],"sourcesContent":["import { readFile } from 'fs/promises';\nimport HttpBrowser from './Http';\nimport { Aci } from './Base';\nimport { Encoded } from '../../utils/encoder';\nimport getFileSystem from './getFileSystem';\n\n/**\n * Contract Compiler over HTTP for Nodejs\n *\n * Inherits CompilerHttp and implements `compile`, `validate` methods\n * @category contract\n * @example CompilerHttpNode('COMPILER_URL')\n */\nexport default class CompilerHttpNode extends HttpBrowser {\n override async compile(path: string):
|
|
1
|
+
{"version":3,"file":"HttpNode.mjs","names":["_fsPromises","readFile","HttpBrowser","getFileSystem","CompilerHttpNode","compile","path","fileSystem","sourceCode","compileBySourceCode","generateAci","generateAciBySourceCode","validate","bytecode","validateBySourceCode"],"sources":["../../../src/contract/compiler/HttpNode.ts"],"sourcesContent":["import { readFile } from 'fs/promises';\nimport HttpBrowser from './Http';\nimport { Aci, CompileResult } from './Base';\nimport { Encoded } from '../../utils/encoder';\nimport getFileSystem from './getFileSystem';\n\n/**\n * Contract Compiler over HTTP for Nodejs\n *\n * Inherits CompilerHttp and implements `compile`, `validate` methods\n * @category contract\n * @example CompilerHttpNode('COMPILER_URL')\n */\nexport default class CompilerHttpNode extends HttpBrowser {\n override async compile(path: string): CompileResult {\n const fileSystem = await getFileSystem(path);\n const sourceCode = await readFile(path, 'utf8');\n return this.compileBySourceCode(sourceCode, fileSystem);\n }\n\n override async generateAci(path: string): Promise<Aci> {\n const fileSystem = await getFileSystem(path);\n const sourceCode = await readFile(path, 'utf8');\n return this.generateAciBySourceCode(sourceCode, fileSystem);\n }\n\n override async validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean> {\n const fileSystem = await getFileSystem(path);\n const sourceCode = await readFile(path, 'utf8');\n return this.validateBySourceCode(bytecode, sourceCode, fileSystem);\n }\n}\n"],"mappings":"AAAA,OAAAA,WAAA,MAAyB,aAAa;AAAC;EAAAC;AAAA,IAAAD,WAAA;AAAA,OAChCE,WAAW;AAAA,OAGXC,aAAa;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASF,WAAW,CAAC;EACxD,MAAeG,OAAOA,CAACC,IAAY,EAAiB;IAClD,MAAMC,UAAU,GAAG,MAAMJ,aAAa,CAACG,IAAI,CAAC;IAC5C,MAAME,UAAU,GAAG,MAAMP,QAAQ,CAACK,IAAI,EAAE,MAAM,CAAC;IAC/C,OAAO,IAAI,CAACG,mBAAmB,CAACD,UAAU,EAAED,UAAU,CAAC;EACzD;EAEA,MAAeG,WAAWA,CAACJ,IAAY,EAAgB;IACrD,MAAMC,UAAU,GAAG,MAAMJ,aAAa,CAACG,IAAI,CAAC;IAC5C,MAAME,UAAU,GAAG,MAAMP,QAAQ,CAACK,IAAI,EAAE,MAAM,CAAC;IAC/C,OAAO,IAAI,CAACK,uBAAuB,CAACH,UAAU,EAAED,UAAU,CAAC;EAC7D;EAEA,MAAeK,QAAQA,CAACC,QAAmC,EAAEP,IAAY,EAAoB;IAC3F,MAAMC,UAAU,GAAG,MAAMJ,aAAa,CAACG,IAAI,CAAC;IAC5C,MAAME,UAAU,GAAG,MAAMP,QAAQ,CAACK,IAAI,EAAE,MAAM,CAAC;IAC/C,OAAO,IAAI,CAACQ,oBAAoB,CAACD,QAAQ,EAAEL,UAAU,EAAED,UAAU,CAAC;EACpE;AACF"}
|
|
@@ -37,8 +37,9 @@ import Node from '../Node';
|
|
|
37
37
|
* .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, { onAccount, omitAddress, ...options }: {
|
|
40
|
+
export default function createDelegationSignature(contractAddress: Encoded.ContractAddress, ids: Array<Encoded.Any | AensName>, { onAccount, omitAddress, isOracle, ...options }: {
|
|
41
41
|
omitAddress?: boolean;
|
|
42
42
|
onAccount: AccountBase;
|
|
43
|
+
isOracle?: boolean;
|
|
43
44
|
onNode: Node;
|
|
44
45
|
}): Promise<Uint8Array>;
|
|
@@ -40,20 +40,28 @@ function ensureOracleQuery(oq) {
|
|
|
40
40
|
* .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export default async function createDelegationSignature(contractAddress, ids,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
export default async function createDelegationSignature(contractAddress, ids, {
|
|
44
|
+
onAccount,
|
|
45
|
+
omitAddress,
|
|
46
|
+
isOracle,
|
|
47
|
+
...options
|
|
48
|
+
}) {
|
|
49
49
|
if (ids.length > 1) throw new ArgumentError('ids', 'shorter than 2', ids);
|
|
50
|
-
const
|
|
50
|
+
const {
|
|
51
|
+
nodeNetworkId,
|
|
52
|
+
consensusProtocolVersion
|
|
53
|
+
} = await options.onNode.getNodeInfo();
|
|
54
|
+
const signOpts = {
|
|
55
|
+
networkId: nodeNetworkId,
|
|
56
|
+
consensusProtocolVersion
|
|
57
|
+
};
|
|
51
58
|
if (ids.length === 0) {
|
|
52
59
|
if (omitAddress === true) {
|
|
53
60
|
throw new ArgumentError('omitAddress', 'equal false', omitAddress);
|
|
54
61
|
}
|
|
55
62
|
return decode(await onAccount.signDelegationToContract(contractAddress, {
|
|
56
|
-
|
|
63
|
+
...signOpts,
|
|
64
|
+
isOracle
|
|
57
65
|
}));
|
|
58
66
|
}
|
|
59
67
|
const [payload] = ids;
|
|
@@ -61,16 +69,12 @@ export default async function createDelegationSignature(contractAddress, ids, _r
|
|
|
61
69
|
if (omitAddress === true) {
|
|
62
70
|
throw new ArgumentError('omitAddress', 'equal false', omitAddress);
|
|
63
71
|
}
|
|
64
|
-
return decode(await onAccount.signNameDelegationToContract(contractAddress, payload,
|
|
65
|
-
networkId
|
|
66
|
-
}));
|
|
72
|
+
return decode(await onAccount.signNameDelegationToContract(contractAddress, payload, signOpts));
|
|
67
73
|
}
|
|
68
74
|
ensureOracleQuery(payload);
|
|
69
75
|
if (omitAddress !== true) {
|
|
70
76
|
throw new ArgumentError('omitAddress', 'equal true', omitAddress);
|
|
71
77
|
}
|
|
72
|
-
return decode(await onAccount.signOracleQueryDelegationToContract(contractAddress, payload,
|
|
73
|
-
networkId
|
|
74
|
-
}));
|
|
78
|
+
return decode(await onAccount.signOracleQueryDelegationToContract(contractAddress, payload, signOpts));
|
|
75
79
|
}
|
|
76
80
|
//# sourceMappingURL=delegation-signature.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegation-signature.mjs","names":["decode","ArgumentError","isNameValid","ensureOracleQuery","oq","startsWith","createDelegationSignature","contractAddress","ids","
|
|
1
|
+
{"version":3,"file":"delegation-signature.mjs","names":["decode","ArgumentError","isNameValid","ensureOracleQuery","oq","startsWith","createDelegationSignature","contractAddress","ids","onAccount","omitAddress","isOracle","options","length","nodeNetworkId","consensusProtocolVersion","onNode","getNodeInfo","signOpts","networkId","signDelegationToContract","payload","signNameDelegationToContract","signOracleQueryDelegationToContract"],"sources":["../../src/contract/delegation-signature.ts"],"sourcesContent":["import { decode, Encoded } from '../utils/encoder';\nimport { ArgumentError } from '../utils/errors';\nimport { AensName } from '../tx/builder/constants';\nimport AccountBase from '../account/Base';\nimport { isNameValid } from '../tx/builder/helpers';\nimport Node from '../Node';\n\nfunction ensureOracleQuery(oq: string): asserts oq is Encoded.OracleQueryId {\n if (!oq.startsWith('oq_')) throw new ArgumentError('oq', 'oracle query', oq);\n}\n\n/**\n * Helper to generate a signature to delegate\n * - pre-claim/claim/transfer/revoke of a name to a contract.\n * - register/extend/respond of an Oracle to a contract.\n * @category contract\n * @param contractAddress - Address of contract to delegate access\n * @param ids - The list of id's to prepend\n * @param options - Options\n * @param options.omitAddress - Prepend delegation signature with an account address\n * @param options.onAccount - Account to use\n * @param options.onNode - Node to use\n * @returns Signature\n * @deprecated use methods `sign*DelegationToContract` of Account instance instead\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractAddress = 'ct_asd2ks...'\n * const aensName = 'example.chain'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await aeSdk\n * .createDelegationSignature(contractAddress, [aensName], { onAccount })\n *\n * const oracleQueryId = 'oq_...'\n * const onAccount = new MemoryAccount(...) // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await aeSdk\n * .createDelegationSignature(contractAddress, [], { onAccount })\n * // Oracle respond signature\n * const respondSig = await aeSdk\n * .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })\n * ```\n */\nexport default async function createDelegationSignature(\n contractAddress: Encoded.ContractAddress,\n ids: Array<Encoded.Any | AensName>,\n {\n onAccount, omitAddress, isOracle, ...options\n }: {\n omitAddress?: boolean;\n onAccount: AccountBase;\n isOracle?: boolean;\n onNode: Node;\n },\n): Promise<Uint8Array> {\n if (ids.length > 1) throw new ArgumentError('ids', 'shorter than 2', ids);\n const { nodeNetworkId, consensusProtocolVersion } = await options.onNode.getNodeInfo();\n const signOpts = { networkId: nodeNetworkId, consensusProtocolVersion };\n if (ids.length === 0) {\n if (omitAddress === true) {\n throw new ArgumentError('omitAddress', 'equal false', omitAddress);\n }\n return decode(\n await onAccount.signDelegationToContract(contractAddress, { ...signOpts, isOracle }),\n );\n }\n\n const [payload] = ids;\n if (isNameValid(payload)) {\n if (omitAddress === true) {\n throw new ArgumentError('omitAddress', 'equal false', omitAddress);\n }\n return decode(\n await onAccount.signNameDelegationToContract(contractAddress, payload, signOpts),\n );\n }\n\n ensureOracleQuery(payload);\n if (omitAddress !== true) {\n throw new ArgumentError('omitAddress', 'equal true', omitAddress);\n }\n return decode(\n await onAccount.signOracleQueryDelegationToContract(contractAddress, payload, signOpts),\n );\n}\n"],"mappings":"SAASA,MAAM;AAAA,SACNC,aAAa;AAAA,SAGbC,WAAW;AAGpB,SAASC,iBAAiBA,CAACC,EAAU,EAAuC;EAC1E,IAAI,CAACA,EAAE,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,IAAIJ,aAAa,CAAC,IAAI,EAAE,cAAc,EAAEG,EAAE,CAAC;AAC9E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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CAACc,mCAAmC,CAAChB,eAAe,EAAEc,OAAO,EAAEH,QAAQ,CACxF,CAAC;AACH"}
|
package/es/contract/ga.d.ts
CHANGED
|
@@ -8,13 +8,12 @@ import { Encoded } from '../utils/encoder';
|
|
|
8
8
|
import AccountBase from '../account/Base';
|
|
9
9
|
import Contract from './Contract';
|
|
10
10
|
import Node from '../Node';
|
|
11
|
-
import { SendTransactionOptions } from '../
|
|
11
|
+
import { SendTransactionOptions } from '../send-transaction';
|
|
12
12
|
import CompilerBase from './compiler/Base';
|
|
13
13
|
/**
|
|
14
14
|
* Convert current account to GA
|
|
15
15
|
* @category contract
|
|
16
16
|
* @param authFnName - Authorization function name
|
|
17
|
-
* @param sourceCode - Auth contract source code
|
|
18
17
|
* @param args - init arguments
|
|
19
18
|
* @param options - Options
|
|
20
19
|
* @returns General Account Object
|
package/es/contract/ga.mjs
CHANGED
|
@@ -12,29 +12,28 @@ import { decode, encode, Encoding } from "../utils/encoder.mjs";
|
|
|
12
12
|
import { ArgumentError, IllegalArgumentError } from "../utils/errors.mjs";
|
|
13
13
|
import { concatBuffers } from "../utils/other.mjs";
|
|
14
14
|
import Contract from "./Contract.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { getAccount } from "../chain.mjs";
|
|
16
|
+
import { sendTransaction } from "../send-transaction.mjs";
|
|
16
17
|
/**
|
|
17
18
|
* Convert current account to GA
|
|
18
19
|
* @category contract
|
|
19
20
|
* @param authFnName - Authorization function name
|
|
20
|
-
* @param sourceCode - Auth contract source code
|
|
21
21
|
* @param args - init arguments
|
|
22
22
|
* @param options - Options
|
|
23
23
|
* @returns General Account Object
|
|
24
24
|
*/
|
|
25
|
-
export async function createGeneralizedAccount(authFnName, args,
|
|
25
|
+
export async function createGeneralizedAccount(authFnName, args, {
|
|
26
|
+
onAccount,
|
|
27
|
+
onCompiler,
|
|
28
|
+
onNode,
|
|
29
|
+
bytecode,
|
|
30
|
+
aci,
|
|
31
|
+
sourceCodePath,
|
|
32
|
+
sourceCode,
|
|
33
|
+
fileSystem,
|
|
34
|
+
...options
|
|
35
|
+
}) {
|
|
26
36
|
var _options$gasLimit;
|
|
27
|
-
let {
|
|
28
|
-
onAccount,
|
|
29
|
-
onCompiler,
|
|
30
|
-
onNode,
|
|
31
|
-
bytecode,
|
|
32
|
-
aci,
|
|
33
|
-
sourceCodePath,
|
|
34
|
-
sourceCode,
|
|
35
|
-
fileSystem,
|
|
36
|
-
...options
|
|
37
|
-
} = _ref;
|
|
38
37
|
const ownerId = onAccount.address;
|
|
39
38
|
if ((await getAccount(ownerId, {
|
|
40
39
|
onNode
|
|
@@ -52,6 +51,7 @@ export async function createGeneralizedAccount(authFnName, args, _ref) {
|
|
|
52
51
|
fileSystem
|
|
53
52
|
});
|
|
54
53
|
const tx = await buildTxAsync({
|
|
54
|
+
_isInternalBuild: true,
|
|
55
55
|
...options,
|
|
56
56
|
tag: Tag.GaAttachTx,
|
|
57
57
|
onNode,
|
|
@@ -61,7 +61,6 @@ export async function createGeneralizedAccount(authFnName, args, _ref) {
|
|
|
61
61
|
callData: contract._calldata.encode(contract._name, 'init', args),
|
|
62
62
|
authFun: hash(authFnName)
|
|
63
63
|
});
|
|
64
|
-
const contractId = buildContractIdByContractTx(tx);
|
|
65
64
|
const {
|
|
66
65
|
hash: transaction,
|
|
67
66
|
rawTx
|
|
@@ -71,6 +70,7 @@ export async function createGeneralizedAccount(authFnName, args, _ref) {
|
|
|
71
70
|
onCompiler,
|
|
72
71
|
...options
|
|
73
72
|
});
|
|
73
|
+
const contractId = buildContractIdByContractTx(rawTx);
|
|
74
74
|
return Object.freeze({
|
|
75
75
|
owner: ownerId,
|
|
76
76
|
transaction,
|
|
@@ -88,12 +88,11 @@ export async function createGeneralizedAccount(authFnName, args, _ref) {
|
|
|
88
88
|
* @param options.onNode - Node to use
|
|
89
89
|
* @returns Transaction hash
|
|
90
90
|
*/
|
|
91
|
-
export async function buildAuthTxHash(transaction,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
} = _ref2;
|
|
91
|
+
export async function buildAuthTxHash(transaction, {
|
|
92
|
+
fee,
|
|
93
|
+
gasPrice,
|
|
94
|
+
onNode
|
|
95
|
+
}) {
|
|
97
96
|
const {
|
|
98
97
|
nodeNetworkId,
|
|
99
98
|
consensusProtocolVersion
|
|
@@ -120,10 +119,9 @@ export async function buildAuthTxHash(transaction, _ref2) {
|
|
|
120
119
|
* @param options.onNode - Node to use
|
|
121
120
|
* @returns Transaction hash
|
|
122
121
|
*/
|
|
123
|
-
export async function buildAuthTxHashByGaMetaTx(transaction,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} = _ref3;
|
|
122
|
+
export async function buildAuthTxHashByGaMetaTx(transaction, {
|
|
123
|
+
onNode
|
|
124
|
+
}) {
|
|
127
125
|
const txParams = unpackTx(transaction, Tag.SignedTx);
|
|
128
126
|
if (txParams.encodedTx.tag !== Tag.GaMetaTx) {
|
|
129
127
|
throw new ArgumentError('transaction', 'to include GaMetaTx', Tag[txParams.encodedTx.tag]);
|
package/es/contract/ga.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ga.mjs","names":["ConsensusProtocolVersion","Tag","buildContractIdByContractTx","buildTx","buildTxAsync","unpackTx","hash","decode","encode","Encoding","ArgumentError","IllegalArgumentError","concatBuffers","Contract","
|
|
1
|
+
{"version":3,"file":"ga.mjs","names":["ConsensusProtocolVersion","Tag","buildContractIdByContractTx","buildTx","buildTxAsync","unpackTx","hash","decode","encode","Encoding","ArgumentError","IllegalArgumentError","concatBuffers","Contract","getAccount","sendTransaction","createGeneralizedAccount","authFnName","args","onAccount","onCompiler","onNode","bytecode","aci","sourceCodePath","sourceCode","fileSystem","options","_options$gasLimit","ownerId","address","kind","contract","initialize","tx","_isInternalBuild","tag","GaAttachTx","code","$compile","gasLimit","_estimateGas","callData","_calldata","_name","authFun","transaction","rawTx","contractId","Object","freeze","owner","gaContractId","buildAuthTxHash","fee","gasPrice","nodeNetworkId","consensusProtocolVersion","getNodeInfo","payload","_Buffer","from","Ceres","GaMetaTxAuthData","txHash","TxHash","buildAuthTxHashByGaMetaTx","txParams","SignedTx","encodedTx","GaMetaTx"],"sources":["../../src/contract/ga.ts"],"sourcesContent":["/**\n * Generalized Account module - routines to use generalized account\n */\n\nimport { ConsensusProtocolVersion, Int, Tag } from '../tx/builder/constants';\nimport {\n buildContractIdByContractTx, buildTx, buildTxAsync, BuildTxOptions, unpackTx,\n} from '../tx/builder';\nimport { hash } from '../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport { ArgumentError, IllegalArgumentError } from '../utils/errors';\nimport { concatBuffers } from '../utils/other';\nimport AccountBase from '../account/Base';\nimport Contract from './Contract';\nimport Node from '../Node';\nimport { getAccount } from '../chain';\nimport { sendTransaction, SendTransactionOptions } from '../send-transaction';\nimport CompilerBase from './compiler/Base';\n\n/**\n * Convert current account to GA\n * @category contract\n * @param authFnName - Authorization function name\n * @param args - init arguments\n * @param options - Options\n * @returns General Account Object\n */\nexport async function createGeneralizedAccount(\n authFnName: string,\n args: any[],\n {\n onAccount, onCompiler, onNode, bytecode, aci, sourceCodePath, sourceCode, fileSystem, ...options\n }: CreateGeneralizedAccountOptions,\n): Promise<Readonly<{\n owner: Encoded.AccountAddress;\n transaction: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n gaContractId: Encoded.ContractAddress;\n }>> {\n const ownerId = onAccount.address;\n if ((await getAccount(ownerId, { onNode })).kind === 'generalized') {\n throw new IllegalArgumentError(`Account ${ownerId} is already GA`);\n }\n\n const contract = await Contract.initialize<{ init: (...a: any[]) => void }>({\n onAccount, onCompiler, onNode, bytecode, aci, sourceCodePath, sourceCode, fileSystem,\n });\n\n const tx = await buildTxAsync({\n _isInternalBuild: true,\n ...options,\n tag: Tag.GaAttachTx,\n onNode,\n code: await contract.$compile(),\n gasLimit: options.gasLimit ?? await contract._estimateGas('init', args, options),\n ownerId,\n callData: contract._calldata.encode(contract._name, 'init', args),\n authFun: hash(authFnName),\n });\n const { hash: transaction, rawTx } = await sendTransaction(tx, {\n onNode, onAccount, onCompiler, ...options,\n });\n const contractId = buildContractIdByContractTx(rawTx);\n\n return Object.freeze({\n owner: ownerId,\n transaction,\n rawTx,\n gaContractId: contractId,\n });\n}\n\ninterface CreateGeneralizedAccountOptions extends\n BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,\n SendTransactionOptions,\n Pick<\n Parameters<typeof Contract.initialize>[0],\n 'bytecode' | 'aci' | 'sourceCodePath' | 'sourceCode' | 'fileSystem'\n > {\n onAccount: AccountBase;\n onCompiler: CompilerBase;\n onNode: Node;\n gasLimit?: number;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx payload\n * @category contract\n * @param transaction - tx-encoded transaction\n * @param options - Options\n * @param options.fee - GaMetaTx fee, required in Ceres\n * @param options.gasPrice - GaMetaTx gasPrice, required in Ceres\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHash(\n transaction: Encoded.Transaction,\n { fee, gasPrice, onNode }: { fee?: Int; gasPrice?: Int; onNode: Node },\n): Promise<Buffer> {\n const { nodeNetworkId, consensusProtocolVersion } = await onNode.getNodeInfo();\n let payload = hash(concatBuffers([Buffer.from(nodeNetworkId), decode(transaction)]));\n if (consensusProtocolVersion === ConsensusProtocolVersion.Ceres) {\n if (fee == null) throw new ArgumentError('fee', 'provided (in Ceres)', fee);\n if (gasPrice == null) throw new ArgumentError('gasPrice', 'provided (in Ceres)', gasPrice);\n payload = hash(decode(buildTx({\n tag: Tag.GaMetaTxAuthData,\n fee,\n gasPrice,\n txHash: encode(payload, Encoding.TxHash),\n })));\n }\n return payload;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash` by GaMetaTx\n * @category contract\n * @param transaction - tx-encoded signed GaMeta transaction\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHashByGaMetaTx(\n transaction: Encoded.Transaction,\n { onNode }: { onNode: Node },\n): Promise<Buffer> {\n const txParams = unpackTx(transaction, Tag.SignedTx);\n if (txParams.encodedTx.tag !== Tag.GaMetaTx) {\n throw new ArgumentError('transaction', 'to include GaMetaTx', Tag[txParams.encodedTx.tag]);\n }\n return buildAuthTxHash(buildTx(txParams.encodedTx.tx.encodedTx), {\n fee: txParams.encodedTx.fee,\n gasPrice: txParams.encodedTx.gasPrice,\n onNode,\n });\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AAFA,SAISA,wBAAwB,EAAOC,GAAG;AAAA,SAEzCC,2BAA2B,EAAEC,OAAO,EAAEC,YAAY,EAAkBC,QAAQ;AAAA,SAErEC,IAAI;AAAA,SAEXC,MAAM,EAAEC,MAAM,EAAWC,QAAQ;AAAA,SAE1BC,aAAa,EAAEC,oBAAoB;AAAA,SACnCC,aAAa;AAAA,OAEfC,QAAQ;AAAA,SAENC,UAAU;AAAA,SACVC,eAAe;AAGxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,wBAAwBA,CAC5CC,UAAkB,EAClBC,IAAW,EACX;EACEC,SAAS;EAAEC,UAAU;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,GAAG;EAAEC,cAAc;EAAEC,UAAU;EAAEC,UAAU;EAAE,GAAGC;AAC1D,CAAC,EAM9B;EAAA,IAAAC,iBAAA;EACJ,MAAMC,OAAO,GAAGV,SAAS,CAACW,OAAO;EACjC,IAAI,CAAC,MAAMhB,UAAU,CAACe,OAAO,EAAE;IAAER;EAAO,CAAC,CAAC,EAAEU,IAAI,KAAK,aAAa,EAAE;IAClE,MAAM,IAAIpB,oBAAoB,CAAE,WAAUkB,OAAQ,gBAAe,CAAC;EACpE;EAEA,MAAMG,QAAQ,GAAG,MAAMnB,QAAQ,CAACoB,UAAU,CAAkC;IAC1Ed,SAAS;IAAEC,UAAU;IAAEC,MAAM;I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AS,CAACf,GAAG;IAC3BC,QAAQ,EAAEY,QAAQ,CAACE,SAAS,CAACd,QAAQ;IACrClC;EACF,CAAC,CAAC;AACJ"}
|
package/es/deprecated.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { AciValue } from './utils/typed-data';
|
|
2
|
+
import { Encoded } from './utils/encoder';
|
|
1
3
|
import { RpcError } from './aepp-wallet-communication/schema';
|
|
4
|
+
import { ORACLE_TTL_TYPES } from './tx/builder/schema';
|
|
2
5
|
/**
|
|
3
6
|
* @category exception
|
|
4
7
|
* @deprecated this exception is not thrown anymore
|
|
@@ -12,3 +15,48 @@ export declare class RpcBroadcastError extends RpcError {
|
|
|
12
15
|
* @deprecated use isAuctionName instead
|
|
13
16
|
*/
|
|
14
17
|
export declare const NAME_BID_MAX_LENGTH = 12;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated use ContractByteArrayEncoder:encodeWithType from \@aeternity/aepp-calldata
|
|
20
|
+
*/
|
|
21
|
+
export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use ContractByteArrayEncoder:decodeWithType from \@aeternity/aepp-calldata
|
|
24
|
+
*/
|
|
25
|
+
export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): any;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated inlined in buildTx or use `180000`
|
|
28
|
+
*/
|
|
29
|
+
export declare const NAME_TTL = 180000;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated inlined in buildTx or use `36000`
|
|
32
|
+
*/
|
|
33
|
+
export declare const NAME_MAX_TTL = 36000;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated inlined in buildTx or use `60 * 60`
|
|
36
|
+
*/
|
|
37
|
+
export declare const NAME_MAX_CLIENT_TTL: number;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated inlined in buildTx or use `60 * 60`
|
|
40
|
+
*/
|
|
41
|
+
export declare const CLIENT_TTL: number;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 500 }`
|
|
44
|
+
*/
|
|
45
|
+
export declare const ORACLE_TTL: {
|
|
46
|
+
type: ORACLE_TTL_TYPES;
|
|
47
|
+
value: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
|
|
51
|
+
*/
|
|
52
|
+
export declare const QUERY_TTL: {
|
|
53
|
+
type: ORACLE_TTL_TYPES;
|
|
54
|
+
value: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
|
|
58
|
+
*/
|
|
59
|
+
export declare const RESPONSE_TTL: {
|
|
60
|
+
type: ORACLE_TTL_TYPES;
|
|
61
|
+
value: number;
|
|
62
|
+
};
|
package/es/deprecated.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
|
+
import _aeternityAeppCalldata from '@aeternity/aepp-calldata';
|
|
3
|
+
const {
|
|
4
|
+
TypeResolver,
|
|
5
|
+
ContractByteArrayEncoder
|
|
6
|
+
} = _aeternityAeppCalldata;
|
|
2
7
|
import { RpcError } from "./aepp-wallet-communication/schema.mjs";
|
|
8
|
+
import { ORACLE_TTL_TYPES } from "./tx/builder/schema.mjs";
|
|
3
9
|
/**
|
|
4
10
|
* @category exception
|
|
5
11
|
* @deprecated this exception is not thrown anymore
|
|
6
12
|
*/
|
|
7
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
8
13
|
export class RpcBroadcastError extends RpcError {
|
|
9
14
|
constructor(data) {
|
|
10
15
|
super('Broadcast failed');
|
|
@@ -19,4 +24,64 @@ export class RpcBroadcastError extends RpcError {
|
|
|
19
24
|
*/
|
|
20
25
|
_defineProperty(RpcBroadcastError, "code", 3);
|
|
21
26
|
export const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated use ContractByteArrayEncoder:encodeWithType from \@aeternity/aepp-calldata
|
|
30
|
+
*/
|
|
31
|
+
export function encodeFateValue(value, aci) {
|
|
32
|
+
const valueType = new TypeResolver().resolveType(aci, {});
|
|
33
|
+
return new ContractByteArrayEncoder().encodeWithType(value, valueType);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated use ContractByteArrayEncoder:decodeWithType from \@aeternity/aepp-calldata
|
|
38
|
+
*/
|
|
39
|
+
export function decodeFateValue(value, aci) {
|
|
40
|
+
const valueType = new TypeResolver().resolveType(aci, {});
|
|
41
|
+
return new ContractByteArrayEncoder().decodeWithType(value, valueType);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated inlined in buildTx or use `180000`
|
|
46
|
+
*/
|
|
47
|
+
export const NAME_TTL = 180000;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated inlined in buildTx or use `36000`
|
|
51
|
+
*/
|
|
52
|
+
export const NAME_MAX_TTL = 36000;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated inlined in buildTx or use `60 * 60`
|
|
56
|
+
*/
|
|
57
|
+
export const NAME_MAX_CLIENT_TTL = 60 * 60;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated inlined in buildTx or use `60 * 60`
|
|
61
|
+
*/
|
|
62
|
+
export const CLIENT_TTL = NAME_MAX_CLIENT_TTL;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 500 }`
|
|
66
|
+
*/
|
|
67
|
+
export const ORACLE_TTL = {
|
|
68
|
+
type: ORACLE_TTL_TYPES.delta,
|
|
69
|
+
value: 500
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
|
|
74
|
+
*/
|
|
75
|
+
export const QUERY_TTL = {
|
|
76
|
+
type: ORACLE_TTL_TYPES.delta,
|
|
77
|
+
value: 10
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`
|
|
82
|
+
*/
|
|
83
|
+
export const RESPONSE_TTL = {
|
|
84
|
+
type: ORACLE_TTL_TYPES.delta,
|
|
85
|
+
value: 10
|
|
86
|
+
};
|
|
22
87
|
//# sourceMappingURL=deprecated.mjs.map
|
package/es/deprecated.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.mjs","names":["RpcError","RpcBroadcastError","constructor","data","_defineProperty","name","NAME_BID_MAX_LENGTH"],"sources":["../src/deprecated.ts"],"sourcesContent":["import { RpcError } from './aepp-wallet-communication/schema';\n\n/**\n * @category exception\n * @deprecated this exception is not thrown anymore\n */\
|
|
1
|
+
{"version":3,"file":"deprecated.mjs","names":["_aeternityAeppCalldata","TypeResolver","ContractByteArrayEncoder","RpcError","ORACLE_TTL_TYPES","RpcBroadcastError","constructor","data","_defineProperty","name","NAME_BID_MAX_LENGTH","encodeFateValue","value","aci","valueType","resolveType","encodeWithType","decodeFateValue","decodeWithType","NAME_TTL","NAME_MAX_TTL","NAME_MAX_CLIENT_TTL","CLIENT_TTL","ORACLE_TTL","type","delta","QUERY_TTL","RESPONSE_TTL"],"sources":["../src/deprecated.ts"],"sourcesContent":["import { TypeResolver, ContractByteArrayEncoder } from '@aeternity/aepp-calldata';\nimport { AciValue } from './utils/typed-data';\nimport { Encoded } from './utils/encoder';\nimport { RpcError } from './aepp-wallet-communication/schema';\nimport { ORACLE_TTL_TYPES } from './tx/builder/schema';\n\n/**\n * @category exception\n * @deprecated this exception is not thrown anymore\n */\nexport class RpcBroadcastError extends RpcError {\n static override code = 3;\n\n override code = 3;\n\n constructor(data?: any) {\n super('Broadcast failed');\n this.data = data;\n this.name = 'RpcBroadcastError';\n }\n}\n\n/**\n * @deprecated use isAuctionName instead\n */\nexport const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid\n\n/**\n * @deprecated use ContractByteArrayEncoder:encodeWithType from \\@aeternity/aepp-calldata\n */\nexport function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray {\n const valueType = new TypeResolver().resolveType(aci, {});\n return new ContractByteArrayEncoder().encodeWithType(value, valueType);\n}\n\n/**\n * @deprecated use ContractByteArrayEncoder:decodeWithType from \\@aeternity/aepp-calldata\n */\nexport function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): any {\n const valueType = new TypeResolver().resolveType(aci, {});\n return new ContractByteArrayEncoder().decodeWithType(value, valueType);\n}\n\n/**\n * @deprecated inlined in buildTx or use `180000`\n */\nexport const NAME_TTL = 180000;\n\n/**\n * @deprecated inlined in buildTx or use `36000`\n */\nexport const NAME_MAX_TTL = 36000;\n\n/**\n * @deprecated inlined in buildTx or use `60 * 60`\n */\nexport const NAME_MAX_CLIENT_TTL = 60 * 60;\n\n/**\n * @deprecated inlined in buildTx or use `60 * 60`\n */\nexport const CLIENT_TTL = NAME_MAX_CLIENT_TTL;\n\n/**\n * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 500 }`\n */\nexport const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };\n\n/**\n * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`\n */\nexport const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\n\n/**\n * @deprecated inlined in buildTx or use `{ type: ORACLE_TTL_TYPES.delta, value: 10 }`\n */\nexport const RESPONSE_TTL = { type: ORACLE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ACA;AACA,OAAO,MAAMC,UAAU,GAAGD,mBAAmB;;AAE7C;AACA;AACA;AACA,OAAO,MAAME,UAAU,GAAG;EAAEC,IAAI,EAAEpB,gBAAgB,CAACqB,KAAK;EAAEb,KAAK,EAAE;AAAI,CAAC;;AAEtE;AACA;AACA;AACA,OAAO,MAAMc,SAAS,GAAG;EAAEF,IAAI,EAAEpB,gBAAgB,CAACqB,KAAK;EAAEb,KAAK,EAAE;AAAG,CAAC;;AAEpE;AACA;AACA;AACA,OAAO,MAAMe,YAAY,GAAG;EAAEH,IAAI,EAAEpB,gBAAgB,CAACqB,KAAK;EAAEb,KAAK,EAAE;AAAG,CAAC"}
|
package/es/index-browser.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
export { _getPollInterval,
|
|
1
|
+
export { _getPollInterval, getHeight, poll, awaitHeight, waitForTxConfirm, getAccount, getBalance, getCurrentGeneration, getGeneration, getMicroBlockTransactions, getKeyBlock, getMicroBlockHeader, txDryRun, getContractByteCode, getContract, getName, resolveName, } from './chain';
|
|
2
|
+
export { InvalidTxError, sendTransaction } from './send-transaction';
|
|
2
3
|
export { getAddressFromPriv, isAddressValid, genSalt, encodeUnsigned, hash, encodeContractAddress, generateKeyPairFromSecret, generateKeyPair, sign, verify, messageToHash, signMessage, verifyMessage, isValidKeypair, } from './utils/crypto';
|
|
4
|
+
export { signJwt, unpackJwt, verifyJwt, isJwt, ensureJwt, } from './utils/jwt';
|
|
5
|
+
export type { Jwt } from './utils/jwt';
|
|
3
6
|
export { recover, dump } from './utils/keystore';
|
|
4
7
|
export type { Keystore } from './utils/keystore';
|
|
5
8
|
export { toBytes } from './utils/bytes';
|
|
6
9
|
export { buildTx, buildTxAsync, buildTxHash, unpackTx, buildContractIdByContractTx, } from './tx/builder';
|
|
7
10
|
export { buildContractId, oracleQueryId, produceNameId, commitmentHash, readInt, isNameValid, ensureName, getDefaultPointerKey, getMinimumNameFee, computeBidFee, computeAuctionEndBlock, isAuctionName, } from './tx/builder/helpers';
|
|
8
|
-
export { MAX_AUTH_FUN_GAS,
|
|
11
|
+
export { MAX_AUTH_FUN_GAS, MIN_GAS_PRICE, NAME_FEE_MULTIPLIER, NAME_FEE_BID_INCREMENT, NAME_BID_TIMEOUT_BLOCKS, NAME_MAX_LENGTH_FEE, NAME_BID_RANGES, ConsensusProtocolVersion, VmVersion, AbiVersion, Tag, DRY_RUN_ACCOUNT, } from './tx/builder/constants';
|
|
9
12
|
export type { Int, AensName } from './tx/builder/constants';
|
|
10
|
-
export { ORACLE_TTL_TYPES,
|
|
13
|
+
export { ORACLE_TTL_TYPES, CallReturnType } from './tx/builder/schema';
|
|
14
|
+
export { DelegationTag } from './tx/builder/delegation/schema';
|
|
15
|
+
export { packDelegation, unpackDelegation } from './tx/builder/delegation';
|
|
11
16
|
export { getExecutionCost, getExecutionCostBySignedTx, getExecutionCostUsingNode, } from './tx/execution-cost';
|
|
12
17
|
export { default as getTransactionSignerAddress } from './tx/transaction-signer';
|
|
13
18
|
export { AE_AMOUNT_FORMATS, formatAmount, toAe, toAettos, prefixedAmount, } from './utils/amount-formatter';
|
|
14
19
|
export { DerivationError, deriveChild, derivePathFromKey, getMasterKeyFromSeed, derivePathFromSeed, getKeyPair, generateSaveHDWalletFromSeed, getSaveHDWalletAccounts, getHdWalletAccountFromSeed, } from './utils/hd-wallet';
|
|
15
20
|
export { encode, decode, Encoding, Encoded, } from './utils/encoder';
|
|
16
|
-
export {
|
|
21
|
+
export { hashTypedData, hashDomain, hashJson } from './utils/typed-data';
|
|
17
22
|
export { aensRevoke, aensUpdate, aensTransfer, aensQuery, aensClaim, aensPreclaim, aensBid, } from './aens';
|
|
18
23
|
export { default as Contract } from './contract/Contract';
|
|
19
24
|
export type { ContractMethodsBase } from './contract/Contract';
|
|
@@ -42,5 +47,5 @@ export { MESSAGE_DIRECTION, WALLET_TYPE, SUBSCRIPTION_TYPES, METHODS, RPC_STATUS
|
|
|
42
47
|
export { default as walletDetector } from './aepp-wallet-communication/wallet-detector';
|
|
43
48
|
export { default as BrowserRuntimeConnection } from './aepp-wallet-communication/connection/BrowserRuntime';
|
|
44
49
|
export { default as BrowserWindowMessageConnection } from './aepp-wallet-communication/connection/BrowserWindowMessage';
|
|
45
|
-
export { BaseError, AccountError, AensError, AeppError, ChannelError, CompilerError, ContractError, CryptographyError, NodeError, TransactionError, WalletError, ArgumentError, IllegalArgumentError, ArgumentCountMismatchError, InsufficientBalanceError, MissingParamError, NoSerializerFoundError, RequestTimedOutError, TxTimedOutError, TypeError, UnsupportedPlatformError, UnsupportedProtocolError, NotImplementedError, UnsupportedVersionError, InternalError, UnexpectedTsError, UnavailableAccountError, AensPointerContextError, InsufficientNameFeeError, InvalidAensNameError, InvalidRpcMessageError, MissingCallbackError, UnAuthorizedAccountError, UnknownRpcClientError, UnsubscribedAccountError, ChannelCallError, ChannelConnectionError, ChannelPingTimedOutError, UnexpectedChannelMessageError, ChannelIncomingMessageError, UnknownChannelStateError, InvalidAuthDataError, BytecodeMismatchError, DuplicateContractError, InactiveContractError, InvalidMethodInvocationError, MissingContractAddressError, MissingContractDefError, MissingFunctionNameError, NodeInvocationError, NoSuchContractFunctionError, NotPayableFunctionError, MissingEventDefinitionError, AmbiguousEventDefinitionError, InvalidChecksumError, InvalidPasswordError, MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownNodeLengthError, UnknownPathNibbleError, DuplicateNodeError, NodeNotFoundError, DecodeError, PayloadLengthError, DryRunError, IllegalBidFeeError, InvalidSignatureError, PrefixNotFoundError, SchemaNotFoundError, TagNotFoundError, TxNotInChainError, AlreadyConnectedError, NoWalletConnectedError, RpcConnectionError, } from './utils/errors';
|
|
46
|
-
export { RpcBroadcastError, NAME_BID_MAX_LENGTH } from './deprecated';
|
|
50
|
+
export { BaseError, AccountError, AensError, AeppError, ChannelError, CompilerError, ContractError, CryptographyError, NodeError, TransactionError, WalletError, ArgumentError, IllegalArgumentError, ArgumentCountMismatchError, InsufficientBalanceError, MissingParamError, NoSerializerFoundError, RequestTimedOutError, TxTimedOutError, TypeError, UnsupportedPlatformError, UnsupportedProtocolError, NotImplementedError, UnsupportedVersionError, LogicError, InternalError, UnexpectedTsError, UnavailableAccountError, AensPointerContextError, InsufficientNameFeeError, InvalidAensNameError, InvalidRpcMessageError, MissingCallbackError, UnAuthorizedAccountError, UnknownRpcClientError, UnsubscribedAccountError, ChannelCallError, ChannelConnectionError, ChannelPingTimedOutError, UnexpectedChannelMessageError, ChannelIncomingMessageError, UnknownChannelStateError, InvalidAuthDataError, BytecodeMismatchError, DuplicateContractError, InactiveContractError, InvalidMethodInvocationError, MissingContractAddressError, MissingContractDefError, MissingFunctionNameError, NodeInvocationError, NoSuchContractFunctionError, NotPayableFunctionError, MissingEventDefinitionError, AmbiguousEventDefinitionError, InvalidChecksumError, InvalidPasswordError, MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownNodeLengthError, UnknownPathNibbleError, DuplicateNodeError, NodeNotFoundError, DecodeError, PayloadLengthError, DryRunError, IllegalBidFeeError, InvalidSignatureError, PrefixNotFoundError, SchemaNotFoundError, TagNotFoundError, TxNotInChainError, AlreadyConnectedError, NoWalletConnectedError, RpcConnectionError, } from './utils/errors';
|
|
51
|
+
export { RpcBroadcastError, NAME_BID_MAX_LENGTH, encodeFateValue, decodeFateValue, NAME_TTL, NAME_MAX_TTL, NAME_MAX_CLIENT_TTL, CLIENT_TTL, ORACLE_TTL, QUERY_TTL, RESPONSE_TTL, } from './deprecated';
|