@aeternity/aepp-sdk 10.0.0 → 12.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/LICENSE +1 -1
- package/README.md +15 -14
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +13 -40
- 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 +1 -1
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +37 -0
- package/es/AeSdk.mjs +81 -0
- package/es/AeSdk.mjs.map +1 -0
- package/es/AeSdkAepp.d.ts +69 -0
- package/es/AeSdkAepp.mjs +175 -0
- package/es/AeSdkAepp.mjs.map +1 -0
- package/es/AeSdkBase.d.ts +212 -0
- package/es/AeSdkBase.mjs +310 -0
- package/es/AeSdkBase.mjs.map +1 -0
- package/es/AeSdkWallet.d.ts +103 -0
- package/es/AeSdkWallet.mjs +322 -0
- package/es/AeSdkWallet.mjs.map +1 -0
- package/es/Node.d.ts +44 -0
- package/es/Node.mjs +141 -0
- package/es/Node.mjs.map +1 -0
- package/es/account/Base.d.ts +65 -0
- package/es/account/Base.mjs +123 -0
- package/es/account/Base.mjs.map +1 -0
- package/es/account/Memory.d.ts +25 -0
- package/es/account/Memory.mjs +81 -0
- package/es/account/Memory.mjs.map +1 -0
- package/es/account/Rpc.d.ts +27 -0
- package/es/account/Rpc.mjs +79 -0
- package/es/account/Rpc.mjs.map +1 -0
- package/es/aens.d.ts +209 -0
- package/es/aens.mjs +332 -0
- package/es/aens.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/Browser.d.ts +32 -0
- package/es/aepp-wallet-communication/connection/Browser.mjs +70 -0
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +17 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +57 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +35 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +142 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -0
- package/es/aepp-wallet-communication/connection-proxy.d.ts +10 -0
- package/{src/utils/crypto-ts.ts → es/aepp-wallet-communication/connection-proxy.mjs} +15 -11
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +33 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +169 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -0
- package/es/aepp-wallet-communication/rpc/types.d.ts +77 -0
- package/es/aepp-wallet-communication/rpc/types.mjs +3 -0
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -0
- package/es/aepp-wallet-communication/schema.d.ts +118 -0
- package/es/aepp-wallet-communication/schema.mjs +214 -0
- package/es/aepp-wallet-communication/schema.mjs.map +1 -0
- package/es/aepp-wallet-communication/wallet-detector.d.ts +24 -0
- package/es/aepp-wallet-communication/wallet-detector.mjs +63 -0
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -0
- package/es/apis/compiler/compiler.d.ts +92 -0
- package/es/apis/compiler/compiler.mjs +576 -0
- package/es/apis/compiler/compiler.mjs.map +1 -0
- package/es/apis/compiler/index.d.ts +2 -0
- package/es/apis/compiler/index.mjs +3 -0
- package/es/apis/compiler/index.mjs.map +1 -0
- package/es/apis/compiler/models/index.d.ts +248 -0
- package/es/apis/compiler/models/index.mjs +48 -0
- package/es/apis/compiler/models/index.mjs.map +1 -0
- package/es/apis/compiler/models/mappers.d.ts +23 -0
- package/es/apis/compiler/models/mappers.mjs +585 -0
- package/es/apis/compiler/models/mappers.mjs.map +1 -0
- package/es/apis/compiler/models/parameters.d.ts +13 -0
- package/es/apis/compiler/models/parameters.mjs +71 -0
- package/es/apis/compiler/models/parameters.mjs.map +1 -0
- package/es/apis/node/index.d.ts +2 -0
- package/es/apis/node/index.mjs +3 -0
- package/es/apis/node/index.mjs.map +1 -0
- package/es/apis/node/models/index.d.ts +1061 -0
- package/es/apis/node/models/index.mjs +2 -0
- package/es/apis/node/models/index.mjs.map +1 -0
- package/es/apis/node/models/mappers.d.ts +95 -0
- package/es/apis/node/models/mappers.mjs +4164 -0
- package/es/apis/node/models/mappers.mjs.map +1 -0
- package/es/apis/node/models/parameters.d.ts +17 -0
- package/es/apis/node/models/parameters.mjs +165 -0
- package/es/apis/node/models/parameters.mjs.map +1 -0
- package/es/apis/node/node.d.ts +215 -0
- package/es/apis/node/node.mjs +1165 -0
- package/es/apis/node/node.mjs.map +1 -0
- package/es/chain.d.ts +220 -0
- package/es/chain.mjs +524 -0
- package/es/chain.mjs.map +1 -0
- package/es/channel/handlers.d.ts +34 -0
- package/es/channel/{handlers.js → handlers.mjs} +163 -130
- package/es/channel/handlers.mjs.map +1 -0
- package/es/channel/index.d.ts +634 -0
- package/es/channel/index.mjs +978 -0
- package/es/channel/index.mjs.map +1 -0
- package/es/channel/internal.d.ts +100 -0
- package/es/channel/internal.mjs +328 -0
- package/es/channel/internal.mjs.map +1 -0
- package/es/contract/Compiler.d.ts +17 -0
- package/es/contract/Compiler.mjs +67 -0
- package/es/contract/Compiler.mjs.map +1 -0
- package/es/contract/aci.d.ts +125 -0
- package/es/contract/aci.mjs +496 -0
- package/es/contract/aci.mjs.map +1 -0
- package/es/contract/ga.d.ts +68 -0
- package/es/contract/ga.mjs +190 -0
- package/es/contract/ga.mjs.map +1 -0
- package/es/contract/methods.d.ts +68 -0
- package/es/contract/methods.mjs +101 -0
- package/es/contract/methods.mjs.map +1 -0
- package/es/index.d.ts +32 -0
- package/es/index.mjs +49 -0
- package/es/index.mjs.map +1 -0
- package/es/oracle.d.ts +154 -0
- package/es/oracle.mjs +288 -0
- package/es/oracle.mjs.map +1 -0
- package/es/spend.d.ts +61 -0
- package/es/spend.mjs +122 -0
- package/es/spend.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +41 -0
- package/es/tx/builder/constants.mjs +100 -0
- package/es/tx/builder/constants.mjs.map +1 -0
- package/es/tx/builder/field-types.d.ts +62 -0
- package/es/tx/builder/field-types.mjs +126 -0
- package/es/tx/builder/field-types.mjs.map +1 -0
- package/es/tx/builder/helpers.d.ts +131 -0
- package/es/tx/builder/helpers.mjs +223 -0
- package/es/tx/builder/helpers.mjs.map +1 -0
- package/es/tx/builder/index.d.ts +75 -0
- package/es/tx/builder/index.mjs +424 -0
- package/es/tx/builder/index.mjs.map +1 -0
- package/es/tx/builder/schema.d.ts +350 -0
- package/es/tx/builder/schema.mjs +320 -0
- package/es/tx/builder/schema.mjs.map +1 -0
- package/es/tx/index.d.ts +63 -0
- package/es/tx/index.mjs +209 -0
- package/es/tx/index.mjs.map +1 -0
- package/es/tx/min-fee.d.ts +20 -0
- package/es/tx/min-fee.mjs +148 -0
- package/es/tx/min-fee.mjs.map +1 -0
- package/es/tx/validator.d.ts +19 -0
- package/es/tx/validator.mjs +240 -0
- package/es/tx/validator.mjs.map +1 -0
- package/es/typings/@aeternity__argon2-browser/index.d.mjs +2 -0
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -0
- package/es/typings/@aeternity__uuid/index.d.mjs +2 -0
- package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -0
- package/es/typings/bip32-path/index.d.mjs +2 -0
- package/es/typings/bip32-path/index.d.mjs.map +1 -0
- package/es/typings/blakejs/index.d.mjs +2 -0
- package/es/typings/blakejs/index.d.mjs.map +1 -0
- package/es/typings/tweetnacl-auth/index.d.mjs +2 -0
- package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -0
- package/es/utils/amount-formatter.d.ts +42 -0
- package/es/utils/{amount-formatter.js → amount-formatter.mjs} +38 -44
- package/es/utils/amount-formatter.mjs.map +1 -0
- package/es/utils/autorest.d.ts +6 -0
- package/es/utils/autorest.mjs +97 -0
- package/es/utils/autorest.mjs.map +1 -0
- package/es/utils/bignumber.d.ts +13 -0
- package/es/utils/bignumber.mjs +23 -0
- package/es/utils/bignumber.mjs.map +1 -0
- package/es/{bytes.d.ts → utils/bytes.d.ts} +10 -13
- package/es/utils/{bytes.js → bytes.mjs} +26 -22
- package/es/utils/bytes.mjs.map +1 -0
- package/es/utils/crypto.d.ts +103 -0
- package/es/utils/crypto.mjs +221 -0
- package/es/utils/crypto.mjs.map +1 -0
- package/es/utils/encoder.d.ts +26 -0
- package/es/utils/encoder.mjs +102 -0
- package/es/utils/encoder.mjs.map +1 -0
- package/es/utils/errors.d.ts +481 -0
- package/es/utils/errors.mjs +882 -0
- package/es/utils/errors.mjs.map +1 -0
- package/es/utils/hd-wallet.d.ts +34 -0
- package/es/utils/hd-wallet.mjs +122 -0
- package/es/utils/hd-wallet.mjs.map +1 -0
- package/es/utils/json-big.d.ts +5 -0
- package/es/utils/json-big.mjs +41 -0
- package/es/utils/json-big.mjs.map +1 -0
- package/es/utils/keystore.d.ts +51 -0
- package/es/utils/keystore.mjs +145 -0
- package/es/utils/keystore.mjs.map +1 -0
- package/es/{mptree.d.ts → utils/mptree.d.ts} +5 -8
- package/es/utils/{mptree.js → mptree.mjs} +33 -25
- package/es/utils/mptree.mjs.map +1 -0
- package/es/utils/other.d.ts +14 -0
- package/es/utils/other.mjs +28 -0
- package/es/utils/other.mjs.map +1 -0
- package/es/{semver-satisfies.d.ts → utils/semver-satisfies.d.ts} +0 -0
- package/es/utils/{semver-satisfies.js → semver-satisfies.mjs} +1 -1
- package/es/utils/semver-satisfies.mjs.map +1 -0
- package/es/utils/string.d.ts +24 -0
- package/es/utils/{string.js → string.mjs} +9 -11
- package/es/utils/string.mjs.map +1 -0
- package/package.json +67 -64
- package/src/AeSdk.ts +65 -0
- package/src/AeSdkAepp.ts +167 -0
- package/src/AeSdkBase.ts +320 -0
- package/src/AeSdkWallet.ts +332 -0
- package/src/Node.ts +167 -0
- package/src/account/Base.ts +114 -0
- package/src/account/Memory.ts +83 -0
- package/src/account/Rpc.ts +67 -0
- package/src/aens.ts +391 -0
- package/src/aepp-wallet-communication/connection/Browser.ts +68 -0
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +58 -0
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +111 -0
- package/{es/utils/crypto-ts.js → src/aepp-wallet-communication/connection-proxy.ts} +16 -9
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +137 -0
- package/src/aepp-wallet-communication/rpc/types.ts +66 -0
- package/src/aepp-wallet-communication/schema.ts +181 -0
- package/src/aepp-wallet-communication/wallet-detector.ts +71 -0
- package/src/apis/compiler/code-model-v4.yaml +2649 -0
- package/src/apis/compiler/compiler.ts +585 -0
- package/src/apis/compiler/index.ts +2 -0
- package/src/apis/compiler/models/index.ts +301 -0
- package/src/apis/compiler/models/mappers.ts +583 -0
- package/src/apis/compiler/models/parameters.ts +93 -0
- package/src/apis/node/code-model-v4.yaml +10046 -0
- package/src/apis/node/index.ts +2 -0
- package/src/apis/node/models/index.ts +1253 -0
- package/src/apis/node/models/mappers.ts +4278 -0
- package/src/apis/node/models/parameters.ts +188 -0
- package/src/apis/node/node.ts +1299 -0
- package/src/chain.ts +444 -0
- package/src/channel/{handlers.js → handlers.ts} +238 -143
- package/src/channel/index.ts +991 -0
- package/src/channel/internal.ts +345 -0
- package/src/contract/Compiler.ts +66 -0
- package/src/contract/aci.ts +529 -0
- package/src/contract/ga.ts +178 -0
- package/src/contract/methods.ts +118 -0
- package/src/index.ts +51 -0
- package/src/oracle.ts +342 -0
- package/src/spend.ts +152 -0
- package/src/tx/builder/constants.ts +96 -0
- package/src/tx/builder/field-types.ts +111 -0
- package/src/tx/builder/helpers.ts +253 -0
- package/src/tx/builder/index.ts +394 -0
- package/src/tx/builder/schema.ts +771 -0
- package/src/tx/index.ts +199 -0
- package/src/tx/min-fee.ts +136 -0
- package/src/tx/validator.ts +226 -0
- package/src/typings/@aeternity__argon2-browser/index.d.ts +3 -0
- package/src/typings/@aeternity__uuid/index.d.ts +3 -0
- package/src/typings/bip32-path/index.d.ts +33 -0
- package/src/typings/tweetnacl-auth/index.d.ts +14 -0
- package/src/utils/amount-formatter.ts +29 -41
- package/src/utils/autorest.ts +90 -0
- package/src/utils/bignumber.ts +9 -19
- package/src/utils/bytes.ts +15 -16
- package/src/utils/crypto.ts +217 -0
- package/src/utils/encoder.ts +98 -0
- package/src/utils/errors.ts +817 -0
- package/src/utils/hd-wallet.ts +134 -0
- package/src/utils/json-big.ts +26 -0
- package/src/utils/keystore.ts +179 -0
- package/src/utils/mptree.ts +26 -20
- package/src/utils/other.ts +28 -43
- package/src/utils/string.ts +8 -10
- package/CHANGELOG.md +0 -1603
- package/es/account/base.js +0 -169
- package/es/account/base.js.map +0 -1
- package/es/account/memory.js +0 -84
- package/es/account/memory.js.map +0 -1
- package/es/account/multiple.js +0 -178
- package/es/account/multiple.js.map +0 -1
- package/es/ae/aens.js +0 -408
- package/es/ae/aens.js.map +0 -1
- package/es/ae/aepp.js +0 -45
- package/es/ae/aepp.js.map +0 -1
- package/es/ae/contract.js +0 -312
- package/es/ae/contract.js.map +0 -1
- package/es/ae/index.js +0 -206
- package/es/ae/index.js.map +0 -1
- package/es/ae/oracle.js +0 -322
- package/es/ae/oracle.js.map +0 -1
- package/es/ae/universal.js +0 -45
- package/es/ae/universal.js.map +0 -1
- package/es/ae/wallet.js +0 -50
- package/es/ae/wallet.js.map +0 -1
- package/es/amount-formatter.d.ts +0 -58
- package/es/bignumber.d.ts +0 -24
- package/es/chain/index.js +0 -256
- package/es/chain/index.js.map +0 -1
- package/es/chain/node.js +0 -394
- package/es/chain/node.js.map +0 -1
- package/es/channel/handlers.js.map +0 -1
- package/es/channel/index.js +0 -980
- package/es/channel/index.js.map +0 -1
- package/es/channel/internal.js +0 -266
- package/es/channel/internal.js.map +0 -1
- package/es/contract/aci/helpers.js +0 -298
- package/es/contract/aci/helpers.js.map +0 -1
- package/es/contract/aci/index.js +0 -361
- package/es/contract/aci/index.js.map +0 -1
- package/es/contract/aci/transformation.js +0 -66
- package/es/contract/aci/transformation.js.map +0 -1
- package/es/contract/compiler.js +0 -244
- package/es/contract/compiler.js.map +0 -1
- package/es/contract/ga/helpers.js +0 -22
- package/es/contract/ga/helpers.js.map +0 -1
- package/es/contract/ga/index.js +0 -170
- package/es/contract/ga/index.js.map +0 -1
- package/es/contract/index.js +0 -162
- package/es/contract/index.js.map +0 -1
- package/es/crypto-ts.d.ts +0 -9
- package/es/index.js +0 -57
- package/es/index.js.map +0 -1
- package/es/node-pool/index.js +0 -187
- package/es/node-pool/index.js.map +0 -1
- package/es/node.js +0 -132
- package/es/node.js.map +0 -1
- package/es/other.d.ts +0 -31
- package/es/string.d.ts +0 -26
- package/es/tx/builder/helpers.js +0 -305
- package/es/tx/builder/helpers.js.map +0 -1
- package/es/tx/builder/index.js +0 -595
- package/es/tx/builder/index.js.map +0 -1
- package/es/tx/builder/schema.js +0 -814
- package/es/tx/builder/schema.js.map +0 -1
- package/es/tx/index.js +0 -300
- package/es/tx/index.js.map +0 -1
- package/es/tx/tx-object.js +0 -276
- package/es/tx/tx-object.js.map +0 -1
- package/es/tx/tx.js +0 -937
- package/es/tx/tx.js.map +0 -1
- package/es/tx/validator.js +0 -208
- package/es/tx/validator.js.map +0 -1
- package/es/typings/blakejs/index.d.js +0 -2
- package/es/typings/blakejs/index.d.js.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -131
- package/es/utils/aepp-wallet-communication/connection/browser-runtime.js.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -184
- package/es/utils/aepp-wallet-communication/connection/browser-window-message.js.map +0 -1
- package/es/utils/aepp-wallet-communication/connection/index.js +0 -84
- package/es/utils/aepp-wallet-communication/connection/index.js.map +0 -1
- package/es/utils/aepp-wallet-communication/content-script-bridge.js +0 -97
- package/es/utils/aepp-wallet-communication/content-script-bridge.js.map +0 -1
- package/es/utils/aepp-wallet-communication/helpers.js +0 -103
- package/es/utils/aepp-wallet-communication/helpers.js.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -329
- package/es/utils/aepp-wallet-communication/rpc/aepp-rpc.js.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -270
- package/es/utils/aepp-wallet-communication/rpc/rpc-client.js.map +0 -1
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -533
- package/es/utils/aepp-wallet-communication/rpc/wallet-rpc.js.map +0 -1
- package/es/utils/aepp-wallet-communication/schema.js +0 -107
- package/es/utils/aepp-wallet-communication/schema.js.map +0 -1
- package/es/utils/aepp-wallet-communication/wallet-detector.js +0 -109
- package/es/utils/aepp-wallet-communication/wallet-detector.js.map +0 -1
- package/es/utils/amount-formatter.js.map +0 -1
- package/es/utils/async-init.js +0 -67
- package/es/utils/async-init.js.map +0 -1
- package/es/utils/bignumber.js +0 -28
- package/es/utils/bignumber.js.map +0 -1
- package/es/utils/bytes.js.map +0 -1
- package/es/utils/crypto-ts.js.map +0 -1
- package/es/utils/crypto.js +0 -304
- package/es/utils/crypto.js.map +0 -1
- package/es/utils/hd-wallet.js +0 -112
- package/es/utils/hd-wallet.js.map +0 -1
- package/es/utils/json-big.js +0 -45
- package/es/utils/json-big.js.map +0 -1
- package/es/utils/keystore.js +0 -228
- package/es/utils/keystore.js.map +0 -1
- package/es/utils/mptree.js.map +0 -1
- package/es/utils/other.js +0 -43
- package/es/utils/other.js.map +0 -1
- package/es/utils/semver-satisfies.js.map +0 -1
- package/es/utils/string.js.map +0 -1
- package/es/utils/swagger.js +0 -132
- package/es/utils/swagger.js.map +0 -1
- package/src/account/base.js +0 -153
- package/src/account/memory.js +0 -78
- package/src/account/multiple.js +0 -154
- package/src/ae/aens.js +0 -366
- package/src/ae/aepp.js +0 -45
- package/src/ae/contract.js +0 -285
- package/src/ae/index.js +0 -167
- package/src/ae/oracle.js +0 -296
- package/src/ae/universal.js +0 -47
- package/src/ae/wallet.js +0 -50
- package/src/chain/index.js +0 -250
- package/src/chain/node.js +0 -293
- package/src/channel/index.js +0 -898
- package/src/channel/internal.js +0 -231
- package/src/contract/aci/index.js +0 -317
- package/src/contract/aci/transformation.js +0 -72
- package/src/contract/compiler.js +0 -195
- package/src/contract/ga/helpers.js +0 -17
- package/src/contract/ga/index.js +0 -147
- package/src/contract/index.js +0 -163
- package/src/index.js +0 -90
- package/src/node-pool/index.js +0 -171
- package/src/node.js +0 -118
- package/src/tx/builder/helpers.js +0 -325
- package/src/tx/builder/index.js +0 -460
- package/src/tx/builder/schema.js +0 -1211
- package/src/tx/index.js +0 -301
- package/src/tx/tx-object.js +0 -186
- package/src/tx/tx.js +0 -622
- package/src/tx/validator.js +0 -161
- package/src/utils/aepp-wallet-communication/connection/browser-runtime.js +0 -114
- package/src/utils/aepp-wallet-communication/connection/browser-window-message.js +0 -161
- package/src/utils/aepp-wallet-communication/connection/index.js +0 -85
- package/src/utils/aepp-wallet-communication/content-script-bridge.js +0 -85
- package/src/utils/aepp-wallet-communication/helpers.js +0 -70
- package/src/utils/aepp-wallet-communication/rpc/aepp-rpc.js +0 -268
- package/src/utils/aepp-wallet-communication/rpc/rpc-client.js +0 -223
- package/src/utils/aepp-wallet-communication/rpc/wallet-rpc.js +0 -390
- package/src/utils/aepp-wallet-communication/schema.js +0 -108
- package/src/utils/aepp-wallet-communication/wallet-detector.js +0 -91
- package/src/utils/async-init.js +0 -41
- package/src/utils/crypto.js +0 -312
- package/src/utils/hd-wallet.js +0 -115
- package/src/utils/json-big.js +0 -26
- package/src/utils/keystore.js +0 -223
- package/src/utils/swagger.js +0 -133
package/src/contract/compiler.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2018 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* ContractCompilerAPI module
|
|
20
|
-
*
|
|
21
|
-
* This is the complement to {@link module:@aeternity/aepp-sdk/es/contract}.
|
|
22
|
-
* @module @aeternity/aepp-sdk/es/contract/compiler
|
|
23
|
-
* @export ContractCompilerAPI
|
|
24
|
-
* @example import { ContractCompilerAPI } from '@aeternity/aepp-sdk'
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import ContractBase from './index'
|
|
28
|
-
import semverSatisfies from '../utils/semver-satisfies'
|
|
29
|
-
import AsyncInit from '../utils/async-init'
|
|
30
|
-
import genSwaggerClient from '../utils/swagger'
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Contract Compiler Stamp
|
|
34
|
-
*
|
|
35
|
-
* This stamp include api call's related to contract compiler functionality.
|
|
36
|
-
* @function
|
|
37
|
-
* @alias module:@aeternity/aepp-sdk/es/contract/compiler
|
|
38
|
-
* @rtype Stamp
|
|
39
|
-
* @param {Object} [options={}] - Initializer object
|
|
40
|
-
* @param {String} [options.compilerUrl] compilerUrl - Url for compiler API
|
|
41
|
-
* @return {Object} Contract compiler instance
|
|
42
|
-
* @example ContractCompilerAPI({ compilerUrl: 'COMPILER_URL' })
|
|
43
|
-
*/
|
|
44
|
-
export default AsyncInit.compose(ContractBase, {
|
|
45
|
-
async init ({ compilerUrl, ignoreVersion }) {
|
|
46
|
-
if (!compilerUrl) return
|
|
47
|
-
await this.setCompilerUrl(compilerUrl, { ignoreVersion })
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
async setCompilerUrl (compilerUrl, { ignoreVersion = false } = {}) {
|
|
51
|
-
if (!compilerUrl) throw new Error('"compilerUrl" required')
|
|
52
|
-
compilerUrl = compilerUrl.replace(/\/$/, '')
|
|
53
|
-
const client = await genSwaggerClient(`${compilerUrl}/api`, {
|
|
54
|
-
disableBigNumbers: true,
|
|
55
|
-
disableCaseConversion: true,
|
|
56
|
-
responseInterceptor: response => {
|
|
57
|
-
if (response.ok) return
|
|
58
|
-
let message = `${new URL(response.url).pathname.slice(1)} error`
|
|
59
|
-
if (response.body.reason) {
|
|
60
|
-
message += ': ' + response.body.reason +
|
|
61
|
-
(response.body.parameter ? ` in ${response.body.parameter}` : '') +
|
|
62
|
-
// TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78
|
|
63
|
-
(response.body.info ? ` (${JSON.stringify(response.body.info)})` : '')
|
|
64
|
-
}
|
|
65
|
-
if (Array.isArray(response.body)) {
|
|
66
|
-
message += ':\n' + response.body
|
|
67
|
-
.map(e => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context ? `(${e.context})` : ''}`)
|
|
68
|
-
.map(e => e.trim()) // TODO: remove after fixing https://github.com/aeternity/aesophia_http/issues/80
|
|
69
|
-
.join('\n')
|
|
70
|
-
}
|
|
71
|
-
response.statusText = message
|
|
72
|
-
return response
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
this.compilerVersion = client.spec.info.version
|
|
76
|
-
this._compilerApi = client.api
|
|
77
|
-
|
|
78
|
-
if (ignoreVersion) return
|
|
79
|
-
if (!semverSatisfies(this.compilerVersion, COMPILER_GE_VERSION, COMPILER_LT_VERSION)) {
|
|
80
|
-
throw new Error(`Unsupported compiler version ${this.compilerVersion}. ` +
|
|
81
|
-
`Supported: >= ${COMPILER_GE_VERSION} < ${COMPILER_LT_VERSION}`)
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
_ensureCompilerReady () {
|
|
85
|
-
if (!this._compilerApi) throw new Error('Compiler is not ready')
|
|
86
|
-
},
|
|
87
|
-
_prepareCompilerOptions ({ filesystem = {} } = {}) {
|
|
88
|
-
return { file_system: filesystem }
|
|
89
|
-
},
|
|
90
|
-
getCompilerVersion () {
|
|
91
|
-
this._ensureCompilerReady()
|
|
92
|
-
return Promise.resolve(this.compilerVersion)
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Encode call data for contract call
|
|
96
|
-
* @function
|
|
97
|
-
* @category async
|
|
98
|
-
* @param {String} source Contract source code
|
|
99
|
-
* @param {String} name Name of function to call
|
|
100
|
-
* @param {Array} args Argument's for call
|
|
101
|
-
* @param {Object} [options={}] Options
|
|
102
|
-
* @param {Object} [options.filesystem={}] Contract external namespaces map
|
|
103
|
-
* @return {Promise<String>}
|
|
104
|
-
*/
|
|
105
|
-
async contractEncodeCallDataAPI (source, name, args = [], options) {
|
|
106
|
-
this._ensureCompilerReady()
|
|
107
|
-
const { calldata } = await this._compilerApi.encodeCalldata({
|
|
108
|
-
source,
|
|
109
|
-
function: name,
|
|
110
|
-
arguments: args,
|
|
111
|
-
options: this._prepareCompilerOptions(options)
|
|
112
|
-
})
|
|
113
|
-
return calldata
|
|
114
|
-
},
|
|
115
|
-
async compileContractAPI (code, options) {
|
|
116
|
-
this._ensureCompilerReady()
|
|
117
|
-
const { bytecode } = await this._compilerApi.compileContract({
|
|
118
|
-
code,
|
|
119
|
-
options: this._prepareCompilerOptions(options)
|
|
120
|
-
})
|
|
121
|
-
return bytecode
|
|
122
|
-
},
|
|
123
|
-
contractGetACI (code, options) {
|
|
124
|
-
this._ensureCompilerReady()
|
|
125
|
-
return this._compilerApi.generateACI({ code, options: this._prepareCompilerOptions(options) })
|
|
126
|
-
},
|
|
127
|
-
contractDecodeCallDataByCodeAPI (bytecode, calldata) {
|
|
128
|
-
this._ensureCompilerReady()
|
|
129
|
-
return this._compilerApi.decodeCalldataBytecode({ bytecode, calldata })
|
|
130
|
-
},
|
|
131
|
-
contractDecodeCallDataBySourceAPI (source, fn, callData, options) {
|
|
132
|
-
this._ensureCompilerReady()
|
|
133
|
-
return this._compilerApi.decodeCalldataSource({
|
|
134
|
-
function: fn,
|
|
135
|
-
source,
|
|
136
|
-
calldata: callData,
|
|
137
|
-
options: this._prepareCompilerOptions(options)
|
|
138
|
-
})
|
|
139
|
-
},
|
|
140
|
-
/**
|
|
141
|
-
* Decode contract call result data
|
|
142
|
-
* @function
|
|
143
|
-
* @category async
|
|
144
|
-
* @param {String} source - source code
|
|
145
|
-
* @param {String } fn - function name
|
|
146
|
-
* @param {String} callValue - result call data
|
|
147
|
-
* @param {String} callResult - result status
|
|
148
|
-
* @param {Object} [options={}] Options
|
|
149
|
-
* @param {Object} [options.filesystem={}] Contract external namespaces map
|
|
150
|
-
* @return {Promise<String>} Result object
|
|
151
|
-
* @example
|
|
152
|
-
* const decodedData = await sdk.contractDecodeCallResultAPI(
|
|
153
|
-
* SourceCode ,'functionName', 'cb_asdasdasd...', 'ok|revert'
|
|
154
|
-
* )
|
|
155
|
-
*/
|
|
156
|
-
contractDecodeCallResultAPI (source, fn, callValue, callResult, options) {
|
|
157
|
-
this._ensureCompilerReady()
|
|
158
|
-
return this._compilerApi.decodeCallResult({
|
|
159
|
-
function: fn,
|
|
160
|
-
source,
|
|
161
|
-
'call-result': callResult,
|
|
162
|
-
'call-value': callValue,
|
|
163
|
-
options: this._prepareCompilerOptions(options)
|
|
164
|
-
})
|
|
165
|
-
},
|
|
166
|
-
async validateByteCodeAPI (bytecode, source, options) {
|
|
167
|
-
this._ensureCompilerReady()
|
|
168
|
-
const res = await this._compilerApi.validateByteCode({
|
|
169
|
-
bytecode,
|
|
170
|
-
source,
|
|
171
|
-
options: this._prepareCompilerOptions(options)
|
|
172
|
-
})
|
|
173
|
-
return typeof res === 'object' ? true : res
|
|
174
|
-
},
|
|
175
|
-
getFateAssembler (bytecode, options) {
|
|
176
|
-
this._ensureCompilerReady()
|
|
177
|
-
return this._compilerApi.getFateAssemblerCode(
|
|
178
|
-
{ bytecode, options: this._prepareCompilerOptions(options) }
|
|
179
|
-
)
|
|
180
|
-
},
|
|
181
|
-
getBytecodeCompilerVersion (bytecode, options) {
|
|
182
|
-
this._ensureCompilerReady()
|
|
183
|
-
return this._compilerApi.getCompilerVersion({
|
|
184
|
-
bytecode,
|
|
185
|
-
options: this._prepareCompilerOptions(options)
|
|
186
|
-
})
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
props: {
|
|
190
|
-
compilerVersion: null
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
const COMPILER_GE_VERSION = '6.0.0'
|
|
195
|
-
const COMPILER_LT_VERSION = '7.0.0'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import BigNumber from 'bignumber.js'
|
|
2
|
-
import { MAX_AUTH_FUN_GAS } from '../../tx/builder/schema'
|
|
3
|
-
|
|
4
|
-
export const prepareGaParams = (ins) => async (authData, authFnName) => {
|
|
5
|
-
if (typeof authData !== 'object') throw new Error('AuthData must be an object')
|
|
6
|
-
if (authData.gas && BigNumber(authData.gas).gt(MAX_AUTH_FUN_GAS)) throw new Error(`the maximum gas value for ga authFun is ${MAX_AUTH_FUN_GAS}, got ${authData.gas}`)
|
|
7
|
-
const gas = authData.gas || MAX_AUTH_FUN_GAS
|
|
8
|
-
if (authData.callData) {
|
|
9
|
-
if (authData.callData.split('_')[0] !== 'cb') throw new Error('Auth data must be a string with "cb" prefix.')
|
|
10
|
-
return { authCallData: authData.callData, gas }
|
|
11
|
-
}
|
|
12
|
-
if (!authData.source || !authData.args) throw new Error('Auth data must contain source code and arguments.')
|
|
13
|
-
return {
|
|
14
|
-
authCallData: await ins.contractEncodeCallDataAPI(authData.source, authFnName, authData.args),
|
|
15
|
-
gas
|
|
16
|
-
}
|
|
17
|
-
}
|
package/src/contract/ga/index.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2018 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Generalize Account module - routines to use generalize account
|
|
20
|
-
*
|
|
21
|
-
* @module @aeternity/aepp-sdk/es/contract/ga
|
|
22
|
-
* @export GeneralizeAccount
|
|
23
|
-
* @example import { GeneralizeAccount } from '@aeternity/aepp-sdk'
|
|
24
|
-
*/
|
|
25
|
-
import { ContractAPI } from '../../ae/contract'
|
|
26
|
-
import { TX_TYPE } from '../../tx/builder/schema'
|
|
27
|
-
import { buildTx, unpackTx } from '../../tx/builder'
|
|
28
|
-
import { prepareGaParams } from './helpers'
|
|
29
|
-
import { hash } from '../../utils/crypto'
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* GeneralizeAccount Stamp
|
|
33
|
-
*
|
|
34
|
-
* Provide Generalize Account implementation
|
|
35
|
-
* {@link module:@aeternity/aepp-sdk/es/contract/ga} clients.
|
|
36
|
-
* @function
|
|
37
|
-
* @alias module:@aeternity/aepp-sdk/es/contract/ga
|
|
38
|
-
* @rtype Stamp
|
|
39
|
-
* @param {Object} [options={}] - Initializer object
|
|
40
|
-
* @return {Object} GeneralizeAccount instance
|
|
41
|
-
* @example
|
|
42
|
-
* const authContract = ``
|
|
43
|
-
* await client.createGeneralizeAccount(authFnName, authContract, [...authFnArguments]
|
|
44
|
-
* // Make spend using GA
|
|
45
|
-
* const callData = 'cb_...' // encoded call data for auth contract
|
|
46
|
-
* await client.spend(10000, receiverPub, { authData: { callData } })
|
|
47
|
-
* // or
|
|
48
|
-
* await client.spend(10000, receiverPub, {
|
|
49
|
-
* authData: { source: authContract, args: [...authContractArgs] }
|
|
50
|
-
* }) // sdk will prepare callData itself
|
|
51
|
-
*/
|
|
52
|
-
export const GeneralizeAccount = ContractAPI.compose({
|
|
53
|
-
methods: {
|
|
54
|
-
createGeneralizeAccount,
|
|
55
|
-
createMetaTx,
|
|
56
|
-
isGA
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
export default GeneralizeAccount
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @alias module:@aeternity/aepp-sdk/es/contract/ga
|
|
63
|
-
* @function
|
|
64
|
-
* Check if account is GA account
|
|
65
|
-
* @param {String} address - Account address
|
|
66
|
-
* @return {Boolean}
|
|
67
|
-
*/
|
|
68
|
-
async function isGA (address) {
|
|
69
|
-
const { contractId } = await this.getAccount(address)
|
|
70
|
-
return !!contractId
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Convert current account to GA account
|
|
75
|
-
* @alias module:@aeternity/aepp-sdk/es/contract/ga
|
|
76
|
-
* @function
|
|
77
|
-
* @param {String} authFnName - Authorization function name
|
|
78
|
-
* @param {String} source - Auth contract source code
|
|
79
|
-
* @param {Array} [args] - init arguments
|
|
80
|
-
* @param {Object} [options] - Options
|
|
81
|
-
* @return {Promise<Readonly<{
|
|
82
|
-
* result: *, owner: *, createdAt: Date, address, rawTx: *, transaction: *
|
|
83
|
-
* }>>}
|
|
84
|
-
*/
|
|
85
|
-
async function createGeneralizeAccount (authFnName, source, args = [], options = {}) {
|
|
86
|
-
const opt = { ...this.Ae.defaults, ...options }
|
|
87
|
-
const ownerId = await this.address(opt)
|
|
88
|
-
|
|
89
|
-
if (await this.isGA(ownerId)) throw new Error(`Account ${ownerId} is already GA`)
|
|
90
|
-
|
|
91
|
-
const { tx, contractId } = await this.gaAttachTx({
|
|
92
|
-
...opt,
|
|
93
|
-
ownerId,
|
|
94
|
-
code: (await this.contractCompile(source)).bytecode,
|
|
95
|
-
callData: await this.contractEncodeCallDataAPI(source, 'init', args),
|
|
96
|
-
authFun: hash(authFnName)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
const { hash: transaction, rawTx } = await this.send(tx, opt)
|
|
100
|
-
|
|
101
|
-
return Object.freeze({
|
|
102
|
-
owner: ownerId,
|
|
103
|
-
transaction,
|
|
104
|
-
rawTx,
|
|
105
|
-
gaContractId: contractId
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const wrapInEmptySignedTx = (tx) => buildTx({ encodedTx: tx, signatures: [] }, TX_TYPE.signed)
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Create a metaTx transaction
|
|
113
|
-
* @alias module:@aeternity/aepp-sdk/es/contract/ga
|
|
114
|
-
* @function
|
|
115
|
-
* @param {String} rawTransaction Inner transaction
|
|
116
|
-
* @param {Object} authData Object with gaMeta params
|
|
117
|
-
* @param {String} authFnName - Authorization function name
|
|
118
|
-
* @param {Object} options - Options
|
|
119
|
-
* @return {String}
|
|
120
|
-
*/
|
|
121
|
-
async function createMetaTx (rawTransaction, authData, authFnName, options = {}) {
|
|
122
|
-
if (!authData) throw new Error('authData is required')
|
|
123
|
-
// Check if authData is callData or if it's an object prepare a callData from source and args
|
|
124
|
-
const { authCallData, gas } = await prepareGaParams(this)(authData, authFnName)
|
|
125
|
-
const opt = { ...this.Ae.defaults, ...options }
|
|
126
|
-
const { abiVersion } = await this.getVmVersion(TX_TYPE.contractCall)
|
|
127
|
-
const wrappedTx = wrapInEmptySignedTx(unpackTx(rawTransaction))
|
|
128
|
-
const params = {
|
|
129
|
-
...opt,
|
|
130
|
-
tx: {
|
|
131
|
-
...wrappedTx,
|
|
132
|
-
tx: wrappedTx.txObject
|
|
133
|
-
},
|
|
134
|
-
gaId: await this.address(opt),
|
|
135
|
-
abiVersion: abiVersion,
|
|
136
|
-
authData: authCallData,
|
|
137
|
-
gas,
|
|
138
|
-
vsn: 2
|
|
139
|
-
}
|
|
140
|
-
const { fee } = await this.prepareTxParams(TX_TYPE.gaMeta, params)
|
|
141
|
-
const { rlpEncoded: metaTxRlp } = buildTx(
|
|
142
|
-
{ ...params, fee: `${fee}` },
|
|
143
|
-
TX_TYPE.gaMeta,
|
|
144
|
-
{ vsn: 2 }
|
|
145
|
-
)
|
|
146
|
-
return wrapInEmptySignedTx(metaTxRlp).tx
|
|
147
|
-
}
|
package/src/contract/index.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2018 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Contract Base module
|
|
20
|
-
* @module @aeternity/aepp-sdk/es/contract
|
|
21
|
-
* @export Contract
|
|
22
|
-
* @example import ContractBase from '@aeternity/aepp-sdk/es/contract'
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import stampit from '@stamp/it'
|
|
26
|
-
import { required } from '@stamp/required'
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Basic Contract Stamp
|
|
30
|
-
*
|
|
31
|
-
* This stamp include api call's related to contract functionality.
|
|
32
|
-
* Attempting to create instances from the Stamp without overwriting all
|
|
33
|
-
* abstract methods using composition will result in an exception.
|
|
34
|
-
* @function
|
|
35
|
-
* @alias module:@aeternity/aepp-sdk/es/contract
|
|
36
|
-
* @rtype Stamp
|
|
37
|
-
* @param {Object} [options={}] - Initializer object
|
|
38
|
-
* @return {Object} Contract instance
|
|
39
|
-
*/
|
|
40
|
-
const ContractBase = stampit(required({
|
|
41
|
-
methods: {
|
|
42
|
-
contractEncodeCallDataAPI: required,
|
|
43
|
-
compileContractAPI: required,
|
|
44
|
-
contractGetACI: required,
|
|
45
|
-
setCompilerUrl: required,
|
|
46
|
-
getCompilerVersion: required,
|
|
47
|
-
contractDecodeCallResultAPI: required,
|
|
48
|
-
validateByteCodeAPI: required,
|
|
49
|
-
getFateAssembler: required,
|
|
50
|
-
getBytecodeCompilerVersion: required
|
|
51
|
-
}
|
|
52
|
-
}))
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Get contract ACI
|
|
56
|
-
* @function contractGetACI
|
|
57
|
-
* @instance
|
|
58
|
-
* @abstract
|
|
59
|
-
* @category async
|
|
60
|
-
* @rtype (source: String, options: Array) => aciObject: Promise[Object]
|
|
61
|
-
* @param {String} source - Contract source code
|
|
62
|
-
* @param {Object} [options={}] Options
|
|
63
|
-
* @param {Object} [options.filesystem] Contract external namespaces map
|
|
64
|
-
* @return {Object} - Contract aci object
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Encode contract data
|
|
69
|
-
* @function contractEncodeCallDataAPI
|
|
70
|
-
* @instance
|
|
71
|
-
* @abstract
|
|
72
|
-
* @category async
|
|
73
|
-
* @rtype (source: String, name: String, args: Array, options: Array) => callData: Promise[String]
|
|
74
|
-
* @param {String} source - Contract source code
|
|
75
|
-
* @param {String} name - Function name
|
|
76
|
-
* @param {Array} args - Function argument's
|
|
77
|
-
* @param {Object} [options={}] Options
|
|
78
|
-
* @param {Object} [options.filesystem] Contract external namespaces map
|
|
79
|
-
* @return {String} - Contract encoded data
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Decode contract call result data
|
|
84
|
-
* @function contractDecodeCallResultAPI
|
|
85
|
-
* @instance
|
|
86
|
-
* @abstract
|
|
87
|
-
* @category async
|
|
88
|
-
* @rtype (
|
|
89
|
-
* source: String, fn: String, callValue: String, callResult: String, options: Array
|
|
90
|
-
* ) => decodedResult: Promise[String]
|
|
91
|
-
* @param {String} source - Contract source
|
|
92
|
-
* @param {String} fn - Fn name
|
|
93
|
-
* @param {String} callValue - result data (cb_das...)
|
|
94
|
-
* @param {String} callResult - contract call result status('ok', 'revert', ...)
|
|
95
|
-
* @param {Object} [options={}] Options
|
|
96
|
-
* @param {Object} [options.filesystem] Contract external namespaces map
|
|
97
|
-
* @return {String} - Decoded contract call result
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Decode call data by source
|
|
102
|
-
* @function contractDecodeCallDataBySourceAPI
|
|
103
|
-
* @instance
|
|
104
|
-
* @abstract
|
|
105
|
-
* @category async
|
|
106
|
-
* @rtype (
|
|
107
|
-
* source: String, function: String, callData: String, options: Array
|
|
108
|
-
* ) => decodedResult: Promise[String]
|
|
109
|
-
* @param {String} source - contract source
|
|
110
|
-
* @param {String} function - function name
|
|
111
|
-
* @param {String} callData - Encoded contract call data
|
|
112
|
-
* @param {Object} [options={}] Options
|
|
113
|
-
* @param {Object} [options.filesystem] Contract external namespaces map
|
|
114
|
-
* @return {String} - Decoded contract call data
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Decode call data by bytecode
|
|
119
|
-
* @function contractDecodeCallDataByCodeAPI
|
|
120
|
-
* @instance
|
|
121
|
-
* @abstract
|
|
122
|
-
* @category async
|
|
123
|
-
* @rtype (code: String, callData: String) => decodedResult: Promise[String]
|
|
124
|
-
* @param {String} code - contract byte code
|
|
125
|
-
* @param {String} callData - Encoded contract call data
|
|
126
|
-
* @return {String} - Decoded contract call data
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Compile contract
|
|
131
|
-
* @function compileContractAPI
|
|
132
|
-
* @instance
|
|
133
|
-
* @abstract
|
|
134
|
-
* @category async
|
|
135
|
-
* @rtype (code: String, options?: Object) => compiledContract: Object
|
|
136
|
-
* @param {String} code - Contract source code
|
|
137
|
-
* @param {Object} [options={}] Options
|
|
138
|
-
* @param {Object} [options.filesystem] Contract external namespaces map
|
|
139
|
-
* @return {Object} Object which contain bytecode of contract
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Set compiler url
|
|
144
|
-
* @function setCompilerUrl
|
|
145
|
-
* @instance
|
|
146
|
-
* @abstract
|
|
147
|
-
* @category async
|
|
148
|
-
* @rtype (url: String) => void
|
|
149
|
-
* @param {String} url - Compiler url
|
|
150
|
-
* @return {void}
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Get Compiler Version
|
|
155
|
-
* @function getCompilerVersion
|
|
156
|
-
* @instance
|
|
157
|
-
* @abstract
|
|
158
|
-
* @category async
|
|
159
|
-
* @rtype () => String
|
|
160
|
-
* @return {String} Compiler version
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
export default ContractBase
|
package/src/index.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ISC License (ISC)
|
|
3
|
-
* Copyright (c) 2018 aeternity developers
|
|
4
|
-
*
|
|
5
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
* copyright notice and this permission notice appear in all copies.
|
|
8
|
-
*
|
|
9
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
* PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import * as Crypto from './utils/crypto'
|
|
19
|
-
import * as Keystore from './utils/keystore'
|
|
20
|
-
import * as Bytes from './utils/bytes'
|
|
21
|
-
import * as TxBuilder from './tx/builder'
|
|
22
|
-
import * as TxBuilderHelper from './tx/builder/helpers'
|
|
23
|
-
import * as SCHEMA from './tx/builder/schema'
|
|
24
|
-
import * as ACITransformation from './contract/aci/transformation'
|
|
25
|
-
import * as AmountFormatter from './utils/amount-formatter'
|
|
26
|
-
import HdWallet from './utils/hd-wallet'
|
|
27
|
-
|
|
28
|
-
import Ae from './ae'
|
|
29
|
-
import Chain from './chain'
|
|
30
|
-
import ChainNode from './chain/node'
|
|
31
|
-
import Node from './node'
|
|
32
|
-
import NodePool from './node-pool'
|
|
33
|
-
import Tx from './tx'
|
|
34
|
-
import Transaction from './tx/tx'
|
|
35
|
-
import verifyTransaction from './tx/validator'
|
|
36
|
-
import AccountBase from './account/base'
|
|
37
|
-
import AccountMultiple from './account/multiple'
|
|
38
|
-
import MemoryAccount from './account/memory'
|
|
39
|
-
import Aens from './ae/aens'
|
|
40
|
-
import Contract from './ae/contract'
|
|
41
|
-
import GeneralizeAccount from './contract/ga'
|
|
42
|
-
import ContractCompilerAPI from './contract/compiler'
|
|
43
|
-
import RpcAepp from './ae/aepp'
|
|
44
|
-
import RpcWallet from './ae/wallet'
|
|
45
|
-
import Oracle from './ae/oracle'
|
|
46
|
-
import genSwaggerClient from './utils/swagger'
|
|
47
|
-
import Channel from './channel'
|
|
48
|
-
import Universal from './ae/universal'
|
|
49
|
-
|
|
50
|
-
export { default as ContentScriptBridge } from './utils/aepp-wallet-communication/content-script-bridge'
|
|
51
|
-
export * as AeppWalletHelpers from './utils/aepp-wallet-communication/helpers'
|
|
52
|
-
export * as AeppWalletSchema from './utils/aepp-wallet-communication/schema'
|
|
53
|
-
export { default as WalletDetector } from './utils/aepp-wallet-communication/wallet-detector'
|
|
54
|
-
export { default as BrowserRuntimeConnection } from './utils/aepp-wallet-communication/connection/browser-runtime'
|
|
55
|
-
export { default as BrowserWindowMessageConnection } from './utils/aepp-wallet-communication/connection/browser-window-message'
|
|
56
|
-
|
|
57
|
-
export const getDefaultPointerKey = TxBuilderHelper.getDefaultPointerKey
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
AmountFormatter,
|
|
61
|
-
AccountBase,
|
|
62
|
-
AccountMultiple,
|
|
63
|
-
Ae,
|
|
64
|
-
Aens,
|
|
65
|
-
Bytes,
|
|
66
|
-
Contract,
|
|
67
|
-
ContractCompilerAPI,
|
|
68
|
-
ACITransformation,
|
|
69
|
-
ChainNode,
|
|
70
|
-
RpcAepp,
|
|
71
|
-
RpcWallet,
|
|
72
|
-
Channel,
|
|
73
|
-
Crypto,
|
|
74
|
-
Keystore,
|
|
75
|
-
Chain,
|
|
76
|
-
GeneralizeAccount,
|
|
77
|
-
HdWallet,
|
|
78
|
-
MemoryAccount,
|
|
79
|
-
Node,
|
|
80
|
-
NodePool,
|
|
81
|
-
Oracle,
|
|
82
|
-
genSwaggerClient,
|
|
83
|
-
Transaction,
|
|
84
|
-
verifyTransaction,
|
|
85
|
-
Tx,
|
|
86
|
-
TxBuilder,
|
|
87
|
-
TxBuilderHelper,
|
|
88
|
-
Universal,
|
|
89
|
-
SCHEMA
|
|
90
|
-
}
|