@aeternity/aepp-sdk 12.0.0 → 12.1.2

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.
Files changed (283) hide show
  1. package/dist/aepp-sdk.browser-script.js +1 -1
  2. package/dist/aepp-sdk.browser-script.js.LICENSE.txt +0 -15
  3. package/dist/aepp-sdk.browser-script.js.map +1 -1
  4. package/dist/aepp-sdk.browser.js +2 -1
  5. package/dist/aepp-sdk.browser.js.LICENSE.txt +1 -0
  6. package/dist/aepp-sdk.browser.js.map +1 -1
  7. package/dist/aepp-sdk.js +20765 -1
  8. package/dist/aepp-sdk.js.map +1 -1
  9. package/es/AeSdk.d.ts +7 -7
  10. package/es/AeSdk.mjs.map +1 -1
  11. package/es/AeSdkAepp.d.ts +4 -3
  12. package/es/AeSdkAepp.mjs +2 -1
  13. package/es/AeSdkAepp.mjs.map +1 -1
  14. package/es/AeSdkBase.d.ts +22 -21
  15. package/es/AeSdkBase.mjs +25 -21
  16. package/es/AeSdkBase.mjs.map +1 -1
  17. package/es/AeSdkWallet.d.ts +4 -3
  18. package/es/AeSdkWallet.mjs +5 -1
  19. package/es/AeSdkWallet.mjs.map +1 -1
  20. package/es/Node.d.ts +7 -10
  21. package/es/Node.mjs +63 -57
  22. package/es/Node.mjs.map +1 -1
  23. package/es/account/Base.d.ts +7 -4
  24. package/es/account/Base.mjs +3 -3
  25. package/es/account/Base.mjs.map +1 -1
  26. package/es/account/Memory.d.ts +5 -4
  27. package/es/account/Memory.mjs +24 -2
  28. package/es/account/Memory.mjs.map +1 -1
  29. package/es/account/Rpc.d.ts +6 -6
  30. package/es/account/Rpc.mjs +3 -2
  31. package/es/account/Rpc.mjs.map +1 -1
  32. package/es/aens.d.ts +27 -14
  33. package/es/aens.mjs +27 -21
  34. package/es/aens.mjs.map +1 -1
  35. package/es/aepp-wallet-communication/connection/Browser.d.ts +2 -1
  36. package/es/aepp-wallet-communication/connection/Browser.mjs +5 -2
  37. package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
  38. package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -0
  39. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +1 -0
  40. package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
  41. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -0
  42. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +5 -1
  43. package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
  44. package/es/aepp-wallet-communication/connection-proxy.d.ts +1 -0
  45. package/es/aepp-wallet-communication/connection-proxy.mjs +1 -0
  46. package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
  47. package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +1 -0
  48. package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -5
  49. package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
  50. package/es/aepp-wallet-communication/rpc/types.d.ts +8 -8
  51. package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
  52. package/es/aepp-wallet-communication/schema.d.ts +17 -2
  53. package/es/aepp-wallet-communication/schema.mjs +54 -17
  54. package/es/aepp-wallet-communication/schema.mjs.map +1 -1
  55. package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -1
  56. package/es/aepp-wallet-communication/wallet-detector.mjs +2 -3
  57. package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
  58. package/es/apis/node/models/index.d.ts +6 -2
  59. package/es/apis/node/models/index.mjs.map +1 -1
  60. package/es/apis/node/models/mappers.mjs +4 -2
  61. package/es/apis/node/models/mappers.mjs.map +1 -1
  62. package/es/chain.d.ts +92 -64
  63. package/es/chain.mjs +190 -154
  64. package/es/chain.mjs.map +1 -1
  65. package/es/channel/handlers.d.ts +3 -3
  66. package/es/channel/handlers.mjs +42 -44
  67. package/es/channel/handlers.mjs.map +1 -1
  68. package/es/channel/index.d.ts +43 -52
  69. package/es/channel/index.mjs +46 -49
  70. package/es/channel/index.mjs.map +1 -1
  71. package/es/channel/internal.d.ts +16 -15
  72. package/es/channel/internal.mjs +67 -62
  73. package/es/channel/internal.mjs.map +1 -1
  74. package/es/contract/Compiler.d.ts +1 -0
  75. package/es/contract/Compiler.mjs +5 -4
  76. package/es/contract/Compiler.mjs.map +1 -1
  77. package/es/contract/aci.d.ts +17 -15
  78. package/es/contract/aci.mjs +58 -45
  79. package/es/contract/aci.mjs.map +1 -1
  80. package/es/contract/ga.d.ts +16 -15
  81. package/es/contract/ga.mjs +12 -7
  82. package/es/contract/ga.mjs.map +1 -1
  83. package/es/contract/methods.d.ts +9 -6
  84. package/es/contract/methods.mjs +9 -6
  85. package/es/contract/methods.mjs.map +1 -1
  86. package/es/deprecated/index.d.ts +143 -0
  87. package/es/deprecated/index.mjs +162 -0
  88. package/es/deprecated/index.mjs.map +1 -0
  89. package/es/deprecated/methods.d.ts +18 -0
  90. package/es/deprecated/methods.mjs +26 -0
  91. package/es/deprecated/methods.mjs.map +1 -0
  92. package/es/index.d.ts +4 -1
  93. package/es/index.mjs +4 -1
  94. package/es/index.mjs.map +1 -1
  95. package/es/oracle.d.ts +69 -62
  96. package/es/oracle.mjs +121 -103
  97. package/es/oracle.mjs.map +1 -1
  98. package/es/spend.d.ts +16 -15
  99. package/es/spend.mjs +19 -30
  100. package/es/spend.mjs.map +1 -1
  101. package/es/tx/builder/address.d.ts +25 -0
  102. package/es/tx/builder/address.mjs +45 -0
  103. package/es/tx/builder/address.mjs.map +1 -0
  104. package/es/tx/builder/constants.d.ts +55 -26
  105. package/es/tx/builder/constants.mjs +60 -38
  106. package/es/tx/builder/constants.mjs.map +1 -1
  107. package/es/tx/builder/field-types/coin-amount.d.ts +13 -0
  108. package/es/tx/builder/field-types/coin-amount.mjs +26 -0
  109. package/es/tx/builder/field-types/coin-amount.mjs.map +1 -0
  110. package/es/tx/builder/field-types/deposit.d.ts +15 -0
  111. package/es/tx/builder/field-types/deposit.mjs +19 -0
  112. package/es/tx/builder/field-types/deposit.mjs.map +1 -0
  113. package/es/tx/builder/field-types/fee.d.ts +25 -0
  114. package/es/tx/{min-fee.mjs → builder/field-types/fee.mjs} +62 -60
  115. package/es/tx/builder/field-types/fee.mjs.map +1 -0
  116. package/es/tx/builder/field-types/field.d.ts +6 -0
  117. package/es/tx/builder/field-types/field.mjs +15 -0
  118. package/es/tx/builder/field-types/field.mjs.map +1 -0
  119. package/es/tx/builder/field-types/gas-limit.d.ts +12 -0
  120. package/es/tx/builder/field-types/gas-limit.mjs +33 -0
  121. package/es/tx/builder/field-types/gas-limit.mjs.map +1 -0
  122. package/es/tx/builder/field-types/gas-price.d.ts +8 -0
  123. package/es/tx/builder/field-types/gas-price.mjs +18 -0
  124. package/es/tx/builder/field-types/gas-price.mjs.map +1 -0
  125. package/es/tx/builder/field-types/index.d.ts +70 -0
  126. package/es/tx/builder/field-types/index.mjs +25 -0
  127. package/es/tx/builder/field-types/index.mjs.map +1 -0
  128. package/es/tx/builder/field-types/name-fee.d.ts +20 -0
  129. package/es/tx/builder/field-types/name-fee.mjs +24 -0
  130. package/es/tx/builder/field-types/name-fee.mjs.map +1 -0
  131. package/es/tx/builder/field-types/name-id.d.ts +14 -0
  132. package/es/tx/builder/field-types/name-id.mjs +19 -0
  133. package/es/tx/builder/field-types/name-id.mjs.map +1 -0
  134. package/es/tx/builder/field-types/name.d.ts +13 -0
  135. package/es/tx/builder/field-types/name.mjs +18 -0
  136. package/es/tx/builder/field-types/name.mjs.map +1 -0
  137. package/es/tx/builder/field-types/short-u-int.d.ts +6 -0
  138. package/es/tx/builder/field-types/short-u-int.mjs +12 -0
  139. package/es/tx/builder/field-types/short-u-int.mjs.map +1 -0
  140. package/es/tx/builder/field-types/u-int.d.ts +8 -0
  141. package/es/tx/builder/field-types/u-int.mjs +14 -0
  142. package/es/tx/builder/field-types/u-int.mjs.map +1 -0
  143. package/es/tx/builder/helpers.d.ts +27 -33
  144. package/es/tx/builder/helpers.mjs +41 -47
  145. package/es/tx/builder/helpers.mjs.map +1 -1
  146. package/es/tx/builder/index.d.ts +25 -12
  147. package/es/tx/builder/index.mjs +74 -83
  148. package/es/tx/builder/index.mjs.map +1 -1
  149. package/es/tx/builder/schema.d.ts +995 -144
  150. package/es/tx/builder/schema.mjs +121 -170
  151. package/es/tx/builder/schema.mjs.map +1 -1
  152. package/es/tx/index.d.ts +28 -27
  153. package/es/tx/index.mjs +97 -117
  154. package/es/tx/index.mjs.map +1 -1
  155. package/es/tx/validator.d.ts +4 -3
  156. package/es/tx/validator.mjs +79 -92
  157. package/es/tx/validator.mjs.map +1 -1
  158. package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +1 -1
  159. package/es/typings/@aeternity__uuid/index.d.mjs.map +1 -1
  160. package/es/typings/bip32-path/index.d.mjs.map +1 -1
  161. package/es/typings/blakejs/index.d.mjs.map +1 -1
  162. package/es/typings/sha-js/index.d.mjs +2 -0
  163. package/es/typings/sha-js/index.d.mjs.map +1 -0
  164. package/es/typings/tweetnacl-auth/index.d.mjs.map +1 -1
  165. package/es/utils/amount-formatter.d.ts +9 -9
  166. package/es/utils/amount-formatter.mjs +17 -17
  167. package/es/utils/amount-formatter.mjs.map +1 -1
  168. package/es/utils/autorest.mjs +7 -7
  169. package/es/utils/autorest.mjs.map +1 -1
  170. package/es/utils/bignumber.mjs +2 -1
  171. package/es/utils/bignumber.mjs.map +1 -1
  172. package/es/utils/bytes.mjs +1 -1
  173. package/es/utils/bytes.mjs.map +1 -1
  174. package/es/utils/crypto.d.ts +8 -23
  175. package/es/utils/crypto.mjs +15 -41
  176. package/es/utils/crypto.mjs.map +1 -1
  177. package/es/utils/encoder-types.d.ts +61 -0
  178. package/es/utils/encoder-types.mjs +36 -0
  179. package/es/utils/encoder-types.mjs.map +1 -0
  180. package/es/utils/encoder.d.ts +6 -7
  181. package/es/utils/encoder.mjs +42 -26
  182. package/es/utils/encoder.mjs.map +1 -1
  183. package/es/utils/errors.d.ts +1 -11
  184. package/es/utils/errors.mjs +4 -20
  185. package/es/utils/errors.mjs.map +1 -1
  186. package/es/utils/hd-wallet.d.ts +18 -2
  187. package/es/utils/hd-wallet.mjs +64 -34
  188. package/es/utils/hd-wallet.mjs.map +1 -1
  189. package/es/utils/json-big.mjs +2 -2
  190. package/es/utils/json-big.mjs.map +1 -1
  191. package/es/utils/keystore.mjs +4 -2
  192. package/es/utils/keystore.mjs.map +1 -1
  193. package/es/utils/mptree.d.ts +2 -2
  194. package/es/utils/mptree.mjs +11 -6
  195. package/es/utils/mptree.mjs.map +1 -1
  196. package/es/utils/other.d.ts +8 -2
  197. package/es/utils/other.mjs +15 -3
  198. package/es/utils/other.mjs.map +1 -1
  199. package/es/utils/semver-satisfies.d.ts +1 -1
  200. package/es/utils/semver-satisfies.mjs +2 -2
  201. package/es/utils/semver-satisfies.mjs.map +1 -1
  202. package/es/utils/string.mjs.map +1 -1
  203. package/package.json +36 -34
  204. package/src/AeSdk.ts +30 -27
  205. package/src/AeSdkAepp.ts +93 -84
  206. package/src/AeSdkBase.ts +148 -130
  207. package/src/AeSdkWallet.ts +172 -156
  208. package/src/Node.ts +108 -102
  209. package/src/account/Base.ts +42 -32
  210. package/src/account/Memory.ts +45 -30
  211. package/src/account/Rpc.ts +32 -30
  212. package/src/aens.ts +124 -108
  213. package/src/aepp-wallet-communication/connection/Browser.ts +18 -15
  214. package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +22 -21
  215. package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +63 -52
  216. package/src/aepp-wallet-communication/connection-proxy.ts +8 -7
  217. package/src/aepp-wallet-communication/rpc/RpcClient.ts +67 -61
  218. package/src/aepp-wallet-communication/rpc/types.ts +32 -32
  219. package/src/aepp-wallet-communication/schema.ts +117 -74
  220. package/src/aepp-wallet-communication/wallet-detector.ts +29 -28
  221. package/src/apis/node/code-model-v4.yaml +54 -20
  222. package/src/apis/node/models/index.ts +6 -2
  223. package/src/apis/node/models/mappers.ts +4 -2
  224. package/src/chain.ts +286 -228
  225. package/src/channel/handlers.ts +424 -372
  226. package/src/channel/index.ts +285 -251
  227. package/src/channel/internal.ts +248 -232
  228. package/src/contract/Compiler.ts +22 -21
  229. package/src/contract/aci.ts +267 -258
  230. package/src/contract/ga.ts +93 -72
  231. package/src/contract/methods.ts +32 -27
  232. package/src/deprecated/index.ts +172 -0
  233. package/src/deprecated/methods.ts +25 -0
  234. package/src/index.ts +37 -32
  235. package/src/oracle.ts +211 -189
  236. package/src/spend.ts +82 -70
  237. package/src/tx/builder/address.ts +50 -0
  238. package/src/tx/builder/constants.ts +82 -52
  239. package/src/tx/builder/field-types/coin-amount.ts +27 -0
  240. package/src/tx/builder/field-types/deposit.ts +21 -0
  241. package/src/tx/builder/field-types/fee.ts +143 -0
  242. package/src/tx/builder/field-types/field.ts +9 -0
  243. package/src/tx/builder/field-types/gas-limit.ts +41 -0
  244. package/src/tx/builder/field-types/gas-price.ts +16 -0
  245. package/src/tx/builder/field-types/index.ts +45 -0
  246. package/src/tx/builder/field-types/name-fee.ts +32 -0
  247. package/src/tx/builder/field-types/name-id.ts +20 -0
  248. package/src/tx/builder/field-types/name.ts +18 -0
  249. package/src/tx/builder/field-types/short-u-int.ts +11 -0
  250. package/src/tx/builder/field-types/u-int.ts +16 -0
  251. package/src/tx/builder/helpers.ts +112 -117
  252. package/src/tx/builder/index.ts +203 -197
  253. package/src/tx/builder/schema.ts +421 -465
  254. package/src/tx/index.ts +128 -135
  255. package/src/tx/validator.ts +165 -161
  256. package/src/typings/@aeternity__argon2-browser/index.d.ts +1 -1
  257. package/src/typings/@aeternity__uuid/index.d.ts +3 -1
  258. package/src/typings/bip32-path/index.d.ts +6 -6
  259. package/src/typings/blakejs/index.d.ts +4 -32
  260. package/src/typings/sha-js/index.d.ts +5 -0
  261. package/src/typings/tweetnacl-auth/index.d.ts +2 -2
  262. package/src/utils/amount-formatter.ts +41 -41
  263. package/src/utils/autorest.ts +57 -54
  264. package/src/utils/bignumber.ts +7 -6
  265. package/src/utils/bytes.ts +19 -19
  266. package/src/utils/crypto.ts +82 -94
  267. package/src/utils/encoder-types.ts +63 -0
  268. package/src/utils/encoder.ts +104 -56
  269. package/src/utils/errors.ts +246 -264
  270. package/src/utils/hd-wallet.ts +114 -82
  271. package/src/utils/json-big.ts +16 -15
  272. package/src/utils/keystore.ts +65 -62
  273. package/src/utils/mptree.ts +59 -56
  274. package/src/utils/other.ts +26 -18
  275. package/src/utils/semver-satisfies.ts +15 -11
  276. package/src/utils/string.ts +10 -10
  277. package/es/tx/builder/field-types.d.ts +0 -62
  278. package/es/tx/builder/field-types.mjs +0 -126
  279. package/es/tx/builder/field-types.mjs.map +0 -1
  280. package/es/tx/min-fee.d.ts +0 -20
  281. package/es/tx/min-fee.mjs.map +0 -1
  282. package/src/tx/builder/field-types.ts +0 -111
  283. package/src/tx/min-fee.ts +0 -136
@@ -4,96 +4,43 @@
4
4
  // # RLP version number
5
5
  // # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization
6
6
 
7
- import BigNumber from 'bignumber.js'
8
- import { Name, NameId, NameFee, Deposit, Field, GasPrice } from './field-types'
9
- import { EncodedData, EncodingType } from '../../utils/encoder'
10
- import { Pointer } from './helpers'
11
- import MPTree from '../../utils/mptree'
12
-
13
- export * from './constants'
7
+ import BigNumber from 'bignumber.js';
8
+ import { Tag } from './constants';
9
+ import {
10
+ Field, uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,
11
+ } from './field-types';
12
+ import { Encoded, Encoding } from '../../utils/encoder';
13
+ import MPTree from '../../utils/mptree';
14
+ import { NamePointer } from '../../apis/node';
14
15
 
15
16
  export enum ORACLE_TTL_TYPES {
16
17
  delta = 0,
17
- block = 1
18
+ block = 1,
18
19
  }
19
20
 
20
21
  // # TRANSACTION DEFAULT TTL
21
- export const TX_TTL = 0
22
+ export const TX_TTL = 0;
22
23
  // # ORACLE
23
- export const QUERY_FEE = 30000
24
- export const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 }
25
- export const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 }
26
- export const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 }
24
+ export const QUERY_FEE = 30000;
25
+ export const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };
26
+ export const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
27
+ export const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
27
28
  // # CONTRACT
28
- export const AMOUNT = 0
29
- export const GAS_MAX = 1600000 - 21000
30
- export const MAX_AUTH_FUN_GAS = 50000
29
+ export const AMOUNT = 0;
30
+ export const MAX_AUTH_FUN_GAS = 50000;
31
31
  export const DRY_RUN_ACCOUNT = {
32
32
  pub: 'ak_11111111111111111111111111111111273Yts',
33
- amount: 100000000000000000000000000000000000n
34
- } as const
33
+ amount: 100000000000000000000000000000000000n,
34
+ } as const;
35
35
 
36
36
  export type TxField = [
37
37
  name: string,
38
- type: FIELD_TYPES | typeof Field,
39
- prefix?: EncodingType | EncodingType[]
40
- ]
41
-
42
- /**
43
- * Enum with transaction types
44
- * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}
45
- */
46
- export enum TX_TYPE {
47
- account = 10,
48
- signed = 11,
49
- spend = 12,
50
- oracleRegister = 22,
51
- oracleQuery = 23,
52
- oracleResponse = 24,
53
- oracleExtend = 25,
54
- nameClaim = 32,
55
- namePreClaim = 33,
56
- nameUpdate = 34,
57
- nameRevoke = 35,
58
- nameTransfer = 36,
59
- contract = 40,
60
- contractCallResult = 41,
61
- contractCreate = 42,
62
- contractCall = 43,
63
- channelCreate = 50,
64
- channelDeposit = 51,
65
- channelWithdraw = 52,
66
- channelCloseMutual = 53,
67
- channelCloseSolo = 54,
68
- channelSlash = 55,
69
- channelSettle = 56,
70
- channelOffChain = 57,
71
- channel = 58,
72
- channelSnapshotSolo = 59,
73
- proofOfInclusion = 60,
74
- stateTrees = 62,
75
- merklePatriciaTree = 63,
76
- merklePatriciaTreeValue = 64,
77
- sophiaByteCode = 70,
78
- gaAttach = 80,
79
- gaMeta = 81,
80
- payingFor = 82,
81
- channelForceProgress = 521,
82
- channelOffChainUpdateTransfer = 570,
83
- channelOffChainUpdateDeposit = 571,
84
- channelOffChainUpdateWithdrawal = 572,
85
- channelOffChainCreateContract = 573,
86
- channelOffChainCallContract = 574,
87
- channelReconnect = 575,
88
- contractsTree = 621,
89
- contractCallsTree = 622,
90
- channelsTree = 623,
91
- nameserviceTree = 624,
92
- oraclesTree = 625,
93
- accountsTree = 626
94
- }
38
+ type: FIELD_TYPES | Field,
39
+ prefix?: Encoding | Encoding[],
40
+ ];
95
41
 
96
42
  /**
43
+ * @category transaction builder
97
44
  * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
98
45
  */
99
46
  export enum VM_VERSIONS {
@@ -103,53 +50,60 @@ export enum VM_VERSIONS {
103
50
  SOPHIA_IMPROVEMENTS_FORTUNA = 4,
104
51
  FATE = 5,
105
52
  SOPHIA_IMPROVEMENTS_LIMA = 6,
106
- FATE_2 = 7
53
+ FATE_2 = 7,
107
54
  }
108
55
 
109
56
  /**
57
+ * @category transaction builder
110
58
  * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
111
59
  */
112
60
  export enum ABI_VERSIONS {
113
61
  NO_ABI = 0,
114
62
  SOPHIA = 1,
115
- FATE = 3
63
+ FATE = 3,
116
64
  }
117
65
 
66
+ /**
67
+ * @category transaction builder
68
+ */
118
69
  export enum PROTOCOL_VERSIONS {
119
- IRIS = 5
70
+ IRIS = 5,
120
71
  }
121
72
 
122
73
  // First abi/vm by default
123
74
  export const PROTOCOL_VM_ABI = {
124
75
  [PROTOCOL_VERSIONS.IRIS]: {
125
- [TX_TYPE.contractCreate]: {
126
- vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE]
76
+ [Tag.ContractCreateTx]: {
77
+ vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE],
127
78
  },
128
79
  // TODO: Ensure that AEVM (SOPHIA?) is still available here
129
- [TX_TYPE.contractCall]: {
130
- vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA]
80
+ [Tag.ContractCallTx]: {
81
+ vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA],
131
82
  },
132
- [TX_TYPE.oracleRegister]: {
133
- vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA]
134
- }
135
- }
136
- } as const
83
+ [Tag.OracleRegisterTx]: {
84
+ vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA],
85
+ },
86
+ },
87
+ } as const;
137
88
 
138
- type PrefixType<Prefix> = Prefix extends EncodingType
139
- ? EncodedData<Prefix>
140
- : Prefix extends readonly EncodingType[]
141
- ? EncodedData<Prefix[number]>
142
- : EncodedData<any>
89
+ type PrefixType<Prefix> = Prefix extends Encoding
90
+ ? Encoded.Generic<Prefix>
91
+ : Prefix extends readonly Encoding[]
92
+ ? Encoded.Generic<Prefix[number]>
93
+ : Encoded.Generic<any>;
143
94
 
95
+ /**
96
+ * @category transaction builder
97
+ */
144
98
  export interface CtVersion {
145
- vmVersion: VM_VERSIONS
146
- abiVersion: ABI_VERSIONS
99
+ vmVersion: VM_VERSIONS;
100
+ abiVersion: ABI_VERSIONS;
147
101
  }
148
102
 
103
+ /**
104
+ * @category transaction builder
105
+ */
149
106
  export enum FIELD_TYPES {
150
- int,
151
- shortInt,
152
- amount,
153
107
  id,
154
108
  ids,
155
109
  string,
@@ -171,59 +125,56 @@ export enum FIELD_TYPES {
171
125
  ttlType,
172
126
  sophiaCodeTypeInfo,
173
127
  payload,
174
- stateTree
128
+ stateTree,
175
129
  }
176
130
 
177
- interface BuildFieldTypes<Prefix extends undefined | EncodingType | readonly EncodingType[]>{
178
- [FIELD_TYPES.int]: number | string | BigNumber
179
- [FIELD_TYPES.shortInt]: number
180
- [FIELD_TYPES.amount]: number | string | BigNumber
181
- [FIELD_TYPES.id]: PrefixType<Prefix>
182
- [FIELD_TYPES.ids]: Array<EncodedData<Prefix extends EncodingType[] ? Prefix : any>>
183
- [FIELD_TYPES.string]: string
184
- [FIELD_TYPES.binary]: PrefixType<Prefix>
185
- [FIELD_TYPES.bool]: Boolean
186
- [FIELD_TYPES.hex]: string
187
- [FIELD_TYPES.rlpBinary]: any
188
- [FIELD_TYPES.rlpBinaries]: any[]
189
- [FIELD_TYPES.rawBinary]: Uint8Array
190
- [FIELD_TYPES.signatures]: Uint8Array[]
191
- [FIELD_TYPES.pointers]: Pointer[]
192
- [FIELD_TYPES.offChainUpdates]: any
193
- [FIELD_TYPES.callStack]: any
194
- [FIELD_TYPES.proofOfInclusion]: any
195
- [FIELD_TYPES.mptrees]: MPTree[]
196
- [FIELD_TYPES.callReturnType]: any
197
- [FIELD_TYPES.ctVersion]: CtVersion
198
- [FIELD_TYPES.abiVersion]: ABI_VERSIONS
199
- [FIELD_TYPES.ttlType]: ORACLE_TTL_TYPES
200
- [FIELD_TYPES.sophiaCodeTypeInfo]: any
201
- [FIELD_TYPES.payload]: string | undefined
202
- [FIELD_TYPES.stateTree]: any
131
+ interface BuildFieldTypes<Prefix extends undefined | Encoding | readonly Encoding[]> {
132
+ [FIELD_TYPES.id]: PrefixType<Prefix>;
133
+ [FIELD_TYPES.ids]: Array<Encoded.Generic<Prefix extends Encoding[] ? Prefix : any>>;
134
+ [FIELD_TYPES.string]: string;
135
+ [FIELD_TYPES.binary]: PrefixType<Prefix>;
136
+ [FIELD_TYPES.bool]: Boolean;
137
+ [FIELD_TYPES.hex]: string;
138
+ [FIELD_TYPES.rlpBinary]: any;
139
+ [FIELD_TYPES.rlpBinaries]: any[];
140
+ [FIELD_TYPES.rawBinary]: Uint8Array;
141
+ [FIELD_TYPES.signatures]: Uint8Array[];
142
+ [FIELD_TYPES.pointers]: NamePointer[];
143
+ [FIELD_TYPES.offChainUpdates]: any;
144
+ [FIELD_TYPES.callStack]: any;
145
+ [FIELD_TYPES.proofOfInclusion]: any;
146
+ [FIELD_TYPES.mptrees]: MPTree[];
147
+ [FIELD_TYPES.callReturnType]: any;
148
+ [FIELD_TYPES.ctVersion]: CtVersion;
149
+ [FIELD_TYPES.abiVersion]: ABI_VERSIONS;
150
+ [FIELD_TYPES.ttlType]: ORACLE_TTL_TYPES;
151
+ [FIELD_TYPES.sophiaCodeTypeInfo]: any;
152
+ [FIELD_TYPES.payload]: string | undefined;
153
+ [FIELD_TYPES.stateTree]: any;
203
154
  }
204
155
 
205
156
  // based on https://stackoverflow.com/a/50375286/6176994
206
157
  type UnionToIntersection<Union> =
207
158
  (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)
208
- ? Intersection : never
159
+ ? Intersection : never;
209
160
 
210
161
  type TxElem = readonly [string, FIELD_TYPES | Field]
211
- | readonly [string, FIELD_TYPES, EncodingType | readonly EncodingType[]]
162
+ | readonly [string, FIELD_TYPES, Encoding | readonly Encoding[]];
212
163
 
213
164
  type BuildTxArgBySchemaType<
214
165
  Type extends FIELD_TYPES | Field,
215
- Prefix extends undefined | EncodingType | readonly EncodingType[]
166
+ Prefix extends undefined | Encoding | readonly Encoding[],
216
167
  > =
217
- Type extends typeof Field
168
+ Type extends Field
218
169
  ? Parameters<Type['serialize']>[0]
219
170
  : Type extends FIELD_TYPES
220
171
  ? BuildFieldTypes<Prefix>[Type]
221
- : never
172
+ : never;
222
173
 
223
174
  type NullablePartial<
224
175
  T,
225
- NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T]
226
- > = Partial<Pick<T, NK>> & Omit<T, NK>
176
+ NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T],
177
+ > = Partial<Pick<T, NK>> & Omit<T, NK>;
227
178
 
228
179
  type BuildTxArgBySchema<SchemaLine> =
229
180
  UnionToIntersection<
@@ -232,417 +183,422 @@ type BuildTxArgBySchema<SchemaLine> =
232
183
  ? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1], Elem[2]> }>
233
184
  : never
234
185
  : never
235
- >
186
+ >;
236
187
 
237
188
  export type RawTxObject<Tx extends TxSchema> = {
238
- [k in keyof Tx]: Tx[k] extends BigNumber ? string : Tx[k]
239
- }
189
+ [k in keyof Tx]-?: Tx[k] extends BigNumber ? string : Tx[k]
190
+ };
240
191
 
241
192
  const BASE_TX = [
242
- ['tag', FIELD_TYPES.shortInt],
243
- ['VSN', FIELD_TYPES.shortInt]
244
- ] as const
193
+ ['tag', shortUInt],
194
+ ['VSN', shortUInt],
195
+ ] as const;
245
196
 
246
197
  export const TX_SCHEMA = {
247
- [TX_TYPE.account]: {
198
+ [Tag.Account]: {
199
+ 1: [
200
+ ...BASE_TX,
201
+ ['nonce', shortUInt],
202
+ ['balance', uInt],
203
+ ],
248
204
  2: [
249
205
  ...BASE_TX,
250
- ['flags', FIELD_TYPES.int],
251
- ['nonce', FIELD_TYPES.shortInt],
252
- ['balance', FIELD_TYPES.int],
253
- ['gaContract', FIELD_TYPES.id, ['ct', 'nm']],
254
- ['gaAuthFun', FIELD_TYPES.binary, 'cb']
255
- ]
206
+ ['flags', uInt],
207
+ ['nonce', shortUInt],
208
+ ['balance', uInt],
209
+ ['gaContract', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],
210
+ ['gaAuthFun', FIELD_TYPES.binary, Encoding.ContractBytearray],
211
+ ],
256
212
  },
257
- [TX_TYPE.signed]: {
213
+ [Tag.SignedTx]: {
258
214
  1: [
259
215
  ...BASE_TX,
260
216
  ['signatures', FIELD_TYPES.signatures],
261
- ['encodedTx', FIELD_TYPES.rlpBinary]
262
- ]
217
+ ['encodedTx', FIELD_TYPES.rlpBinary],
218
+ ],
263
219
  },
264
- [TX_TYPE.spend]: {
220
+ [Tag.SpendTx]: {
265
221
  1: [
266
222
  ...BASE_TX,
267
- ['senderId', FIELD_TYPES.id, 'ak'],
268
- ['recipientId', FIELD_TYPES.id, ['ak', 'nm']],
269
- ['amount', FIELD_TYPES.amount],
270
- ['fee', FIELD_TYPES.int],
271
- ['ttl', FIELD_TYPES.shortInt],
272
- ['nonce', FIELD_TYPES.shortInt],
273
- ['payload', FIELD_TYPES.payload]
274
- ]
223
+ ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],
224
+ ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],
225
+ ['amount', coinAmount],
226
+ ['fee', fee],
227
+ ['ttl', shortUInt],
228
+ ['nonce', shortUInt],
229
+ ['payload', FIELD_TYPES.payload],
230
+ ],
275
231
  },
276
- [TX_TYPE.namePreClaim]: {
232
+ [Tag.NamePreclaimTx]: {
277
233
  1: [
278
234
  ...BASE_TX,
279
- ['accountId', FIELD_TYPES.id, 'ak'],
280
- ['nonce', FIELD_TYPES.shortInt],
281
- ['commitmentId', FIELD_TYPES.id, 'cm'],
282
- ['fee', FIELD_TYPES.int],
283
- ['ttl', FIELD_TYPES.shortInt]
284
- ]
235
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
236
+ ['nonce', shortUInt],
237
+ ['commitmentId', FIELD_TYPES.id, Encoding.Commitment],
238
+ ['fee', fee],
239
+ ['ttl', shortUInt],
240
+ ],
285
241
  },
286
- [TX_TYPE.nameClaim]: {
242
+ [Tag.NameClaimTx]: {
287
243
  2: [
288
244
  ...BASE_TX,
289
- ['accountId', FIELD_TYPES.id, 'ak'],
290
- ['nonce', FIELD_TYPES.shortInt],
291
- ['name', Name],
292
- ['nameSalt', FIELD_TYPES.int],
293
- ['nameFee', NameFee],
294
- ['fee', FIELD_TYPES.int],
295
- ['ttl', FIELD_TYPES.shortInt]
296
- ]
245
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
246
+ ['nonce', shortUInt],
247
+ ['name', name],
248
+ ['nameSalt', uInt],
249
+ ['nameFee', nameFee],
250
+ ['fee', fee],
251
+ ['ttl', shortUInt],
252
+ ],
297
253
  },
298
- [TX_TYPE.nameUpdate]: {
254
+ [Tag.NameUpdateTx]: {
299
255
  1: [
300
256
  ...BASE_TX,
301
- ['accountId', FIELD_TYPES.id, 'ak'],
302
- ['nonce', FIELD_TYPES.shortInt],
303
- ['nameId', NameId],
304
- ['nameTtl', FIELD_TYPES.int],
257
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
258
+ ['nonce', shortUInt],
259
+ ['nameId', nameId],
260
+ ['nameTtl', uInt],
305
261
  ['pointers', FIELD_TYPES.pointers],
306
- ['clientTtl', FIELD_TYPES.shortInt],
307
- ['fee', FIELD_TYPES.int],
308
- ['ttl', FIELD_TYPES.shortInt]
309
- ]
262
+ ['clientTtl', shortUInt],
263
+ ['fee', fee],
264
+ ['ttl', shortUInt],
265
+ ],
310
266
  },
311
- [TX_TYPE.nameTransfer]: {
267
+ [Tag.NameTransferTx]: {
312
268
  1: [
313
269
  ...BASE_TX,
314
- ['accountId', FIELD_TYPES.id, 'ak'],
315
- ['nonce', FIELD_TYPES.shortInt],
316
- ['nameId', NameId],
317
- ['recipientId', FIELD_TYPES.id, ['ak', 'nm']],
318
- ['fee', FIELD_TYPES.int],
319
- ['ttl', FIELD_TYPES.shortInt]
320
- ]
270
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
271
+ ['nonce', shortUInt],
272
+ ['nameId', nameId],
273
+ ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],
274
+ ['fee', fee],
275
+ ['ttl', shortUInt],
276
+ ],
321
277
  },
322
- [TX_TYPE.nameRevoke]: {
278
+ [Tag.NameRevokeTx]: {
323
279
  1: [
324
280
  ...BASE_TX,
325
- ['accountId', FIELD_TYPES.id, 'ak'],
326
- ['nonce', FIELD_TYPES.shortInt],
327
- ['nameId', NameId],
328
- ['fee', FIELD_TYPES.int],
329
- ['ttl', FIELD_TYPES.shortInt]
330
- ]
281
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
282
+ ['nonce', shortUInt],
283
+ ['nameId', nameId],
284
+ ['fee', fee],
285
+ ['ttl', shortUInt],
286
+ ],
331
287
  },
332
- [TX_TYPE.contract]: {
288
+ [Tag.Contract]: {
333
289
  1: [
334
290
  ...BASE_TX,
335
- ['owner', FIELD_TYPES.id, 'ak'],
291
+ ['owner', FIELD_TYPES.id, Encoding.AccountAddress],
336
292
  ['ctVersion', FIELD_TYPES.ctVersion],
337
- ['code', FIELD_TYPES.binary, 'cb'],
338
- ['log', FIELD_TYPES.binary, 'cb'],
293
+ ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],
294
+ ['log', FIELD_TYPES.binary, Encoding.ContractBytearray],
339
295
  ['active', FIELD_TYPES.bool],
340
- ['referers', FIELD_TYPES.ids, 'ak'],
341
- ['deposit', Deposit]
342
- ]
296
+ ['referers', FIELD_TYPES.ids, Encoding.AccountAddress],
297
+ ['deposit', deposit],
298
+ ],
343
299
  },
344
- [TX_TYPE.contractCreate]: {
300
+ [Tag.ContractCreateTx]: {
345
301
  1: [
346
302
  ...BASE_TX,
347
- ['ownerId', FIELD_TYPES.id, 'ak'],
348
- ['nonce', FIELD_TYPES.shortInt],
349
- ['code', FIELD_TYPES.binary, 'cb'],
303
+ ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],
304
+ ['nonce', shortUInt],
305
+ ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],
350
306
  ['ctVersion', FIELD_TYPES.ctVersion],
351
- ['fee', FIELD_TYPES.int],
352
- ['ttl', FIELD_TYPES.shortInt],
353
- ['deposit', Deposit],
354
- ['amount', FIELD_TYPES.amount],
355
- ['gasLimit', FIELD_TYPES.shortInt],
356
- ['gasPrice', GasPrice],
357
- ['callData', FIELD_TYPES.binary, 'cb']
358
- ]
307
+ ['fee', fee],
308
+ ['ttl', shortUInt],
309
+ ['deposit', deposit],
310
+ ['amount', coinAmount],
311
+ ['gasLimit', gasLimit],
312
+ ['gasPrice', gasPrice],
313
+ ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],
314
+ ],
359
315
  },
360
- [TX_TYPE.contractCall]: {
316
+ [Tag.ContractCallTx]: {
361
317
  1: [
362
318
  ...BASE_TX,
363
- ['callerId', FIELD_TYPES.id, 'ak'],
364
- ['nonce', FIELD_TYPES.shortInt],
365
- ['contractId', FIELD_TYPES.id, ['ct', 'nm']],
319
+ ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],
320
+ ['nonce', shortUInt],
321
+ ['contractId', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],
366
322
  ['abiVersion', FIELD_TYPES.abiVersion],
367
- ['fee', FIELD_TYPES.int],
368
- ['ttl', FIELD_TYPES.shortInt],
369
- ['amount', FIELD_TYPES.amount],
370
- ['gasLimit', FIELD_TYPES.shortInt],
371
- ['gasPrice', GasPrice],
372
- ['callData', FIELD_TYPES.binary, 'cb']
373
- ]
374
- },
375
- [TX_TYPE.contractCallResult]: {
376
- 1: [
377
- ...BASE_TX,
378
- ['callerId', FIELD_TYPES.id, 'ak'],
379
- ['callerNonce', FIELD_TYPES.shortInt],
380
- ['height', FIELD_TYPES.shortInt],
381
- ['contractId', FIELD_TYPES.id, 'ct'],
382
- ['gasPrice', GasPrice],
383
- ['gasUsed', FIELD_TYPES.shortInt],
384
- ['returnValue', FIELD_TYPES.binary, 'cb'],
323
+ ['fee', fee],
324
+ ['ttl', shortUInt],
325
+ ['amount', coinAmount],
326
+ ['gasLimit', gasLimit],
327
+ ['gasPrice', gasPrice],
328
+ ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],
329
+ ],
330
+ },
331
+ [Tag.ContractCall]: {
332
+ 1: [
333
+ ...BASE_TX,
334
+ ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],
335
+ ['callerNonce', shortUInt],
336
+ ['height', shortUInt],
337
+ ['contractId', FIELD_TYPES.id, Encoding.ContractAddress],
338
+ ['gasPrice', gasPrice],
339
+ ['gasUsed', shortUInt],
340
+ ['returnValue', FIELD_TYPES.binary, Encoding.ContractBytearray],
385
341
  ['returnType', FIELD_TYPES.callReturnType],
386
342
  // TODO: add serialization for
387
343
  // <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]
388
- ['log', FIELD_TYPES.rawBinary]
389
- ]
344
+ ['log', FIELD_TYPES.rawBinary],
345
+ ],
390
346
  },
391
- [TX_TYPE.oracleRegister]: {
347
+ [Tag.OracleRegisterTx]: {
392
348
  1: [
393
349
  ...BASE_TX,
394
- ['accountId', FIELD_TYPES.id, 'ak'],
395
- ['nonce', FIELD_TYPES.shortInt],
350
+ ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],
351
+ ['nonce', shortUInt],
396
352
  ['queryFormat', FIELD_TYPES.string],
397
353
  ['responseFormat', FIELD_TYPES.string],
398
- ['queryFee', FIELD_TYPES.amount],
354
+ ['queryFee', coinAmount],
399
355
  ['oracleTtlType', FIELD_TYPES.ttlType],
400
- ['oracleTtlValue', FIELD_TYPES.shortInt],
401
- ['fee', FIELD_TYPES.int],
402
- ['ttl', FIELD_TYPES.shortInt],
403
- ['abiVersion', FIELD_TYPES.abiVersion]
404
- ]
356
+ ['oracleTtlValue', shortUInt],
357
+ ['fee', fee],
358
+ ['ttl', shortUInt],
359
+ ['abiVersion', FIELD_TYPES.abiVersion],
360
+ ],
405
361
  },
406
- [TX_TYPE.oracleExtend]: {
362
+ [Tag.OracleExtendTx]: {
407
363
  1: [
408
364
  ...BASE_TX,
409
- ['oracleId', FIELD_TYPES.id, ['ok', 'nm']],
410
- ['nonce', FIELD_TYPES.shortInt],
365
+ ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],
366
+ ['nonce', shortUInt],
411
367
  ['oracleTtlType', FIELD_TYPES.ttlType],
412
- ['oracleTtlValue', FIELD_TYPES.shortInt],
413
- ['fee', FIELD_TYPES.int],
414
- ['ttl', FIELD_TYPES.shortInt]
415
- ]
368
+ ['oracleTtlValue', shortUInt],
369
+ ['fee', fee],
370
+ ['ttl', shortUInt],
371
+ ],
416
372
  },
417
- [TX_TYPE.oracleQuery]: {
373
+ [Tag.OracleQueryTx]: {
418
374
  1: [
419
375
  ...BASE_TX,
420
- ['senderId', FIELD_TYPES.id, 'ak'],
421
- ['nonce', FIELD_TYPES.shortInt],
422
- ['oracleId', FIELD_TYPES.id, ['ok', 'nm']],
376
+ ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],
377
+ ['nonce', shortUInt],
378
+ ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],
423
379
  ['query', FIELD_TYPES.string],
424
- ['queryFee', FIELD_TYPES.amount],
380
+ ['queryFee', coinAmount],
425
381
  ['queryTtlType', FIELD_TYPES.ttlType],
426
- ['queryTtlValue', FIELD_TYPES.shortInt],
382
+ ['queryTtlValue', shortUInt],
427
383
  ['responseTtlType', FIELD_TYPES.ttlType],
428
- ['responseTtlValue', FIELD_TYPES.shortInt],
429
- ['fee', FIELD_TYPES.int],
430
- ['ttl', FIELD_TYPES.shortInt]
431
- ]
384
+ ['responseTtlValue', shortUInt],
385
+ ['fee', fee],
386
+ ['ttl', shortUInt],
387
+ ],
432
388
  },
433
- [TX_TYPE.oracleResponse]: {
389
+ [Tag.OracleResponseTx]: {
434
390
  1: [
435
391
  ...BASE_TX,
436
- ['oracleId', FIELD_TYPES.id, 'ok'],
437
- ['nonce', FIELD_TYPES.shortInt],
438
- ['queryId', FIELD_TYPES.binary, 'oq'],
392
+ ['oracleId', FIELD_TYPES.id, Encoding.OracleAddress],
393
+ ['nonce', shortUInt],
394
+ ['queryId', FIELD_TYPES.binary, Encoding.OracleQueryId],
439
395
  ['response', FIELD_TYPES.string],
440
396
  ['responseTtlType', FIELD_TYPES.ttlType],
441
- ['responseTtlValue', FIELD_TYPES.shortInt],
442
- ['fee', FIELD_TYPES.int],
443
- ['ttl', FIELD_TYPES.shortInt]
444
- ]
397
+ ['responseTtlValue', shortUInt],
398
+ ['fee', fee],
399
+ ['ttl', shortUInt],
400
+ ],
445
401
  },
446
- [TX_TYPE.channelCreate]: {
402
+ [Tag.ChannelCreateTx]: {
447
403
  2: [
448
404
  ...BASE_TX,
449
- ['initiator', FIELD_TYPES.id, 'ak'],
450
- ['initiatorAmount', FIELD_TYPES.int],
451
- ['responder', FIELD_TYPES.id, 'ak'],
452
- ['responderAmount', FIELD_TYPES.int],
453
- ['channelReserve', FIELD_TYPES.int],
454
- ['lockPeriod', FIELD_TYPES.int],
455
- ['ttl', FIELD_TYPES.shortInt],
456
- ['fee', FIELD_TYPES.int],
405
+ ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],
406
+ ['initiatorAmount', uInt],
407
+ ['responder', FIELD_TYPES.id, Encoding.AccountAddress],
408
+ ['responderAmount', uInt],
409
+ ['channelReserve', uInt],
410
+ ['lockPeriod', uInt],
411
+ ['ttl', shortUInt],
412
+ ['fee', fee],
457
413
  ['initiatorDelegateIds', FIELD_TYPES.string],
458
414
  ['responderDelegateIds', FIELD_TYPES.string],
459
415
  ['stateHash', FIELD_TYPES.binary, 'st'],
460
- ['nonce', FIELD_TYPES.shortInt]
461
- ]
416
+ ['nonce', shortUInt],
417
+ ],
462
418
  },
463
- [TX_TYPE.channelCloseMutual]: {
419
+ [Tag.ChannelCloseMutualTx]: {
464
420
  1: [
465
421
  ...BASE_TX,
466
- ['channelId', FIELD_TYPES.id, 'ch'],
467
- ['fromId', FIELD_TYPES.id, 'ak'],
468
- ['initiatorAmountFinal', FIELD_TYPES.int],
469
- ['responderAmountFinal', FIELD_TYPES.int],
470
- ['ttl', FIELD_TYPES.shortInt],
471
- ['fee', FIELD_TYPES.int],
472
- ['nonce', FIELD_TYPES.shortInt]
473
- ]
422
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
423
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
424
+ ['initiatorAmountFinal', uInt],
425
+ ['responderAmountFinal', uInt],
426
+ ['ttl', shortUInt],
427
+ ['fee', fee],
428
+ ['nonce', shortUInt],
429
+ ],
474
430
  },
475
- [TX_TYPE.channelCloseSolo]: {
431
+ [Tag.ChannelCloseSoloTx]: {
476
432
  1: [
477
433
  ...BASE_TX,
478
- ['channelId', FIELD_TYPES.id, 'ch'],
479
- ['fromId', FIELD_TYPES.id, 'ak'],
434
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
435
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
480
436
  ['payload', FIELD_TYPES.binary, 'tx'],
481
437
  ['poi', FIELD_TYPES.binary, 'pi'],
482
- ['ttl', FIELD_TYPES.shortInt],
483
- ['fee', FIELD_TYPES.int],
484
- ['nonce', FIELD_TYPES.shortInt]
485
- ]
438
+ ['ttl', shortUInt],
439
+ ['fee', fee],
440
+ ['nonce', shortUInt],
441
+ ],
486
442
  },
487
- [TX_TYPE.channelSlash]: {
443
+ [Tag.ChannelSlashTx]: {
488
444
  1: [
489
445
  ...BASE_TX,
490
- ['channelId', FIELD_TYPES.id, 'ch'],
491
- ['fromId', FIELD_TYPES.id, 'ak'],
446
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
447
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
492
448
  ['payload', FIELD_TYPES.binary, 'tx'],
493
449
  ['poi', FIELD_TYPES.binary, 'pi'],
494
- ['ttl', FIELD_TYPES.shortInt],
495
- ['fee', FIELD_TYPES.int],
496
- ['nonce', FIELD_TYPES.shortInt]
497
- ]
450
+ ['ttl', shortUInt],
451
+ ['fee', fee],
452
+ ['nonce', shortUInt],
453
+ ],
498
454
  },
499
- [TX_TYPE.channelDeposit]: {
455
+ [Tag.ChannelDepositTx]: {
500
456
  1: [
501
457
  ...BASE_TX,
502
- ['channelId', FIELD_TYPES.id, 'ch'],
503
- ['fromId', FIELD_TYPES.id, 'ak'],
504
- ['amount', FIELD_TYPES.int],
505
- ['ttl', FIELD_TYPES.shortInt],
506
- ['fee', FIELD_TYPES.int],
458
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
459
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
460
+ ['amount', uInt],
461
+ ['ttl', shortUInt],
462
+ ['fee', fee],
507
463
  ['stateHash', FIELD_TYPES.binary, 'st'],
508
- ['round', FIELD_TYPES.int],
509
- ['nonce', FIELD_TYPES.shortInt]
510
- ]
464
+ ['round', shortUInt],
465
+ ['nonce', shortUInt],
466
+ ],
511
467
  },
512
- [TX_TYPE.channelWithdraw]: {
468
+ [Tag.ChannelWithdrawTx]: {
513
469
  1: [
514
470
  ...BASE_TX,
515
- ['channelId', FIELD_TYPES.id, 'ch'],
516
- ['toId', FIELD_TYPES.id, 'ak'],
517
- ['amount', FIELD_TYPES.int],
518
- ['ttl', FIELD_TYPES.shortInt],
519
- ['fee', FIELD_TYPES.int],
471
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
472
+ ['toId', FIELD_TYPES.id, Encoding.AccountAddress],
473
+ ['amount', uInt],
474
+ ['ttl', shortUInt],
475
+ ['fee', fee],
520
476
  ['stateHash', FIELD_TYPES.binary, 'st'],
521
- ['round', FIELD_TYPES.int],
522
- ['nonce', FIELD_TYPES.shortInt]
523
- ]
477
+ ['round', shortUInt],
478
+ ['nonce', shortUInt],
479
+ ],
524
480
  },
525
- [TX_TYPE.channelSettle]: {
481
+ [Tag.ChannelSettleTx]: {
526
482
  1: [
527
483
  ...BASE_TX,
528
- ['channelId', FIELD_TYPES.id, 'ch'],
529
- ['fromId', FIELD_TYPES.id, 'ak'],
530
- ['initiatorAmountFinal', FIELD_TYPES.int],
531
- ['responderAmountFinal', FIELD_TYPES.int],
532
- ['ttl', FIELD_TYPES.shortInt],
533
- ['fee', FIELD_TYPES.int],
534
- ['nonce', FIELD_TYPES.shortInt]
535
- ]
484
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
485
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
486
+ ['initiatorAmountFinal', uInt],
487
+ ['responderAmountFinal', uInt],
488
+ ['ttl', shortUInt],
489
+ ['fee', fee],
490
+ ['nonce', shortUInt],
491
+ ],
536
492
  },
537
- [TX_TYPE.channelForceProgress]: {
493
+ [Tag.ChannelForceProgressTx]: {
538
494
  1: [
539
495
  ...BASE_TX,
540
- ['channelId', FIELD_TYPES.id, 'ch'],
541
- ['fromId', FIELD_TYPES.id, 'ak'],
496
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
497
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
542
498
  ['payload', FIELD_TYPES.binary, 'tx'],
543
- ['round', FIELD_TYPES.int],
544
- ['update', FIELD_TYPES.binary, 'cb'],
499
+ ['round', shortUInt],
500
+ ['update', FIELD_TYPES.binary, Encoding.ContractBytearray],
545
501
  ['stateHash', FIELD_TYPES.binary, 'st'],
546
502
  ['offChainTrees', FIELD_TYPES.stateTree],
547
- ['ttl', FIELD_TYPES.shortInt],
548
- ['fee', FIELD_TYPES.int],
549
- ['nonce', FIELD_TYPES.shortInt]
550
- ]
503
+ ['ttl', shortUInt],
504
+ ['fee', fee],
505
+ ['nonce', shortUInt],
506
+ ],
551
507
  },
552
- [TX_TYPE.channelOffChain]: {
508
+ [Tag.ChannelOffChainTx]: {
553
509
  2: [
554
510
  ...BASE_TX,
555
- ['channelId', FIELD_TYPES.id, 'ch'],
556
- ['round', FIELD_TYPES.int],
557
- ['stateHash', FIELD_TYPES.binary, 'st']
558
- ]
511
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
512
+ ['round', shortUInt],
513
+ ['stateHash', FIELD_TYPES.binary, 'st'],
514
+ ],
559
515
  },
560
- [TX_TYPE.channel]: {
516
+ [Tag.Channel]: {
561
517
  3: [
562
518
  ...BASE_TX,
563
- ['initiator', FIELD_TYPES.id, 'ak'],
564
- ['responder', FIELD_TYPES.id, 'ak'],
565
- ['channelAmount', FIELD_TYPES.int],
566
- ['initiatorAmount', FIELD_TYPES.int],
567
- ['responderAmount', FIELD_TYPES.int],
568
- ['channelReserve', FIELD_TYPES.int],
519
+ ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],
520
+ ['responder', FIELD_TYPES.id, Encoding.AccountAddress],
521
+ ['channelAmount', uInt],
522
+ ['initiatorAmount', uInt],
523
+ ['responderAmount', uInt],
524
+ ['channelReserve', uInt],
569
525
  ['initiatorDelegateIds', FIELD_TYPES.ids],
570
526
  ['responderDelegateIds', FIELD_TYPES.ids],
571
527
  ['stateHash', FIELD_TYPES.hex],
572
- ['round', FIELD_TYPES.int],
573
- ['soloRound', FIELD_TYPES.int],
574
- ['lockPeriod', FIELD_TYPES.int],
575
- ['lockedUntil', FIELD_TYPES.int],
576
- ['initiatorAuth', FIELD_TYPES.binary, 'cb'],
577
- ['responderAuth', FIELD_TYPES.binary, 'cb']
578
- ]
528
+ ['round', shortUInt],
529
+ ['soloRound', uInt],
530
+ ['lockPeriod', uInt],
531
+ ['lockedUntil', uInt],
532
+ ['initiatorAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],
533
+ ['responderAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],
534
+ ],
579
535
  },
580
- [TX_TYPE.channelSnapshotSolo]: {
536
+ [Tag.ChannelSnapshotSoloTx]: {
581
537
  1: [
582
538
  ...BASE_TX,
583
- ['channelId', FIELD_TYPES.id, 'ch'],
584
- ['fromId', FIELD_TYPES.id, 'ak'],
539
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
540
+ ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],
585
541
  ['payload', FIELD_TYPES.binary, 'tx'],
586
- ['ttl', FIELD_TYPES.shortInt],
587
- ['fee', FIELD_TYPES.int],
588
- ['nonce', FIELD_TYPES.shortInt]
589
- ]
542
+ ['ttl', shortUInt],
543
+ ['fee', fee],
544
+ ['nonce', shortUInt],
545
+ ],
590
546
  },
591
- [TX_TYPE.channelOffChainUpdateTransfer]: {
547
+ [Tag.ChannelOffChainUpdateTransfer]: {
592
548
  1: [
593
549
  ...BASE_TX,
594
- ['from', FIELD_TYPES.id, 'ak'],
595
- ['to', FIELD_TYPES.id, 'ak'],
596
- ['amount', FIELD_TYPES.int]
597
- ]
550
+ ['from', FIELD_TYPES.id, Encoding.AccountAddress],
551
+ ['to', FIELD_TYPES.id, Encoding.AccountAddress],
552
+ ['amount', uInt],
553
+ ],
598
554
  },
599
- [TX_TYPE.channelOffChainUpdateDeposit]: {
555
+ [Tag.ChannelOffChainUpdateDeposit]: {
600
556
  1: [
601
557
  ...BASE_TX,
602
- ['from', FIELD_TYPES.id, 'ak'],
603
- ['amount', FIELD_TYPES.int]
604
- ]
558
+ ['from', FIELD_TYPES.id, Encoding.AccountAddress],
559
+ ['amount', uInt],
560
+ ],
605
561
  },
606
- [TX_TYPE.channelOffChainUpdateWithdrawal]: {
562
+ [Tag.ChannelOffChainUpdateWithdraw]: {
607
563
  1: [
608
564
  ...BASE_TX,
609
- ['from', FIELD_TYPES.id, 'ak'],
610
- ['amount', FIELD_TYPES.int]
611
- ]
565
+ ['from', FIELD_TYPES.id, Encoding.AccountAddress],
566
+ ['amount', uInt],
567
+ ],
612
568
  },
613
- [TX_TYPE.channelOffChainCreateContract]: {
569
+ [Tag.ChannelOffChainUpdateCreateContract]: {
614
570
  1: [
615
571
  ...BASE_TX,
616
- ['owner', FIELD_TYPES.id, 'ak'],
572
+ ['owner', FIELD_TYPES.id, Encoding.AccountAddress],
617
573
  ['ctVersion', FIELD_TYPES.ctVersion],
618
- ['code', FIELD_TYPES.binary, 'cb'],
619
- ['deposit', FIELD_TYPES.int],
620
- ['callData', FIELD_TYPES.binary, 'cb']
621
- ]
574
+ ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],
575
+ ['deposit', uInt],
576
+ ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],
577
+ ],
622
578
  },
623
- [TX_TYPE.channelOffChainCallContract]: {
579
+ [Tag.ChannelOffChainUpdateCallContract]: {
624
580
  1: [
625
581
  ...BASE_TX,
626
- ['caller', FIELD_TYPES.id, 'ak'],
627
- ['contract', FIELD_TYPES.id, 'ct'],
582
+ ['caller', FIELD_TYPES.id, Encoding.AccountAddress],
583
+ ['contract', FIELD_TYPES.id, Encoding.ContractAddress],
628
584
  ['abiVersion', FIELD_TYPES.abiVersion],
629
- ['amount', FIELD_TYPES.int],
630
- ['callData', FIELD_TYPES.binary, 'cb'],
585
+ ['amount', uInt],
586
+ ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],
631
587
  ['callStack', FIELD_TYPES.callStack],
632
- ['gasPrice', GasPrice],
633
- ['gasLimit', FIELD_TYPES.shortInt]
634
- ]
588
+ ['gasPrice', gasPrice],
589
+ ['gasLimit', gasLimit],
590
+ ],
635
591
  },
636
- [TX_TYPE.channelReconnect]: {
592
+ [Tag.ChannelClientReconnectTx]: {
637
593
  1: [
638
594
  ...BASE_TX,
639
- ['channelId', FIELD_TYPES.id, 'ch'],
640
- ['round', FIELD_TYPES.int],
595
+ ['channelId', FIELD_TYPES.id, Encoding.Channel],
596
+ ['round', shortUInt],
641
597
  ['role', FIELD_TYPES.string],
642
- ['pubkey', FIELD_TYPES.id, 'ak']
643
- ]
598
+ ['pubkey', FIELD_TYPES.id, Encoding.AccountAddress],
599
+ ],
644
600
  },
645
- [TX_TYPE.proofOfInclusion]: {
601
+ [Tag.TreesPoi]: {
646
602
  1: [
647
603
  ...BASE_TX,
648
604
  ['accounts', FIELD_TYPES.mptrees],
@@ -650,10 +606,10 @@ export const TX_SCHEMA = {
650
606
  ['channels', FIELD_TYPES.mptrees],
651
607
  ['contracts', FIELD_TYPES.mptrees],
652
608
  ['ns', FIELD_TYPES.mptrees],
653
- ['oracles', FIELD_TYPES.mptrees]
654
- ]
609
+ ['oracles', FIELD_TYPES.mptrees],
610
+ ],
655
611
  },
656
- [TX_TYPE.stateTrees]: {
612
+ [Tag.StateTrees]: {
657
613
  1: [
658
614
  ...BASE_TX,
659
615
  ['contracts', FIELD_TYPES.rlpBinary],
@@ -661,111 +617,111 @@ export const TX_SCHEMA = {
661
617
  ['channels', FIELD_TYPES.rlpBinary],
662
618
  ['ns', FIELD_TYPES.rlpBinary],
663
619
  ['oracles', FIELD_TYPES.rlpBinary],
664
- ['accounts', FIELD_TYPES.rlpBinary]
665
- ]
620
+ ['accounts', FIELD_TYPES.rlpBinary],
621
+ ],
666
622
  },
667
- [TX_TYPE.merklePatriciaTree]: {
623
+ [Tag.Mtree]: {
668
624
  1: [
669
625
  ...BASE_TX,
670
- ['values', FIELD_TYPES.rlpBinaries]
671
- ]
626
+ ['values', FIELD_TYPES.rlpBinaries],
627
+ ],
672
628
  },
673
- [TX_TYPE.merklePatriciaTreeValue]: {
629
+ [Tag.MtreeValue]: {
674
630
  1: [
675
631
  ...BASE_TX,
676
632
  ['key', FIELD_TYPES.hex],
677
- ['value', FIELD_TYPES.rawBinary]
678
- ]
633
+ ['value', FIELD_TYPES.rawBinary],
634
+ ],
679
635
  },
680
- [TX_TYPE.contractsTree]: {
636
+ [Tag.ContractsMtree]: {
681
637
  1: [
682
638
  ...BASE_TX,
683
- ['contracts', FIELD_TYPES.rlpBinary]
684
- ]
639
+ ['contracts', FIELD_TYPES.rlpBinary],
640
+ ],
685
641
  },
686
- [TX_TYPE.contractCallsTree]: {
642
+ [Tag.CallsMtree]: {
687
643
  1: [
688
644
  ...BASE_TX,
689
- ['calls', FIELD_TYPES.rlpBinary]
690
- ]
645
+ ['calls', FIELD_TYPES.rlpBinary],
646
+ ],
691
647
  },
692
- [TX_TYPE.channelsTree]: {
648
+ [Tag.ChannelsMtree]: {
693
649
  1: [
694
650
  ...BASE_TX,
695
- ['channels', FIELD_TYPES.rlpBinary]
696
- ]
651
+ ['channels', FIELD_TYPES.rlpBinary],
652
+ ],
697
653
  },
698
- [TX_TYPE.nameserviceTree]: {
654
+ [Tag.NameserviceMtree]: {
699
655
  1: [
700
656
  ...BASE_TX,
701
- ['mtree', FIELD_TYPES.rlpBinary]
702
- ]
657
+ ['mtree', FIELD_TYPES.rlpBinary],
658
+ ],
703
659
  },
704
- [TX_TYPE.oraclesTree]: {
660
+ [Tag.OraclesMtree]: {
705
661
  1: [
706
662
  ...BASE_TX,
707
- ['otree', FIELD_TYPES.rlpBinary]
708
- ]
663
+ ['otree', FIELD_TYPES.rlpBinary],
664
+ ],
709
665
  },
710
- [TX_TYPE.accountsTree]: {
666
+ [Tag.AccountsMtree]: {
711
667
  1: [
712
668
  ...BASE_TX,
713
- ['accounts', FIELD_TYPES.rlpBinary]
714
- ]
669
+ ['accounts', FIELD_TYPES.rlpBinary],
670
+ ],
715
671
  },
716
- [TX_TYPE.gaAttach]: {
672
+ [Tag.GaAttachTx]: {
717
673
  1: [
718
674
  ...BASE_TX,
719
- ['ownerId', FIELD_TYPES.id, 'ak'],
720
- ['nonce', FIELD_TYPES.shortInt],
721
- ['code', FIELD_TYPES.binary, 'cb'],
675
+ ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],
676
+ ['nonce', shortUInt],
677
+ ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],
722
678
  ['authFun', FIELD_TYPES.rawBinary],
723
679
  ['ctVersion', FIELD_TYPES.ctVersion],
724
- ['fee', FIELD_TYPES.int],
725
- ['ttl', FIELD_TYPES.shortInt],
726
- ['gasLimit', FIELD_TYPES.shortInt],
727
- ['gasPrice', GasPrice],
728
- ['callData', FIELD_TYPES.binary, 'cb']
729
- ]
730
- },
731
- [TX_TYPE.gaMeta]: {
680
+ ['fee', fee],
681
+ ['ttl', shortUInt],
682
+ ['gasLimit', gasLimit],
683
+ ['gasPrice', gasPrice],
684
+ ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],
685
+ ],
686
+ },
687
+ [Tag.GaMetaTx]: {
732
688
  2: [
733
689
  ...BASE_TX,
734
- ['gaId', FIELD_TYPES.id, 'ak'],
735
- ['authData', FIELD_TYPES.binary, 'cb'],
690
+ ['gaId', FIELD_TYPES.id, Encoding.AccountAddress],
691
+ ['authData', FIELD_TYPES.binary, Encoding.ContractBytearray],
736
692
  ['abiVersion', FIELD_TYPES.abiVersion],
737
- ['fee', FIELD_TYPES.int],
738
- ['gasLimit', FIELD_TYPES.shortInt],
739
- ['gasPrice', GasPrice],
740
- ['tx', FIELD_TYPES.rlpBinary]
741
- ]
693
+ ['fee', fee],
694
+ ['gasLimit', gasLimit],
695
+ ['gasPrice', gasPrice],
696
+ ['tx', FIELD_TYPES.rlpBinary],
697
+ ],
742
698
  },
743
- [TX_TYPE.payingFor]: {
699
+ [Tag.PayingForTx]: {
744
700
  1: [
745
701
  ...BASE_TX,
746
- ['payerId', FIELD_TYPES.id, 'ak'],
747
- ['nonce', FIELD_TYPES.shortInt],
748
- ['fee', FIELD_TYPES.int],
749
- ['tx', FIELD_TYPES.rlpBinary]
750
- ]
702
+ ['payerId', FIELD_TYPES.id, Encoding.AccountAddress],
703
+ ['nonce', shortUInt],
704
+ ['fee', fee],
705
+ ['tx', FIELD_TYPES.rlpBinary],
706
+ ],
751
707
  },
752
- [TX_TYPE.sophiaByteCode]: {
708
+ [Tag.CompilerSophia]: {
753
709
  3: [
754
710
  ...BASE_TX,
755
711
  ['sourceCodeHash', FIELD_TYPES.rawBinary],
756
712
  ['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo],
757
713
  ['byteCode', FIELD_TYPES.rawBinary],
758
714
  ['compilerVersion', FIELD_TYPES.string],
759
- ['payable', FIELD_TYPES.bool]
760
- ]
761
- }
762
- } as const
715
+ ['payable', FIELD_TYPES.bool],
716
+ ],
717
+ },
718
+ } as const;
763
719
 
764
720
  export type TxTypeSchemas = {
765
- [key in TX_TYPE]: BuildTxArgBySchema<
721
+ [key in Tag]: BuildTxArgBySchema<
766
722
  typeof TX_SCHEMA[key][keyof typeof TX_SCHEMA[key]]
767
723
  >
768
- }
724
+ };
769
725
 
770
- export type TxSchema = TxTypeSchemas[TX_TYPE]
771
- export type TxParamsCommon = Partial<UnionToIntersection<TxSchema>>
726
+ export type TxSchema = TxTypeSchemas[Tag];
727
+ export type TxParamsCommon = Partial<UnionToIntersection<TxSchema>>;