@aeternity/aepp-sdk 12.0.0 → 12.1.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/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -15
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +2 -1
- package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +20764 -1
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +7 -7
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +4 -3
- package/es/AeSdkAepp.mjs +2 -1
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.d.ts +22 -21
- package/es/AeSdkBase.mjs +25 -21
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkWallet.d.ts +4 -3
- package/es/AeSdkWallet.mjs +5 -1
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +7 -10
- package/es/Node.mjs +63 -57
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +7 -4
- package/es/account/Base.mjs +3 -3
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Memory.d.ts +5 -4
- package/es/account/Memory.mjs +24 -2
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +6 -6
- package/es/account/Rpc.mjs +3 -2
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +27 -14
- package/es/aens.mjs +27 -21
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.d.ts +2 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +5 -2
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +1 -0
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -0
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +5 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.d.ts +1 -0
- package/es/aepp-wallet-communication/connection-proxy.mjs +1 -0
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +1 -0
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -5
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +8 -8
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.d.ts +17 -2
- package/es/aepp-wallet-communication/schema.mjs +54 -17
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +2 -3
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +6 -2
- package/es/apis/node/models/index.mjs.map +1 -1
- package/es/apis/node/models/mappers.mjs +4 -2
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/chain.d.ts +92 -64
- package/es/chain.mjs +190 -154
- package/es/chain.mjs.map +1 -1
- package/es/channel/handlers.d.ts +3 -3
- package/es/channel/handlers.mjs +42 -44
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/index.d.ts +43 -52
- package/es/channel/index.mjs +46 -49
- package/es/channel/index.mjs.map +1 -1
- package/es/channel/internal.d.ts +16 -15
- package/es/channel/internal.mjs +67 -62
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Compiler.d.ts +1 -0
- package/es/contract/Compiler.mjs +5 -4
- package/es/contract/Compiler.mjs.map +1 -1
- package/es/contract/aci.d.ts +17 -15
- package/es/contract/aci.mjs +58 -45
- package/es/contract/aci.mjs.map +1 -1
- package/es/contract/ga.d.ts +16 -15
- package/es/contract/ga.mjs +12 -7
- package/es/contract/ga.mjs.map +1 -1
- package/es/contract/methods.d.ts +9 -6
- package/es/contract/methods.mjs +9 -6
- package/es/contract/methods.mjs.map +1 -1
- package/es/deprecated/index.d.ts +143 -0
- package/es/deprecated/index.mjs +162 -0
- package/es/deprecated/index.mjs.map +1 -0
- package/es/deprecated/methods.d.ts +18 -0
- package/es/deprecated/methods.mjs +26 -0
- package/es/deprecated/methods.mjs.map +1 -0
- package/es/index.d.ts +4 -1
- package/es/index.mjs +4 -1
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +69 -62
- package/es/oracle.mjs +121 -103
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +16 -15
- package/es/spend.mjs +19 -30
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/address.d.ts +25 -0
- package/es/tx/builder/address.mjs +45 -0
- package/es/tx/builder/address.mjs.map +1 -0
- package/es/tx/builder/constants.d.ts +55 -26
- package/es/tx/builder/constants.mjs +60 -38
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
- package/es/tx/builder/field-types/coin-amount.mjs +26 -0
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
- package/es/tx/builder/field-types/deposit.d.ts +15 -0
- package/es/tx/builder/field-types/deposit.mjs +19 -0
- package/es/tx/builder/field-types/deposit.mjs.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +25 -0
- package/es/tx/{min-fee.mjs → builder/field-types/fee.mjs} +62 -60
- package/es/tx/builder/field-types/fee.mjs.map +1 -0
- package/es/tx/builder/field-types/field.d.ts +6 -0
- package/es/tx/builder/field-types/field.mjs +15 -0
- package/es/tx/builder/field-types/field.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
- package/es/tx/builder/field-types/gas-limit.mjs +33 -0
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
- package/es/tx/builder/field-types/gas-price.d.ts +8 -0
- package/es/tx/builder/field-types/gas-price.mjs +18 -0
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
- package/es/tx/builder/field-types/index.d.ts +70 -0
- package/es/tx/builder/field-types/index.mjs +25 -0
- package/es/tx/builder/field-types/index.mjs.map +1 -0
- package/es/tx/builder/field-types/name-fee.d.ts +20 -0
- package/es/tx/builder/field-types/name-fee.mjs +24 -0
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
- package/es/tx/builder/field-types/name-id.d.ts +14 -0
- package/es/tx/builder/field-types/name-id.mjs +19 -0
- package/es/tx/builder/field-types/name-id.mjs.map +1 -0
- package/es/tx/builder/field-types/name.d.ts +13 -0
- package/es/tx/builder/field-types/name.mjs +18 -0
- package/es/tx/builder/field-types/name.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/es/tx/builder/field-types/short-u-int.mjs +12 -0
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
- package/es/tx/builder/field-types/u-int.d.ts +8 -0
- package/es/tx/builder/field-types/u-int.mjs +14 -0
- package/es/tx/builder/field-types/u-int.mjs.map +1 -0
- package/es/tx/builder/helpers.d.ts +27 -33
- package/es/tx/builder/helpers.mjs +41 -47
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +25 -12
- package/es/tx/builder/index.mjs +74 -83
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +995 -144
- package/es/tx/builder/schema.mjs +121 -170
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/index.d.ts +28 -27
- package/es/tx/index.mjs +97 -117
- package/es/tx/index.mjs.map +1 -1
- package/es/tx/validator.d.ts +4 -3
- package/es/tx/validator.mjs +79 -92
- package/es/tx/validator.mjs.map +1 -1
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -1
- package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -1
- package/es/typings/bip32-path/index.d.mjs.map +1 -1
- package/es/typings/blakejs/index.d.mjs.map +1 -1
- package/es/typings/sha-js/index.d.mjs +2 -0
- package/es/typings/sha-js/index.d.mjs.map +1 -0
- package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -1
- package/es/utils/amount-formatter.d.ts +9 -9
- package/es/utils/amount-formatter.mjs +17 -17
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.mjs +7 -7
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bignumber.mjs +2 -1
- package/es/utils/bignumber.mjs.map +1 -1
- package/es/utils/bytes.mjs +1 -1
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +8 -23
- package/es/utils/crypto.mjs +15 -41
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder-types.d.ts +61 -0
- package/es/utils/encoder-types.mjs +36 -0
- package/es/utils/encoder-types.mjs.map +1 -0
- package/es/utils/encoder.d.ts +6 -7
- package/es/utils/encoder.mjs +42 -26
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +1 -11
- package/es/utils/errors.mjs +4 -20
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +18 -2
- package/es/utils/hd-wallet.mjs +64 -34
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs +2 -2
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.mjs +4 -2
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/mptree.d.ts +2 -2
- package/es/utils/mptree.mjs +11 -6
- package/es/utils/mptree.mjs.map +1 -1
- package/es/utils/other.d.ts +8 -2
- package/es/utils/other.mjs +15 -3
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.d.ts +1 -1
- package/es/utils/semver-satisfies.mjs +2 -2
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.mjs.map +1 -1
- package/package.json +35 -33
- package/src/AeSdk.ts +30 -27
- package/src/AeSdkAepp.ts +93 -84
- package/src/AeSdkBase.ts +148 -130
- package/src/AeSdkWallet.ts +172 -156
- package/src/Node.ts +108 -102
- package/src/account/Base.ts +42 -32
- package/src/account/Memory.ts +45 -30
- package/src/account/Rpc.ts +32 -30
- package/src/aens.ts +124 -108
- package/src/aepp-wallet-communication/connection/Browser.ts +18 -15
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +22 -21
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +63 -52
- package/src/aepp-wallet-communication/connection-proxy.ts +8 -7
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +67 -61
- package/src/aepp-wallet-communication/rpc/types.ts +32 -32
- package/src/aepp-wallet-communication/schema.ts +117 -74
- package/src/aepp-wallet-communication/wallet-detector.ts +29 -28
- package/src/apis/node/code-model-v4.yaml +54 -20
- package/src/apis/node/models/index.ts +6 -2
- package/src/apis/node/models/mappers.ts +4 -2
- package/src/chain.ts +286 -228
- package/src/channel/handlers.ts +424 -372
- package/src/channel/index.ts +285 -251
- package/src/channel/internal.ts +248 -232
- package/src/contract/Compiler.ts +22 -21
- package/src/contract/aci.ts +267 -258
- package/src/contract/ga.ts +93 -72
- package/src/contract/methods.ts +32 -27
- package/src/deprecated/index.ts +170 -0
- package/src/deprecated/methods.ts +25 -0
- package/src/index.ts +37 -32
- package/src/oracle.ts +211 -189
- package/src/spend.ts +82 -70
- package/src/tx/builder/address.ts +50 -0
- package/src/tx/builder/constants.ts +82 -52
- package/src/tx/builder/field-types/coin-amount.ts +27 -0
- package/src/tx/builder/field-types/deposit.ts +21 -0
- package/src/tx/builder/field-types/fee.ts +143 -0
- package/src/tx/builder/field-types/field.ts +9 -0
- package/src/tx/builder/field-types/gas-limit.ts +41 -0
- package/src/tx/builder/field-types/gas-price.ts +16 -0
- package/src/tx/builder/field-types/index.ts +45 -0
- package/src/tx/builder/field-types/name-fee.ts +32 -0
- package/src/tx/builder/field-types/name-id.ts +20 -0
- package/src/tx/builder/field-types/name.ts +18 -0
- package/src/tx/builder/field-types/short-u-int.ts +11 -0
- package/src/tx/builder/field-types/u-int.ts +16 -0
- package/src/tx/builder/helpers.ts +112 -117
- package/src/tx/builder/index.ts +203 -197
- package/src/tx/builder/schema.ts +421 -465
- package/src/tx/index.ts +128 -135
- package/src/tx/validator.ts +165 -161
- package/src/typings/@aeternity__argon2-browser/index.d.ts +1 -1
- package/src/typings/@aeternity__uuid/index.d.ts +3 -1
- package/src/typings/bip32-path/index.d.ts +6 -6
- package/src/typings/blakejs/index.d.ts +4 -32
- package/src/typings/sha-js/index.d.ts +5 -0
- package/src/typings/tweetnacl-auth/index.d.ts +2 -2
- package/src/utils/amount-formatter.ts +41 -41
- package/src/utils/autorest.ts +57 -54
- package/src/utils/bignumber.ts +7 -6
- package/src/utils/bytes.ts +19 -19
- package/src/utils/crypto.ts +82 -94
- package/src/utils/encoder-types.ts +63 -0
- package/src/utils/encoder.ts +104 -56
- package/src/utils/errors.ts +246 -264
- package/src/utils/hd-wallet.ts +114 -82
- package/src/utils/json-big.ts +16 -15
- package/src/utils/keystore.ts +65 -62
- package/src/utils/mptree.ts +59 -56
- package/src/utils/other.ts +26 -18
- package/src/utils/semver-satisfies.ts +15 -11
- package/src/utils/string.ts +10 -10
- package/es/tx/builder/field-types.d.ts +0 -62
- package/es/tx/builder/field-types.mjs +0 -126
- package/es/tx/builder/field-types.mjs.map +0 -1
- package/es/tx/min-fee.d.ts +0 -20
- package/es/tx/min-fee.mjs.map +0 -1
- package/src/tx/builder/field-types.ts +0 -111
- package/src/tx/min-fee.ts +0 -136
package/es/tx/builder/schema.mjs
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// # RLP version number
|
|
5
5
|
// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { Tag } from "./constants.mjs";
|
|
7
|
+
import { uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee } from "./field-types/index.mjs";
|
|
8
|
+
import { Encoding } from "../../utils/encoder.mjs";
|
|
8
9
|
export let ORACLE_TTL_TYPES; // # TRANSACTION DEFAULT TTL
|
|
9
10
|
|
|
10
11
|
(function (ORACLE_TTL_TYPES) {
|
|
@@ -29,7 +30,6 @@ export const RESPONSE_TTL = {
|
|
|
29
30
|
}; // # CONTRACT
|
|
30
31
|
|
|
31
32
|
export const AMOUNT = 0;
|
|
32
|
-
export const GAS_MAX = 1600000 - 21000;
|
|
33
33
|
export const MAX_AUTH_FUN_GAS = 50000;
|
|
34
34
|
export const DRY_RUN_ACCOUNT = {
|
|
35
35
|
pub: 'ak_11111111111111111111111111111111273Yts',
|
|
@@ -37,66 +37,12 @@ export const DRY_RUN_ACCOUNT = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}
|
|
42
|
-
*/
|
|
43
|
-
export let TX_TYPE;
|
|
44
|
-
/**
|
|
40
|
+
* @category transaction builder
|
|
45
41
|
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
|
|
46
42
|
*/
|
|
47
|
-
|
|
48
|
-
(function (TX_TYPE) {
|
|
49
|
-
TX_TYPE[TX_TYPE["account"] = 10] = "account";
|
|
50
|
-
TX_TYPE[TX_TYPE["signed"] = 11] = "signed";
|
|
51
|
-
TX_TYPE[TX_TYPE["spend"] = 12] = "spend";
|
|
52
|
-
TX_TYPE[TX_TYPE["oracleRegister"] = 22] = "oracleRegister";
|
|
53
|
-
TX_TYPE[TX_TYPE["oracleQuery"] = 23] = "oracleQuery";
|
|
54
|
-
TX_TYPE[TX_TYPE["oracleResponse"] = 24] = "oracleResponse";
|
|
55
|
-
TX_TYPE[TX_TYPE["oracleExtend"] = 25] = "oracleExtend";
|
|
56
|
-
TX_TYPE[TX_TYPE["nameClaim"] = 32] = "nameClaim";
|
|
57
|
-
TX_TYPE[TX_TYPE["namePreClaim"] = 33] = "namePreClaim";
|
|
58
|
-
TX_TYPE[TX_TYPE["nameUpdate"] = 34] = "nameUpdate";
|
|
59
|
-
TX_TYPE[TX_TYPE["nameRevoke"] = 35] = "nameRevoke";
|
|
60
|
-
TX_TYPE[TX_TYPE["nameTransfer"] = 36] = "nameTransfer";
|
|
61
|
-
TX_TYPE[TX_TYPE["contract"] = 40] = "contract";
|
|
62
|
-
TX_TYPE[TX_TYPE["contractCallResult"] = 41] = "contractCallResult";
|
|
63
|
-
TX_TYPE[TX_TYPE["contractCreate"] = 42] = "contractCreate";
|
|
64
|
-
TX_TYPE[TX_TYPE["contractCall"] = 43] = "contractCall";
|
|
65
|
-
TX_TYPE[TX_TYPE["channelCreate"] = 50] = "channelCreate";
|
|
66
|
-
TX_TYPE[TX_TYPE["channelDeposit"] = 51] = "channelDeposit";
|
|
67
|
-
TX_TYPE[TX_TYPE["channelWithdraw"] = 52] = "channelWithdraw";
|
|
68
|
-
TX_TYPE[TX_TYPE["channelCloseMutual"] = 53] = "channelCloseMutual";
|
|
69
|
-
TX_TYPE[TX_TYPE["channelCloseSolo"] = 54] = "channelCloseSolo";
|
|
70
|
-
TX_TYPE[TX_TYPE["channelSlash"] = 55] = "channelSlash";
|
|
71
|
-
TX_TYPE[TX_TYPE["channelSettle"] = 56] = "channelSettle";
|
|
72
|
-
TX_TYPE[TX_TYPE["channelOffChain"] = 57] = "channelOffChain";
|
|
73
|
-
TX_TYPE[TX_TYPE["channel"] = 58] = "channel";
|
|
74
|
-
TX_TYPE[TX_TYPE["channelSnapshotSolo"] = 59] = "channelSnapshotSolo";
|
|
75
|
-
TX_TYPE[TX_TYPE["proofOfInclusion"] = 60] = "proofOfInclusion";
|
|
76
|
-
TX_TYPE[TX_TYPE["stateTrees"] = 62] = "stateTrees";
|
|
77
|
-
TX_TYPE[TX_TYPE["merklePatriciaTree"] = 63] = "merklePatriciaTree";
|
|
78
|
-
TX_TYPE[TX_TYPE["merklePatriciaTreeValue"] = 64] = "merklePatriciaTreeValue";
|
|
79
|
-
TX_TYPE[TX_TYPE["sophiaByteCode"] = 70] = "sophiaByteCode";
|
|
80
|
-
TX_TYPE[TX_TYPE["gaAttach"] = 80] = "gaAttach";
|
|
81
|
-
TX_TYPE[TX_TYPE["gaMeta"] = 81] = "gaMeta";
|
|
82
|
-
TX_TYPE[TX_TYPE["payingFor"] = 82] = "payingFor";
|
|
83
|
-
TX_TYPE[TX_TYPE["channelForceProgress"] = 521] = "channelForceProgress";
|
|
84
|
-
TX_TYPE[TX_TYPE["channelOffChainUpdateTransfer"] = 570] = "channelOffChainUpdateTransfer";
|
|
85
|
-
TX_TYPE[TX_TYPE["channelOffChainUpdateDeposit"] = 571] = "channelOffChainUpdateDeposit";
|
|
86
|
-
TX_TYPE[TX_TYPE["channelOffChainUpdateWithdrawal"] = 572] = "channelOffChainUpdateWithdrawal";
|
|
87
|
-
TX_TYPE[TX_TYPE["channelOffChainCreateContract"] = 573] = "channelOffChainCreateContract";
|
|
88
|
-
TX_TYPE[TX_TYPE["channelOffChainCallContract"] = 574] = "channelOffChainCallContract";
|
|
89
|
-
TX_TYPE[TX_TYPE["channelReconnect"] = 575] = "channelReconnect";
|
|
90
|
-
TX_TYPE[TX_TYPE["contractsTree"] = 621] = "contractsTree";
|
|
91
|
-
TX_TYPE[TX_TYPE["contractCallsTree"] = 622] = "contractCallsTree";
|
|
92
|
-
TX_TYPE[TX_TYPE["channelsTree"] = 623] = "channelsTree";
|
|
93
|
-
TX_TYPE[TX_TYPE["nameserviceTree"] = 624] = "nameserviceTree";
|
|
94
|
-
TX_TYPE[TX_TYPE["oraclesTree"] = 625] = "oraclesTree";
|
|
95
|
-
TX_TYPE[TX_TYPE["accountsTree"] = 626] = "accountsTree";
|
|
96
|
-
})(TX_TYPE || (TX_TYPE = {}));
|
|
97
|
-
|
|
98
43
|
export let VM_VERSIONS;
|
|
99
44
|
/**
|
|
45
|
+
* @category transaction builder
|
|
100
46
|
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
|
|
101
47
|
*/
|
|
102
48
|
|
|
@@ -111,6 +57,9 @@ export let VM_VERSIONS;
|
|
|
111
57
|
})(VM_VERSIONS || (VM_VERSIONS = {}));
|
|
112
58
|
|
|
113
59
|
export let ABI_VERSIONS;
|
|
60
|
+
/**
|
|
61
|
+
* @category transaction builder
|
|
62
|
+
*/
|
|
114
63
|
|
|
115
64
|
(function (ABI_VERSIONS) {
|
|
116
65
|
ABI_VERSIONS[ABI_VERSIONS["NO_ABI"] = 0] = "NO_ABI";
|
|
@@ -126,194 +75,196 @@ export let PROTOCOL_VERSIONS; // First abi/vm by default
|
|
|
126
75
|
|
|
127
76
|
export const PROTOCOL_VM_ABI = {
|
|
128
77
|
[PROTOCOL_VERSIONS.IRIS]: {
|
|
129
|
-
[
|
|
78
|
+
[Tag.ContractCreateTx]: {
|
|
130
79
|
vmVersion: [VM_VERSIONS.FATE_2],
|
|
131
80
|
abiVersion: [ABI_VERSIONS.FATE]
|
|
132
81
|
},
|
|
133
82
|
// TODO: Ensure that AEVM (SOPHIA?) is still available here
|
|
134
|
-
[
|
|
83
|
+
[Tag.ContractCallTx]: {
|
|
135
84
|
vmVersion: [],
|
|
136
85
|
abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA]
|
|
137
86
|
},
|
|
138
|
-
[
|
|
87
|
+
[Tag.OracleRegisterTx]: {
|
|
139
88
|
vmVersion: [],
|
|
140
89
|
abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA]
|
|
141
90
|
}
|
|
142
91
|
}
|
|
143
92
|
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @category transaction builder
|
|
96
|
+
*/
|
|
144
97
|
export let FIELD_TYPES;
|
|
145
98
|
|
|
146
99
|
(function (FIELD_TYPES) {
|
|
147
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
148
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
149
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
150
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
151
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
152
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
153
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
154
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
155
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
156
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
157
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
158
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
159
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
160
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
161
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
162
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
163
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
164
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
165
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
166
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
167
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
168
|
-
FIELD_TYPES[FIELD_TYPES["
|
|
169
|
-
FIELD_TYPES[FIELD_TYPES["sophiaCodeTypeInfo"] = 22] = "sophiaCodeTypeInfo";
|
|
170
|
-
FIELD_TYPES[FIELD_TYPES["payload"] = 23] = "payload";
|
|
171
|
-
FIELD_TYPES[FIELD_TYPES["stateTree"] = 24] = "stateTree";
|
|
100
|
+
FIELD_TYPES[FIELD_TYPES["id"] = 0] = "id";
|
|
101
|
+
FIELD_TYPES[FIELD_TYPES["ids"] = 1] = "ids";
|
|
102
|
+
FIELD_TYPES[FIELD_TYPES["string"] = 2] = "string";
|
|
103
|
+
FIELD_TYPES[FIELD_TYPES["binary"] = 3] = "binary";
|
|
104
|
+
FIELD_TYPES[FIELD_TYPES["bool"] = 4] = "bool";
|
|
105
|
+
FIELD_TYPES[FIELD_TYPES["hex"] = 5] = "hex";
|
|
106
|
+
FIELD_TYPES[FIELD_TYPES["rlpBinary"] = 6] = "rlpBinary";
|
|
107
|
+
FIELD_TYPES[FIELD_TYPES["rlpBinaries"] = 7] = "rlpBinaries";
|
|
108
|
+
FIELD_TYPES[FIELD_TYPES["rawBinary"] = 8] = "rawBinary";
|
|
109
|
+
FIELD_TYPES[FIELD_TYPES["signatures"] = 9] = "signatures";
|
|
110
|
+
FIELD_TYPES[FIELD_TYPES["pointers"] = 10] = "pointers";
|
|
111
|
+
FIELD_TYPES[FIELD_TYPES["offChainUpdates"] = 11] = "offChainUpdates";
|
|
112
|
+
FIELD_TYPES[FIELD_TYPES["callStack"] = 12] = "callStack";
|
|
113
|
+
FIELD_TYPES[FIELD_TYPES["proofOfInclusion"] = 13] = "proofOfInclusion";
|
|
114
|
+
FIELD_TYPES[FIELD_TYPES["mptrees"] = 14] = "mptrees";
|
|
115
|
+
FIELD_TYPES[FIELD_TYPES["callReturnType"] = 15] = "callReturnType";
|
|
116
|
+
FIELD_TYPES[FIELD_TYPES["ctVersion"] = 16] = "ctVersion";
|
|
117
|
+
FIELD_TYPES[FIELD_TYPES["abiVersion"] = 17] = "abiVersion";
|
|
118
|
+
FIELD_TYPES[FIELD_TYPES["ttlType"] = 18] = "ttlType";
|
|
119
|
+
FIELD_TYPES[FIELD_TYPES["sophiaCodeTypeInfo"] = 19] = "sophiaCodeTypeInfo";
|
|
120
|
+
FIELD_TYPES[FIELD_TYPES["payload"] = 20] = "payload";
|
|
121
|
+
FIELD_TYPES[FIELD_TYPES["stateTree"] = 21] = "stateTree";
|
|
172
122
|
})(FIELD_TYPES || (FIELD_TYPES = {}));
|
|
173
123
|
|
|
174
|
-
const BASE_TX = [['tag',
|
|
124
|
+
const BASE_TX = [['tag', shortUInt], ['VSN', shortUInt]];
|
|
175
125
|
export const TX_SCHEMA = {
|
|
176
|
-
[
|
|
177
|
-
|
|
126
|
+
[Tag.Account]: {
|
|
127
|
+
1: [...BASE_TX, ['nonce', shortUInt], ['balance', uInt]],
|
|
128
|
+
2: [...BASE_TX, ['flags', uInt], ['nonce', shortUInt], ['balance', uInt], ['gaContract', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]], ['gaAuthFun', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
178
129
|
},
|
|
179
|
-
[
|
|
130
|
+
[Tag.SignedTx]: {
|
|
180
131
|
1: [...BASE_TX, ['signatures', FIELD_TYPES.signatures], ['encodedTx', FIELD_TYPES.rlpBinary]]
|
|
181
132
|
},
|
|
182
|
-
[
|
|
183
|
-
1: [...BASE_TX, ['senderId', FIELD_TYPES.id,
|
|
133
|
+
[Tag.SpendTx]: {
|
|
134
|
+
1: [...BASE_TX, ['senderId', FIELD_TYPES.id, Encoding.AccountAddress], ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]], ['amount', coinAmount], ['fee', fee], ['ttl', shortUInt], ['nonce', shortUInt], ['payload', FIELD_TYPES.payload]]
|
|
184
135
|
},
|
|
185
|
-
[
|
|
186
|
-
1: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
136
|
+
[Tag.NamePreclaimTx]: {
|
|
137
|
+
1: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['commitmentId', FIELD_TYPES.id, Encoding.Commitment], ['fee', fee], ['ttl', shortUInt]]
|
|
187
138
|
},
|
|
188
|
-
[
|
|
189
|
-
2: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
139
|
+
[Tag.NameClaimTx]: {
|
|
140
|
+
2: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['name', name], ['nameSalt', uInt], ['nameFee', nameFee], ['fee', fee], ['ttl', shortUInt]]
|
|
190
141
|
},
|
|
191
|
-
[
|
|
192
|
-
1: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
142
|
+
[Tag.NameUpdateTx]: {
|
|
143
|
+
1: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['nameId', nameId], ['nameTtl', uInt], ['pointers', FIELD_TYPES.pointers], ['clientTtl', shortUInt], ['fee', fee], ['ttl', shortUInt]]
|
|
193
144
|
},
|
|
194
|
-
[
|
|
195
|
-
1: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
145
|
+
[Tag.NameTransferTx]: {
|
|
146
|
+
1: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['nameId', nameId], ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]], ['fee', fee], ['ttl', shortUInt]]
|
|
196
147
|
},
|
|
197
|
-
[
|
|
198
|
-
1: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
148
|
+
[Tag.NameRevokeTx]: {
|
|
149
|
+
1: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['nameId', nameId], ['fee', fee], ['ttl', shortUInt]]
|
|
199
150
|
},
|
|
200
|
-
[
|
|
201
|
-
1: [...BASE_TX, ['owner', FIELD_TYPES.id,
|
|
151
|
+
[Tag.Contract]: {
|
|
152
|
+
1: [...BASE_TX, ['owner', FIELD_TYPES.id, Encoding.AccountAddress], ['ctVersion', FIELD_TYPES.ctVersion], ['code', FIELD_TYPES.binary, Encoding.ContractBytearray], ['log', FIELD_TYPES.binary, Encoding.ContractBytearray], ['active', FIELD_TYPES.bool], ['referers', FIELD_TYPES.ids, Encoding.AccountAddress], ['deposit', deposit]]
|
|
202
153
|
},
|
|
203
|
-
[
|
|
204
|
-
1: [...BASE_TX, ['ownerId', FIELD_TYPES.id,
|
|
154
|
+
[Tag.ContractCreateTx]: {
|
|
155
|
+
1: [...BASE_TX, ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['code', FIELD_TYPES.binary, Encoding.ContractBytearray], ['ctVersion', FIELD_TYPES.ctVersion], ['fee', fee], ['ttl', shortUInt], ['deposit', deposit], ['amount', coinAmount], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
205
156
|
},
|
|
206
|
-
[
|
|
207
|
-
1: [...BASE_TX, ['callerId', FIELD_TYPES.id,
|
|
157
|
+
[Tag.ContractCallTx]: {
|
|
158
|
+
1: [...BASE_TX, ['callerId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['contractId', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]], ['abiVersion', FIELD_TYPES.abiVersion], ['fee', fee], ['ttl', shortUInt], ['amount', coinAmount], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
208
159
|
},
|
|
209
|
-
[
|
|
210
|
-
1: [...BASE_TX, ['callerId', FIELD_TYPES.id,
|
|
160
|
+
[Tag.ContractCall]: {
|
|
161
|
+
1: [...BASE_TX, ['callerId', FIELD_TYPES.id, Encoding.AccountAddress], ['callerNonce', shortUInt], ['height', shortUInt], ['contractId', FIELD_TYPES.id, Encoding.ContractAddress], ['gasPrice', gasPrice], ['gasUsed', shortUInt], ['returnValue', FIELD_TYPES.binary, Encoding.ContractBytearray], ['returnType', FIELD_TYPES.callReturnType], // TODO: add serialization for
|
|
211
162
|
// <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]
|
|
212
163
|
['log', FIELD_TYPES.rawBinary]]
|
|
213
164
|
},
|
|
214
|
-
[
|
|
215
|
-
1: [...BASE_TX, ['accountId', FIELD_TYPES.id,
|
|
165
|
+
[Tag.OracleRegisterTx]: {
|
|
166
|
+
1: [...BASE_TX, ['accountId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['queryFormat', FIELD_TYPES.string], ['responseFormat', FIELD_TYPES.string], ['queryFee', coinAmount], ['oracleTtlType', FIELD_TYPES.ttlType], ['oracleTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt], ['abiVersion', FIELD_TYPES.abiVersion]]
|
|
216
167
|
},
|
|
217
|
-
[
|
|
218
|
-
1: [...BASE_TX, ['oracleId', FIELD_TYPES.id, [
|
|
168
|
+
[Tag.OracleExtendTx]: {
|
|
169
|
+
1: [...BASE_TX, ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]], ['nonce', shortUInt], ['oracleTtlType', FIELD_TYPES.ttlType], ['oracleTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
|
|
219
170
|
},
|
|
220
|
-
[
|
|
221
|
-
1: [...BASE_TX, ['senderId', FIELD_TYPES.id,
|
|
171
|
+
[Tag.OracleQueryTx]: {
|
|
172
|
+
1: [...BASE_TX, ['senderId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]], ['query', FIELD_TYPES.string], ['queryFee', coinAmount], ['queryTtlType', FIELD_TYPES.ttlType], ['queryTtlValue', shortUInt], ['responseTtlType', FIELD_TYPES.ttlType], ['responseTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
|
|
222
173
|
},
|
|
223
|
-
[
|
|
224
|
-
1: [...BASE_TX, ['oracleId', FIELD_TYPES.id,
|
|
174
|
+
[Tag.OracleResponseTx]: {
|
|
175
|
+
1: [...BASE_TX, ['oracleId', FIELD_TYPES.id, Encoding.OracleAddress], ['nonce', shortUInt], ['queryId', FIELD_TYPES.binary, Encoding.OracleQueryId], ['response', FIELD_TYPES.string], ['responseTtlType', FIELD_TYPES.ttlType], ['responseTtlValue', shortUInt], ['fee', fee], ['ttl', shortUInt]]
|
|
225
176
|
},
|
|
226
|
-
[
|
|
227
|
-
2: [...BASE_TX, ['initiator', FIELD_TYPES.id,
|
|
177
|
+
[Tag.ChannelCreateTx]: {
|
|
178
|
+
2: [...BASE_TX, ['initiator', FIELD_TYPES.id, Encoding.AccountAddress], ['initiatorAmount', uInt], ['responder', FIELD_TYPES.id, Encoding.AccountAddress], ['responderAmount', uInt], ['channelReserve', uInt], ['lockPeriod', uInt], ['ttl', shortUInt], ['fee', fee], ['initiatorDelegateIds', FIELD_TYPES.string], ['responderDelegateIds', FIELD_TYPES.string], ['stateHash', FIELD_TYPES.binary, 'st'], ['nonce', shortUInt]]
|
|
228
179
|
},
|
|
229
|
-
[
|
|
230
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
180
|
+
[Tag.ChannelCloseMutualTx]: {
|
|
181
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['initiatorAmountFinal', uInt], ['responderAmountFinal', uInt], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
231
182
|
},
|
|
232
|
-
[
|
|
233
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
183
|
+
[Tag.ChannelCloseSoloTx]: {
|
|
184
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['payload', FIELD_TYPES.binary, 'tx'], ['poi', FIELD_TYPES.binary, 'pi'], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
234
185
|
},
|
|
235
|
-
[
|
|
236
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
186
|
+
[Tag.ChannelSlashTx]: {
|
|
187
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['payload', FIELD_TYPES.binary, 'tx'], ['poi', FIELD_TYPES.binary, 'pi'], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
237
188
|
},
|
|
238
|
-
[
|
|
239
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
189
|
+
[Tag.ChannelDepositTx]: {
|
|
190
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['amount', uInt], ['ttl', shortUInt], ['fee', fee], ['stateHash', FIELD_TYPES.binary, 'st'], ['round', shortUInt], ['nonce', shortUInt]]
|
|
240
191
|
},
|
|
241
|
-
[
|
|
242
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
192
|
+
[Tag.ChannelWithdrawTx]: {
|
|
193
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['toId', FIELD_TYPES.id, Encoding.AccountAddress], ['amount', uInt], ['ttl', shortUInt], ['fee', fee], ['stateHash', FIELD_TYPES.binary, 'st'], ['round', shortUInt], ['nonce', shortUInt]]
|
|
243
194
|
},
|
|
244
|
-
[
|
|
245
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
195
|
+
[Tag.ChannelSettleTx]: {
|
|
196
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['initiatorAmountFinal', uInt], ['responderAmountFinal', uInt], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
246
197
|
},
|
|
247
|
-
[
|
|
248
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
198
|
+
[Tag.ChannelForceProgressTx]: {
|
|
199
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['payload', FIELD_TYPES.binary, 'tx'], ['round', shortUInt], ['update', FIELD_TYPES.binary, Encoding.ContractBytearray], ['stateHash', FIELD_TYPES.binary, 'st'], ['offChainTrees', FIELD_TYPES.stateTree], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
249
200
|
},
|
|
250
|
-
[
|
|
251
|
-
2: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
201
|
+
[Tag.ChannelOffChainTx]: {
|
|
202
|
+
2: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['round', shortUInt], ['stateHash', FIELD_TYPES.binary, 'st']]
|
|
252
203
|
},
|
|
253
|
-
[
|
|
254
|
-
3: [...BASE_TX, ['initiator', FIELD_TYPES.id,
|
|
204
|
+
[Tag.Channel]: {
|
|
205
|
+
3: [...BASE_TX, ['initiator', FIELD_TYPES.id, Encoding.AccountAddress], ['responder', FIELD_TYPES.id, Encoding.AccountAddress], ['channelAmount', uInt], ['initiatorAmount', uInt], ['responderAmount', uInt], ['channelReserve', uInt], ['initiatorDelegateIds', FIELD_TYPES.ids], ['responderDelegateIds', FIELD_TYPES.ids], ['stateHash', FIELD_TYPES.hex], ['round', shortUInt], ['soloRound', uInt], ['lockPeriod', uInt], ['lockedUntil', uInt], ['initiatorAuth', FIELD_TYPES.binary, Encoding.ContractBytearray], ['responderAuth', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
255
206
|
},
|
|
256
|
-
[
|
|
257
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
207
|
+
[Tag.ChannelSnapshotSoloTx]: {
|
|
208
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['fromId', FIELD_TYPES.id, Encoding.AccountAddress], ['payload', FIELD_TYPES.binary, 'tx'], ['ttl', shortUInt], ['fee', fee], ['nonce', shortUInt]]
|
|
258
209
|
},
|
|
259
|
-
[
|
|
260
|
-
1: [...BASE_TX, ['from', FIELD_TYPES.id,
|
|
210
|
+
[Tag.ChannelOffChainUpdateTransfer]: {
|
|
211
|
+
1: [...BASE_TX, ['from', FIELD_TYPES.id, Encoding.AccountAddress], ['to', FIELD_TYPES.id, Encoding.AccountAddress], ['amount', uInt]]
|
|
261
212
|
},
|
|
262
|
-
[
|
|
263
|
-
1: [...BASE_TX, ['from', FIELD_TYPES.id,
|
|
213
|
+
[Tag.ChannelOffChainUpdateDeposit]: {
|
|
214
|
+
1: [...BASE_TX, ['from', FIELD_TYPES.id, Encoding.AccountAddress], ['amount', uInt]]
|
|
264
215
|
},
|
|
265
|
-
[
|
|
266
|
-
1: [...BASE_TX, ['from', FIELD_TYPES.id,
|
|
216
|
+
[Tag.ChannelOffChainUpdateWithdraw]: {
|
|
217
|
+
1: [...BASE_TX, ['from', FIELD_TYPES.id, Encoding.AccountAddress], ['amount', uInt]]
|
|
267
218
|
},
|
|
268
|
-
[
|
|
269
|
-
1: [...BASE_TX, ['owner', FIELD_TYPES.id,
|
|
219
|
+
[Tag.ChannelOffChainUpdateCreateContract]: {
|
|
220
|
+
1: [...BASE_TX, ['owner', FIELD_TYPES.id, Encoding.AccountAddress], ['ctVersion', FIELD_TYPES.ctVersion], ['code', FIELD_TYPES.binary, Encoding.ContractBytearray], ['deposit', uInt], ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
270
221
|
},
|
|
271
|
-
[
|
|
272
|
-
1: [...BASE_TX, ['caller', FIELD_TYPES.id,
|
|
222
|
+
[Tag.ChannelOffChainUpdateCallContract]: {
|
|
223
|
+
1: [...BASE_TX, ['caller', FIELD_TYPES.id, Encoding.AccountAddress], ['contract', FIELD_TYPES.id, Encoding.ContractAddress], ['abiVersion', FIELD_TYPES.abiVersion], ['amount', uInt], ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray], ['callStack', FIELD_TYPES.callStack], ['gasPrice', gasPrice], ['gasLimit', gasLimit]]
|
|
273
224
|
},
|
|
274
|
-
[
|
|
275
|
-
1: [...BASE_TX, ['channelId', FIELD_TYPES.id,
|
|
225
|
+
[Tag.ChannelClientReconnectTx]: {
|
|
226
|
+
1: [...BASE_TX, ['channelId', FIELD_TYPES.id, Encoding.Channel], ['round', shortUInt], ['role', FIELD_TYPES.string], ['pubkey', FIELD_TYPES.id, Encoding.AccountAddress]]
|
|
276
227
|
},
|
|
277
|
-
[
|
|
228
|
+
[Tag.TreesPoi]: {
|
|
278
229
|
1: [...BASE_TX, ['accounts', FIELD_TYPES.mptrees], ['calls', FIELD_TYPES.mptrees], ['channels', FIELD_TYPES.mptrees], ['contracts', FIELD_TYPES.mptrees], ['ns', FIELD_TYPES.mptrees], ['oracles', FIELD_TYPES.mptrees]]
|
|
279
230
|
},
|
|
280
|
-
[
|
|
231
|
+
[Tag.StateTrees]: {
|
|
281
232
|
1: [...BASE_TX, ['contracts', FIELD_TYPES.rlpBinary], ['calls', FIELD_TYPES.rlpBinary], ['channels', FIELD_TYPES.rlpBinary], ['ns', FIELD_TYPES.rlpBinary], ['oracles', FIELD_TYPES.rlpBinary], ['accounts', FIELD_TYPES.rlpBinary]]
|
|
282
233
|
},
|
|
283
|
-
[
|
|
234
|
+
[Tag.Mtree]: {
|
|
284
235
|
1: [...BASE_TX, ['values', FIELD_TYPES.rlpBinaries]]
|
|
285
236
|
},
|
|
286
|
-
[
|
|
237
|
+
[Tag.MtreeValue]: {
|
|
287
238
|
1: [...BASE_TX, ['key', FIELD_TYPES.hex], ['value', FIELD_TYPES.rawBinary]]
|
|
288
239
|
},
|
|
289
|
-
[
|
|
240
|
+
[Tag.ContractsMtree]: {
|
|
290
241
|
1: [...BASE_TX, ['contracts', FIELD_TYPES.rlpBinary]]
|
|
291
242
|
},
|
|
292
|
-
[
|
|
243
|
+
[Tag.CallsMtree]: {
|
|
293
244
|
1: [...BASE_TX, ['calls', FIELD_TYPES.rlpBinary]]
|
|
294
245
|
},
|
|
295
|
-
[
|
|
246
|
+
[Tag.ChannelsMtree]: {
|
|
296
247
|
1: [...BASE_TX, ['channels', FIELD_TYPES.rlpBinary]]
|
|
297
248
|
},
|
|
298
|
-
[
|
|
249
|
+
[Tag.NameserviceMtree]: {
|
|
299
250
|
1: [...BASE_TX, ['mtree', FIELD_TYPES.rlpBinary]]
|
|
300
251
|
},
|
|
301
|
-
[
|
|
252
|
+
[Tag.OraclesMtree]: {
|
|
302
253
|
1: [...BASE_TX, ['otree', FIELD_TYPES.rlpBinary]]
|
|
303
254
|
},
|
|
304
|
-
[
|
|
255
|
+
[Tag.AccountsMtree]: {
|
|
305
256
|
1: [...BASE_TX, ['accounts', FIELD_TYPES.rlpBinary]]
|
|
306
257
|
},
|
|
307
|
-
[
|
|
308
|
-
1: [...BASE_TX, ['ownerId', FIELD_TYPES.id,
|
|
258
|
+
[Tag.GaAttachTx]: {
|
|
259
|
+
1: [...BASE_TX, ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['code', FIELD_TYPES.binary, Encoding.ContractBytearray], ['authFun', FIELD_TYPES.rawBinary], ['ctVersion', FIELD_TYPES.ctVersion], ['fee', fee], ['ttl', shortUInt], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray]]
|
|
309
260
|
},
|
|
310
|
-
[
|
|
311
|
-
2: [...BASE_TX, ['gaId', FIELD_TYPES.id,
|
|
261
|
+
[Tag.GaMetaTx]: {
|
|
262
|
+
2: [...BASE_TX, ['gaId', FIELD_TYPES.id, Encoding.AccountAddress], ['authData', FIELD_TYPES.binary, Encoding.ContractBytearray], ['abiVersion', FIELD_TYPES.abiVersion], ['fee', fee], ['gasLimit', gasLimit], ['gasPrice', gasPrice], ['tx', FIELD_TYPES.rlpBinary]]
|
|
312
263
|
},
|
|
313
|
-
[
|
|
314
|
-
1: [...BASE_TX, ['payerId', FIELD_TYPES.id,
|
|
264
|
+
[Tag.PayingForTx]: {
|
|
265
|
+
1: [...BASE_TX, ['payerId', FIELD_TYPES.id, Encoding.AccountAddress], ['nonce', shortUInt], ['fee', fee], ['tx', FIELD_TYPES.rlpBinary]]
|
|
315
266
|
},
|
|
316
|
-
[
|
|
267
|
+
[Tag.CompilerSophia]: {
|
|
317
268
|
3: [...BASE_TX, ['sourceCodeHash', FIELD_TYPES.rawBinary], ['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo], ['byteCode', FIELD_TYPES.rawBinary], ['compilerVersion', FIELD_TYPES.string], ['payable', FIELD_TYPES.bool]]
|
|
318
269
|
}
|
|
319
270
|
};
|