wan-ton-sdk 0.0.7 → 0.0.9

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 (247) hide show
  1. package/dist/Bridge.compile.d.ts +2 -0
  2. package/dist/Bridge.compile.js +9 -0
  3. package/dist/Bridge.d.ts +208 -0
  4. package/dist/Bridge.js +468 -0
  5. package/dist/Fake.compile.d.ts +2 -0
  6. package/dist/Fake.compile.js +9 -0
  7. package/dist/GroupApprove.compile.d.ts +2 -0
  8. package/dist/GroupApprove.compile.js +7 -0
  9. package/dist/GroupApprove.d.ts +124 -0
  10. package/dist/GroupApprove.js +181 -0
  11. package/dist/JettonMinter.compile.d.ts +2 -0
  12. package/dist/JettonMinter.compile.js +6 -0
  13. package/dist/JettonMinter.d.ts +45 -0
  14. package/dist/JettonMinter.js +124 -0
  15. package/dist/JettonWallet.compile.d.ts +2 -0
  16. package/dist/JettonWallet.compile.js +6 -0
  17. package/dist/JettonWallet.d.ts +26 -0
  18. package/dist/JettonWallet.js +103 -0
  19. package/dist/Signature.compile.d.ts +2 -0
  20. package/dist/Signature.compile.js +7 -0
  21. package/dist/Signature.d.ts +44 -0
  22. package/dist/Signature.js +106 -0
  23. package/dist/address.compile.d.ts +2 -0
  24. package/dist/address.compile.js +9 -0
  25. package/dist/client/client-interface.d.ts +35 -0
  26. package/dist/client/client-interface.js +9 -0
  27. package/dist/client/client.d.ts +22 -0
  28. package/dist/client/client.js +86 -0
  29. package/dist/client/tonapi-client.d.ts +4630 -0
  30. package/dist/client/tonapi-client.js +5376 -0
  31. package/dist/code/encode-decode.d.ts +132 -0
  32. package/dist/code/encode-decode.js +645 -0
  33. package/dist/code/userLock.d.ts +39 -0
  34. package/dist/code/userLock.js +284 -0
  35. package/dist/common.d.ts +9 -0
  36. package/dist/common.js +45 -0
  37. package/dist/config/config-ex.d.ts +7 -0
  38. package/dist/config/config-ex.js +73 -0
  39. package/dist/const/const-value.d.ts +21 -0
  40. package/dist/const/const-value.js +26 -0
  41. package/dist/contractAccess/bridgeAccess.d.ts +10 -0
  42. package/dist/contractAccess/bridgeAccess.js +55 -0
  43. package/dist/contractAccess/groupApproveAccess.d.ts +10 -0
  44. package/dist/contractAccess/groupApproveAccess.js +54 -0
  45. package/dist/db/Db.d.ts +24 -0
  46. package/dist/db/Db.js +739 -0
  47. package/dist/db/DbAccess.d.ts +24 -0
  48. package/dist/db/DbAccess.js +211 -0
  49. package/dist/db/common.d.ts +5 -0
  50. package/dist/db/common.js +114 -0
  51. package/dist/event/getEvents.d.ts +17 -0
  52. package/dist/event/getEvents.js +387 -0
  53. package/dist/example/db/createDb-ex.d.ts +1 -0
  54. package/{example/createDb-ex.ts → dist/example/db/createDb-ex.js} +3 -4
  55. package/dist/example/db/dbFeedTrans-ex.d.ts +1 -0
  56. package/{example/dbFeedTrans-ex.ts → dist/example/db/dbFeedTrans-ex.js} +9 -11
  57. package/dist/example/event/getAllEvents-ex.d.ts +1 -0
  58. package/dist/example/event/getAllEvents-ex.js +70 -0
  59. package/dist/example/event/getEventByHash-ex.d.ts +1 -0
  60. package/{example/getEventByHash-ex.ts → dist/example/event/getEventByHash-ex.js} +21 -25
  61. package/dist/example/event/getEventsByRange-ex.d.ts +1 -0
  62. package/dist/example/event/getEventsByRange-ex.js +58 -0
  63. package/dist/example/getAllTrans.d.ts +1 -0
  64. package/dist/example/getAllTrans.js +30 -0
  65. package/dist/example/jetton/getJettonInfo-ex.d.ts +1 -0
  66. package/dist/example/jetton/getJettonInfo-ex.js +32 -0
  67. package/dist/example/lock-release/smgRelease-ex.d.ts +1 -0
  68. package/dist/example/lock-release/smgRelease-ex.js +134 -0
  69. package/dist/example/lock-release/userLock-ex.d.ts +1 -0
  70. package/dist/example/lock-release/userLock-ex.js +69 -0
  71. package/dist/example/manage/addSmg-ex.d.ts +1 -0
  72. package/dist/example/manage/addSmg-ex.js +59 -0
  73. package/dist/example/manage/compileContract-ex.d.ts +1 -0
  74. package/dist/example/manage/compileContract-ex.js +11 -0
  75. package/dist/example/manage/deploy-ex.d.ts +1 -0
  76. package/dist/example/manage/deploy-ex.js +58 -0
  77. package/dist/example/manage/setFee-ex.d.ts +1 -0
  78. package/dist/example/manage/setFee-ex.js +61 -0
  79. package/dist/example/manage/setFeeProxy.d.ts +1 -0
  80. package/dist/example/manage/setFeeProxy.js +47 -0
  81. package/dist/example/manage/upgradeBridgeSc-ex.d.ts +1 -0
  82. package/dist/example/manage/upgradeBridgeSc-ex.js +44 -0
  83. package/dist/example/token/AddToken-ex.d.ts +1 -0
  84. package/dist/example/token/AddToken-ex.js +113 -0
  85. package/dist/example/token/addTokenPair-ex.d.ts +1 -0
  86. package/dist/example/token/addTokenPair-ex.js +59 -0
  87. package/dist/example/token/delTokenPair-ex.d.ts +1 -0
  88. package/dist/example/token/delTokenPair-ex.js +49 -0
  89. package/dist/example/token/getTokenPair-ex.d.ts +1 -0
  90. package/dist/example/token/getTokenPair-ex.js +39 -0
  91. package/dist/example/token/mintToken-ex.d.ts +1 -0
  92. package/dist/example/token/mintToken-ex.js +56 -0
  93. package/dist/example/tran/converTranToTonTran.d.ts +1 -0
  94. package/dist/example/tran/converTranToTonTran.js +32 -0
  95. package/dist/example/tran/getTransByRange-ex.d.ts +1 -0
  96. package/{example/getTransByRange-ex.ts → dist/example/tran/getTransByRange-ex.js} +26 -40
  97. package/dist/example/tran/getTransaction-ex.d.ts +1 -0
  98. package/dist/example/tran/getTransaction-ex.js +47 -0
  99. package/dist/example/tran/isTranSuccess-ex.d.ts +1 -0
  100. package/dist/example/tran/isTranSuccess-ex.js +27 -0
  101. package/dist/fee/fee.d.ts +12 -0
  102. package/dist/fee/fee.js +21 -0
  103. package/dist/index.d.ts +15 -0
  104. package/dist/index.js +95 -0
  105. package/dist/jest.config.d.ts +3 -0
  106. package/dist/jest.config.js +8 -0
  107. package/dist/opcodes.d.ts +55 -0
  108. package/dist/opcodes.js +59 -0
  109. package/dist/sign/buildHash.d.ts +6 -0
  110. package/dist/sign/buildHash.js +39 -0
  111. package/dist/sign/rawTrans.d.ts +36 -0
  112. package/dist/sign/rawTrans.js +89 -0
  113. package/dist/sign/tools-secp256k1.d.ts +21 -0
  114. package/{sign → dist/sign}/tools-secp256k1.js +18 -44
  115. package/dist/testData/JettonMinter.compile.func.d.ts +2 -0
  116. package/dist/testData/JettonMinter.compile.func.js +13 -0
  117. package/dist/testData/JettonWallet.compile.func.d.ts +2 -0
  118. package/dist/testData/JettonWallet.compile.func.js +13 -0
  119. package/dist/testData/bridge.compile.func.d.ts +2 -0
  120. package/dist/testData/bridge.compile.func.js +13 -0
  121. package/dist/transResult/transResult.d.ts +29 -0
  122. package/dist/transResult/transResult.js +528 -0
  123. package/dist/utils/compileContract.d.ts +13 -0
  124. package/dist/utils/compileContract.js +54 -0
  125. package/dist/utils/logger.d.ts +16 -0
  126. package/dist/utils/logger.js +94 -0
  127. package/dist/utils/utils.d.ts +26 -0
  128. package/dist/utils/utils.js +330 -0
  129. package/dist/wallet/balance.d.ts +5 -0
  130. package/dist/wallet/balance.js +29 -0
  131. package/dist/wallet/jetton.d.ts +16 -0
  132. package/dist/wallet/jetton.js +171 -0
  133. package/dist/wallet/walletContract.d.ts +31 -0
  134. package/dist/wallet/walletContract.js +106 -0
  135. package/package.json +8 -6
  136. package/Bridge.compile.ts +0 -8
  137. package/Bridge.ts +0 -645
  138. package/Bridge.ts.org +0 -647
  139. package/Fake.compile.ts +0 -8
  140. package/GroupApprove.compile.ts +0 -6
  141. package/GroupApprove.ts +0 -274
  142. package/JettonMinter.compile.ts +0 -5
  143. package/JettonMinter.ts +0 -135
  144. package/JettonWallet.compile.ts +0 -5
  145. package/JettonWallet.ts +0 -127
  146. package/Signature.compile.ts +0 -6
  147. package/Signature.ts +0 -105
  148. package/address.compile.ts +0 -8
  149. package/client/1.json +0 -1730
  150. package/client/client.ts +0 -73
  151. package/client/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -15
  152. package/code/decode.spec.ts +0 -81
  153. package/code/encode-decode.ts +0 -622
  154. package/code/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -20
  155. package/code/log/wan-ton-sdk.out.2025-01-20 +0 -0
  156. package/code/userLock.ts +0 -291
  157. package/common.ts +0 -62
  158. package/config/config-ex.ts +0 -25
  159. package/config/config.ts +0 -1
  160. package/const/const-value.ts +0 -33
  161. package/contractAccess/bridgeAccess.ts +0 -60
  162. package/contractAccess/groupApproveAccess.ts +0 -59
  163. package/data/EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs.json +0 -7348
  164. package/db/Db.spec.ts +0 -193
  165. package/db/Db.ts +0 -736
  166. package/db/DbAccess.spec.ts +0 -23
  167. package/db/DbAccess.ts +0 -186
  168. package/db/common.ts +0 -94
  169. package/db/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -15
  170. package/db/log/wan-ton-sdk.out.2025-04-21 +0 -0
  171. package/event/getEvents.ts +0 -441
  172. package/event/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -15
  173. package/event/log/wan-ton-sdk.out.2024-12-19 +0 -0
  174. package/example/0:1.txt +0 -1
  175. package/example/AddToken-ex.ts +0 -148
  176. package/example/README.md +0 -21
  177. package/example/addSmg-ex.ts +0 -78
  178. package/example/addTokenPair-ex.ts +0 -73
  179. package/example/compileContract-ex.ts +0 -10
  180. package/example/converTranToTonTran.ts +0 -43
  181. package/example/delTokenPair-ex.ts +0 -63
  182. package/example/deploy-ex.ts +0 -68
  183. package/example/getAllEvents-ex.ts +0 -61
  184. package/example/getAllTrans.ts +0 -32
  185. package/example/getContractState-ex.ts +0 -33
  186. package/example/getEvents-ex.ts +0 -55
  187. package/example/getJettonInfo-ex.ts +0 -44
  188. package/example/getTokenPair-ex.ts +0 -47
  189. package/example/getTransaction-ex.ts +0 -62
  190. package/example/isTranSuccess-ex.ts +0 -33
  191. package/example/locateTx-ex.ts +0 -44
  192. package/example/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -55
  193. package/example/log/wan-ton-sdk.out.2025-04-21 +0 -447
  194. package/example/log/wan-ton-sdk.out.2025-04-22 +0 -1918
  195. package/example/log/wan-ton-sdk.out.2025-04-23 +0 -4216
  196. package/example/log/wan-ton-sdk.out.2025-04-24.gz +0 -0
  197. package/example/log/wan-ton-sdk.out.2025-04-25 +0 -46814
  198. package/example/log/wan-ton-sdk.out.2025-04-27.gz +0 -0
  199. package/example/log/wan-ton-sdk.out.2025-04-28 +0 -4966
  200. package/example/log/wan-ton-sdk.out.2025-04-29 +0 -1328
  201. package/example/log/wan-ton-sdk.out.2025-04-30 +0 -9
  202. package/example/mintToken-ex.ts +0 -82
  203. package/example/setFee-ex.ts +0 -82
  204. package/example/setFeeProxy.ts +0 -70
  205. package/example/smgRelease-ex.ts +0 -173
  206. package/example/upgradeBridgeSc-ex.ts +0 -49
  207. package/example/userLock-ex.ts +0 -78
  208. package/fee/fee.ts +0 -23
  209. package/index.ts +0 -76
  210. package/jest.config.ts +0 -9
  211. package/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -20
  212. package/log/wan-ton-sdk.out.2025-04-21 +0 -0
  213. package/log/wan-ton-sdk.out.2025-04-30 +0 -10
  214. package/opcodes.ts +0 -58
  215. package/publish.sh +0 -78
  216. package/sign/buildHash.ts +0 -47
  217. package/sign/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -15
  218. package/sign/log/wan-ton-sdk.out.2025-04-14 +0 -3
  219. package/sign/rawTrans.spec.ts +0 -117
  220. package/sign/rawTrans.ts +0 -122
  221. package/testData/JettonMinter.compile.func.ts +0 -8
  222. package/testData/JettonWallet.compile.func.ts +0 -8
  223. package/testData/addressList.json +0 -6
  224. package/testData/bridge.compile.func.ts +0 -8
  225. package/testData/bridge.compiled.json +0 -1
  226. package/testData/contractAddress.json +0 -7
  227. package/testData/jettonTokenInfo.json +0 -14
  228. package/testData/prvlist.json +0 -6
  229. package/testData/smg.json +0 -5
  230. package/testData/tokenInfo.json +0 -23
  231. package/transResult/transResult.ts +0 -608
  232. package/tsconfig.json +0 -19
  233. package/utils/.compiled.json +0 -1
  234. package/utils/compileContract.ts +0 -60
  235. package/utils/log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json +0 -15
  236. package/utils/log/wan-ton-sdk.out.2025-01-08 +0 -0
  237. package/utils/logger.spec.ts +0 -14
  238. package/utils/logger.ts +0 -96
  239. package/utils/utils.spec.ts +0 -21
  240. package/utils/utils.ts +0 -295
  241. package/wallet/balance.ts +0 -29
  242. package/wallet/jetton.spec.ts +0 -27
  243. package/wallet/jetton.ts +0 -159
  244. package/wallet/walletContract.spec.ts +0 -111
  245. package/wallet/walletContract.ts +0 -105
  246. /package/{client/log/wan-ton-sdk.out.2024-12-19 → dist/config/config.d.ts} +0 -0
  247. /package/{code/log/wan-ton-sdk.out.2025-01-15 → dist/config/config.js} +0 -0
@@ -1,622 +0,0 @@
1
- import {
2
- OP_CROSS_SmgRelease,
3
- OP_FEE_SetSmgFeeProxy,
4
- OP_GROUPAPPROVE_Execute,
5
- OP_GROUPAPPROVE_Proposol_SetSmgFeeProxy
6
- } from "../opcodes";
7
- import {Address, beginCell, Cell, SendMode} from "@ton/core";
8
- import * as opcodes from "../opcodes";
9
- import {BIP44_CHAINID, TON_COIN_ACCOUT, TON_COIN_ACCOUNT_STR, WK_CHIANID} from "../const/const-value";
10
-
11
- import {logger} from '../utils/logger'
12
- import {add0x, BufferrToHexString, int64ToByte32} from "../utils/utils";
13
- import {bigIntReplacer} from "../utils/utils";
14
- const formatUtil = require('util');
15
-
16
- export const codeTable = {
17
- [opcodes.OP_CROSS_UserLock]:{
18
- "enCode": function (opts: any): Cell{
19
- let retCell = Cell.EMPTY
20
- return retCell;
21
- },
22
- "deCode": function (cell: Cell): any{
23
- let slice = cell.beginParse();
24
- let opCode = slice.loadUint(32);
25
- let queryID = slice.loadUint(64);
26
- console.log("33333");
27
- let smgID = slice.loadUintBig(256); // why not use .loadUintBig(256)? should change all loadUint(256) to loadUintBig(256)?
28
- console.log("4444");
29
- let tokenPairID = slice.loadUint(32);
30
- let crossValue = slice.loadUintBig(256);
31
-
32
- let dstUserAccountLen = slice.loadUint(8);
33
- let dstUserAccountBuff = slice.loadBuffer(dstUserAccountLen);
34
- console.log("22222");
35
- let extraCell = slice.loadRef().beginParse();
36
- let addrTokenAccount = extraCell.loadAddress();
37
- let jwAddrSrc = extraCell.loadAddress();
38
- let jwAddrBridgeSc = extraCell.loadAddress();
39
- extraCell.endParse();
40
-
41
- let extraCell2 = slice.loadRef().beginParse();
42
- let senderAccount = extraCell2.loadAddress();
43
- console.log("1111111");
44
- let fee = extraCell2.loadUintBig(256);
45
- extraCell2.endParse();
46
-
47
- slice.endParse();
48
-
49
- return {
50
- uniqueID:queryID,
51
- smgID:int64ToByte32(smgID),
52
- tokenPairID,
53
- crossValue,
54
- dstUserAccount: add0x(dstUserAccountBuff.toString('hex')),
55
- addrTokenAccount: addrTokenAccount.toString(),
56
- jwAddrSrc,
57
- jwAddrBridgeSc,
58
- senderAccount,
59
- fee,
60
- }
61
- },
62
- "emitEvent": function (opts){
63
- return {
64
- eventName:"UserLockLogger",
65
- uniqueID:opts.uniqueID,
66
- smgID:opts.smgID,
67
- tokenPairID:opts.tokenPairID,
68
- value:opts.crossValue,
69
- fee:opts.fee,
70
- userAccount:opts.dstUserAccount,
71
- txHashBase64:opts.txHashBase64,
72
- txHash:opts.txHash,
73
- lt:opts?.lt,
74
- from:opts?.origin,
75
- prevTransactionHash:opts?.prevTransactionHash,
76
- prevTransactionLt:opts?.prevTransactionLt,
77
- }
78
- }
79
- },
80
- [opcodes.OP_CROSS_SmgRelease]: {
81
- "enCode": function (opts: any): Cell {
82
- logger.info(formatUtil.format("Entering enCode Function OP_CROSS_SmgRelease"));
83
- logger.info(formatUtil.format("op_cross_smgRelease opts %s",JSON.stringify(opts,bigIntReplacer)));
84
- let part2Cell = beginCell()
85
- .storeUint(opts.fee, 256)
86
- .storeAddress(opts.userAccount)
87
- .endCell();
88
-
89
- let part3Cell = beginCell()
90
- .storeUint(opts.e, 256)
91
- .storeUint(opts.p, 256)
92
- .storeUint(opts.s, 256)
93
- .endCell();
94
-
95
- let part4Cell = beginCell()
96
- .storeAddress(opts.bridgeJettonWalletAddr)
97
- .storeUint(opts.fwTonAmount,256)
98
- .storeUint(opts.totalTonAmount,256)
99
- .endCell();
100
-
101
- return beginCell()
102
- .storeUint(opcodes.OP_CROSS_SmgRelease, 32)
103
- .storeUint(opts.queryID ?? 0, 64)
104
- .storeUint(BigInt(opts.uniqueID), 256)
105
- .storeUint(BigInt(opts.smgID), 256)
106
- .storeUint(opts.tokenPairID, 32)
107
- .storeUint(opts.releaseValue, 256)
108
- .storeRef(part2Cell)
109
- .storeRef(part3Cell)
110
- .storeRef(part4Cell)
111
- .endCell()
112
- },
113
- "deCode": function (cell: Cell): any {
114
- let slice = cell.beginParse();
115
- let opCode = slice.loadUint(32);
116
- let queryID = slice.loadUint(64);
117
- let uniqueID = slice.loadUintBig(256);
118
- let smgID = slice.loadUintBig(256);
119
- let tokenPairID = slice.loadUint(32);
120
- let releaseValue = slice.loadUintBig(256);
121
-
122
- let part2Slice = slice.loadRef().beginParse();
123
- let fee = part2Slice.loadUintBig(256);
124
- let userAccount = part2Slice.loadAddress();
125
- part2Slice.endParse();
126
-
127
- let part3Slice = slice.loadRef().beginParse();
128
- let e = part3Slice.loadUintBig(256);
129
- let p = part3Slice.loadUintBig(256);
130
- let s = part3Slice.loadUintBig(256);
131
- part3Slice.endParse();
132
-
133
- let part4Slice = slice.loadRef().beginParse();
134
- let bridgeJettonWalletAddr = part4Slice.loadAddress();
135
- let fwTonAmount = part4Slice.loadUintBig(256);
136
- let totalTonAmount = part4Slice.loadUintBig(256);
137
- part4Slice.endParse();
138
-
139
- slice.endParse();
140
- return {
141
- opCode,
142
- queryID,
143
- uniqueID,
144
- smgID:int64ToByte32(BigInt(smgID)),
145
- tokenPairID,
146
- releaseValue,
147
- fee,
148
- userAccount,
149
- e,
150
- p,
151
- s,
152
- bridgeJettonWalletAddr,
153
- fwTonAmount,
154
- totalTonAmount,
155
- };
156
- },
157
- "emitEvent": function (opts){
158
- return {
159
- eventName:"SmgReleaseLogger",
160
- uniqueID:opts.uniqueID,
161
- smgID:opts.smgID.toString(16),
162
- tokenPairID:opts.tokenPairID,
163
- value:opts.releaseValue,
164
- fee:opts.fee,
165
- userAccount:opts.userAccount,
166
- txHashBase64:opts.txHashBase64,
167
- txHash:opts.txHash,
168
- lt:opts?.lt,
169
- }
170
- }
171
- },
172
- [opcodes.OP_FEE_SetTokenPairFee]: {
173
- "enCode": function (opts: any): Cell {
174
- logger.info(formatUtil.format("Entering enCode Function OP_CROSS_SmgRelease"));
175
- return beginCell()
176
- .storeUint(opcodes.OP_FEE_SetTokenPairFee, 32)
177
- .storeUint(opts.queryID ?? 0, 64)
178
- .storeUint(opts.tokenPairID, 32)
179
- .storeUint(opts.fee, 32)
180
- .endCell()
181
- },
182
- "deCode": function (cell: Cell): any {
183
- return 0;
184
- }
185
- },
186
- [opcodes.OP_FEE_SetSmgFeeProxy]: {
187
- "enCode": function (opts: any): Cell {
188
- logger.info(formatUtil.format("Entering enCode Function OP_FEE_SetSmgFeeProxy"));
189
- return beginCell()
190
- .storeUint(opcodes.OP_FEE_SetSmgFeeProxy, 32)
191
- .storeUint(opts.queryID ?? 0, 64)
192
- .storeAddress(opts.feeProxy)
193
- .endCell()
194
- },
195
- "deCode": function (cell: Cell): any {
196
- return 0;
197
- }
198
- },
199
- [opcodes.OP_GROUPAPPROVE_Proposol_SetSmgFeeProxy]: {
200
- "enCode": function (opts: any): Cell {
201
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_SetSmgFeeProxy"));
202
- let msg = beginCell()
203
- .storeUint(opcodes.OP_FEE_SetSmgFeeProxy, 32) // op (op #1 = increment)
204
- .storeAddress(opts.feeProxy)
205
- .endCell()
206
- return beginCell()
207
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
208
- .storeUint(opts.queryID ?? 0, 64)
209
- .storeUint(opts.chainId, 64) // chainId
210
- .storeAddress(opts.toAddr)
211
- .storeRef(msg)
212
- .endCell()
213
- },
214
- "deCode": function (cell: Cell): any {
215
- return 0;
216
- }
217
- },
218
- [opcodes.OP_GROUPAPPROVE_Proposol_AddCrossAdmin]: {
219
- "enCode": function (opts: any): Cell {
220
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_AddCrossAdmin"));
221
- let msg = beginCell()
222
- .storeUint(opcodes.OP_FEE_AddCrossAdmin, 32) // op (op #1 = increment)
223
- .storeAddress(opts.admin)
224
- .endCell()
225
- return beginCell()
226
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
227
- .storeUint(opts.queryID ?? 0, 64)
228
- .storeUint(opts.chainId, 64) // chainId
229
- .storeAddress(opts.toAddr)
230
- .storeRef(msg)
231
- .endCell()
232
- },
233
- "deCode": function (cell: Cell): any {
234
- return 0;
235
- }
236
- },
237
- [opcodes.OP_GROUPAPPROVE_Proposol_DelCrossAdmin]: {
238
- "enCode": function (opts: any): Cell {
239
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_AddCrossAdmin"));
240
- let msg = beginCell()
241
- .storeUint(opcodes.OP_FEE_DelCrossAdmin, 32) // op (op #1 = increment)
242
- .storeAddress(opts.admin)
243
- .endCell()
244
- return beginCell()
245
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
246
- .storeUint(opts.queryID ?? 0, 64)
247
- .storeUint(opts.chainId, 64) // chainId
248
- .storeAddress(opts.toAddr)
249
- .storeRef(msg)
250
- .endCell()
251
- },
252
- "deCode": function (cell: Cell): any {
253
- return 0;
254
- }
255
- },
256
- [opcodes.OP_GROUPAPPROVE_Proposol_TransferOwner]: {
257
- "enCode": function (opts: any): Cell {
258
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_AddCrossAdmin"));
259
- let msg = beginCell()
260
- .storeUint(opcodes.OP_COMMON_TransferOwner, 32) // op (op #1 = increment)
261
- .storeAddress(opts.owner)
262
- .endCell()
263
- return beginCell()
264
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
265
- .storeUint(opts.queryID ?? 0, 64)
266
- .storeUint(opts.chainId, 64) // chainId
267
- .storeAddress(opts.toAddr)
268
- .storeRef(msg)
269
- .endCell()
270
- },
271
- "deCode": function (cell: Cell): any {
272
- return 0;
273
- }
274
- },
275
- [opcodes.OP_GROUPAPPROVE_Proposol_TransferOperator]: {
276
- "enCode": function (opts: any): Cell {
277
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TransferOperator"));
278
- let msg = beginCell()
279
- .storeUint(opcodes.OP_FEE_SetFeeOperator, 32) // op (op #1 = increment)
280
- .storeAddress(opts.operator)
281
- .endCell()
282
- return beginCell()
283
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
284
- .storeUint(opts.queryID ?? 0, 64)
285
- .storeUint(opts.chainId, 64) // chainId
286
- .storeAddress(opts.toAddr)
287
- .storeRef(msg)
288
- .endCell()
289
- },
290
- "deCode": function (cell: Cell): any {
291
- return 0;
292
- }
293
- },
294
- [opcodes.OP_GROUPAPPROVE_Proposol_SetHalt]: {
295
- "enCode": function (opts: any): Cell {
296
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_AddCrossAdmin"));
297
- let msg = beginCell()
298
- .storeUint(opcodes.OP_COMMON_SetHalt, 32)
299
- .storeUint(opts.halt, 2)
300
- .endCell()
301
- return beginCell()
302
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
303
- .storeUint(opts.queryID ?? 0, 64)
304
- .storeUint(opts.chainId, 64) // chainId
305
- .storeAddress(opts.toAddr)
306
- .storeRef(msg)
307
- .endCell()
308
- },
309
- "deCode": function (cell: Cell): any {
310
- return 0;
311
- }
312
- },
313
- [opcodes.OP_GROUPAPPROVE_Proposol_TOKENPAIR_Upsert]: {
314
- "enCode": function (opts: any): Cell {
315
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TOKENPAIR_Upsert"));
316
- let toBuffer, fromBuffer
317
- if(opts.fromChainID == BIP44_CHAINID) {
318
- let fromAddr = Address.parseFriendly(opts.fromAccount)
319
- fromBuffer = fromAddr.address.hash
320
- toBuffer = Buffer.from(opts.toAccount.startsWith("0x")?opts.toAccount.slice(2):opts.toAccount,'hex')
321
- } else if(opts.toChainID == BIP44_CHAINID) {
322
- let toAddr = Address.parseFriendly(opts.toAccount)
323
- toBuffer = toAddr.address.hash
324
- fromBuffer = Buffer.from(opts.fromAccount.startsWith("0x")?opts.fromAccount.slice(2):opts.fromAccount,'hex')
325
- } else {
326
- throw("Error chain ID.")
327
- }
328
- let jettonAdminAddr = Address.parseFriendly(opts.jettonAdminAddr)
329
- let jettonAdminAddrBuffer = jettonAdminAddr.address.hash
330
- logger.info(formatUtil.format("fromBuffer,toBuffer:", fromBuffer.toString('hex'), toBuffer.toString('hex')));
331
-
332
- let msg = beginCell()
333
- .storeUint(opcodes.OP_TOKENPAIR_Upsert, 32)
334
- .storeUint(opts.tokenPairId, 32)
335
- .storeUint(opts.fromChainID, 32)
336
- .storeUint(opts.toChainID, 32)
337
- .storeUint(fromBuffer.length, 8)
338
- .storeUint(toBuffer.length, 8)
339
- .storeBuffer(jettonAdminAddrBuffer)
340
- .storeRef(beginCell().storeBuffer(fromBuffer).endCell())
341
- .storeRef(beginCell().storeBuffer(toBuffer).endCell())
342
- .endCell()
343
- return beginCell()
344
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
345
- .storeUint(opts.queryID ?? 0, 64)
346
- .storeUint(opts.chainId, 64) // chainId
347
- .storeAddress(opts.toAddr)
348
- .storeRef(msg)
349
- .endCell()
350
- },
351
- "deCode": function (cell: Cell): any {
352
- return 0;
353
- }
354
- },
355
- [opcodes.OP_GROUPAPPROVE_Proposol_TOKENPAIR_Remove]: {
356
- "enCode": function (opts: any): Cell {
357
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TOKENPAIR_Remove"));
358
- let msg = beginCell()
359
- .storeUint(opcodes.OP_TOKENPAIR_Remove, 32) // op (op #1 = increment)
360
- .storeUint(opts.tokenPairId, 32)
361
- .endCell()
362
- return beginCell()
363
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
364
- .storeUint(opts.queryID ?? 0, 64)
365
- .storeUint(opts.chainId, 64) // chainId
366
- .storeAddress(opts.toAddr)
367
- .storeRef(msg)
368
- .endCell()
369
- },
370
- "deCode": function (cell: Cell): any {
371
- return 0;
372
- }
373
- },
374
- [opcodes.OP_GROUPAPPROVE_Proposol_TranferFoundation]: {
375
- "enCode": function (opts: any): Cell {
376
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TranferFoundation"));
377
- let msg = beginCell()
378
- .storeUint(opcodes.OP_GROUPAPPROVE_TranferFoundation, 32) // op (op #1 = increment)
379
- .storeAddress(opts.foundation)
380
- .endCell()
381
- return beginCell()
382
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
383
- .storeUint(opts.queryID ?? 0, 64)
384
- .storeUint(opts.chainId, 64) // chainId
385
- .storeAddress(opts.toAddr)
386
- .storeRef(msg)
387
- .endCell()
388
- },
389
- "deCode": function (cell: Cell): any {
390
- return 0;
391
- }
392
- },
393
- [opcodes.OP_GROUPAPPROVE_Proposol_TransferOracleAdmin]: {
394
- "enCode": function (opts: any): Cell {
395
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TransferOracleAdmin"));
396
- let msg = beginCell()
397
- .storeUint(opcodes.OP_ORACLE_TransferOracleAdmin, 32) // op (op #1 = increment)
398
- .storeAddress(opts.oracleAdmin)
399
- .endCell()
400
- return beginCell()
401
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
402
- .storeUint(opts.queryID ?? 0, 64)
403
- .storeUint(opts.chainId, 64) // chainId
404
- .storeAddress(opts.toAddr)
405
- .storeRef(msg)
406
- .endCell()
407
- },
408
- "deCode": function (cell: Cell): any {
409
- return 0;
410
- }
411
- },
412
- [opcodes.OP_GROUPAPPROVE_Proposol_UpgradeSc]: {
413
- "enCode": function (opts: any): Cell {
414
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Proposol_TranferFoundation"));
415
- let msg = beginCell()
416
- .storeUint(opcodes.OP_UPGRADE_Code, 32) // op (op #1 = increment)
417
- .storeRef(opts.code)
418
- .endCell()
419
- return beginCell()
420
- .storeUint(opcodes.OP_GROUPAPPROVE_Proposol, 32) // op (op #1 = increment)
421
- .storeUint(opts.queryID ?? 0, 64)
422
- .storeUint(opts.chainId, 64) // chainId
423
- .storeAddress(opts.toAddr)
424
- .storeRef(msg)
425
- .endCell()
426
- },
427
- "deCode": function (cell: Cell): any {
428
- return 0;
429
- }
430
- },
431
- [opcodes.OP_GROUPAPPROVE_Execute]: {
432
- "enCode": function (opts: any): Cell {
433
- logger.info(formatUtil.format("Entering enCode Function OP_GROUPAPPROVE_Execute"));
434
-
435
- let proof = beginCell()
436
- .storeUint(opts.e, 256)
437
- .storeUint(opts.p, 256)
438
- .storeUint(opts.s, 256)
439
- .endCell();
440
- return beginCell()
441
- .storeUint(opcodes.OP_GROUPAPPROVE_Execute, 32)
442
- .storeUint(opts.queryID ?? 0, 64)
443
- .storeUint(opts.smgId, 256)
444
- .storeUint(opts.taskId,64)
445
- .storeRef(proof)
446
- .endCell()
447
- },
448
- "deCode": function (cell: Cell): any {
449
- return 0;
450
- }
451
- },
452
- [opcodes.OP_FEE_SetTokenPairFees]: {
453
- "enCode": function (opts: any): Cell {
454
- console.log("Entering enCode Function OP_CROSS_SmgReleases");
455
- let count = opts.tokenPairID.length
456
- let data = beginCell()
457
- .storeUint(opcodes.OP_FEE_SetTokenPairFees, 32)
458
- .storeUint(opts.queryID ?? 0, 64)
459
- .storeUint(count, 32)
460
- for(let i=0; i<count; i++) {
461
- data.storeUint(opts.tokenPairID[i], 32)
462
- .storeUint(opts.fee[i], 32)
463
- }
464
- return data.endCell()
465
- },
466
- "deCode": function (cell: Cell): any {
467
- return 0;
468
- }
469
- },
470
- [opcodes.OP_FEE_SetChainFee]: {
471
- "enCode": function (opts: any): Cell {
472
- console.log("Entering enCode Function OP_FEE_SetChainFees");
473
- return beginCell()
474
- .storeUint(opcodes.OP_FEE_SetChainFee, 32)
475
- .storeUint(opts.queryID ?? 0, 64)
476
- .storeUint(opts.srcChainId, 32)
477
- .storeUint(opts.dstChainId, 32)
478
- .storeUint(opts.contractFee, 32)
479
- .storeUint(opts.agentFee, 32)
480
- .endCell()
481
- },
482
- "deCode": function (cell: Cell): any {
483
- return 0;
484
- }
485
- },
486
- [opcodes.OP_FEE_SetChainFees]: {
487
- "enCode": function (opts: any): Cell {
488
- console.log("Entering enCode Function OP_FEE_SetChainFee");
489
- let count = opts.srcChainId.length
490
-
491
- let data = beginCell()
492
- .storeUint(opcodes.OP_FEE_SetChainFees, 32)
493
- .storeUint(opts.queryID ?? 0, 64)
494
- .storeUint(count, 32)
495
- for(let i=0; i<count; i++) {
496
- data.storeUint(opts.srcChainId[i], 32)
497
- .storeUint(opts.dstChainId[i], 32)
498
- .storeUint(opts.contractFee[i], 32)
499
- .storeUint(opts.agentFee[i], 32)
500
- }
501
-
502
- return data.endCell()
503
- },
504
- "deCode": function (cell: Cell): any {
505
- return 0;
506
- }
507
- },
508
- [opcodes.OP_TOKENPAIR_Upsert]: {
509
- "enCode": function (opts: any): Cell {
510
- let toBuffer, fromBuffer;
511
- if (opts.fromChainID == BIP44_CHAINID) {
512
- if (opts.fromAccount == "") {
513
- fromBuffer = Buffer.from(TON_COIN_ACCOUT.slice(2), 'hex')
514
- } else {
515
- let fromAddr = Address.parseFriendly(opts.fromAccount)
516
- fromBuffer = fromAddr.address.hash
517
- }
518
- toBuffer = Buffer.from(opts.toAccount.startsWith("0x")?opts.toAccount.substring(2):opts.toAccount, 'hex')
519
-
520
- } else if (opts.toChainID == BIP44_CHAINID) {
521
- if (opts.toAccount == "") {
522
- toBuffer = Buffer.from(TON_COIN_ACCOUT.slice(2), 'hex')
523
- } else {
524
- let toAddr = Address.parseFriendly(opts.toAccount)
525
- toBuffer = toAddr.address.hash
526
- }
527
- fromBuffer = Buffer.from(opts.fromAccount.startsWith("0x")?opts.fromAccount.substring(2):opts.fromAccount, 'hex')
528
- } else {
529
- throw ("Error chain ID.")
530
- }
531
-
532
- let jettonAdminBuffer;
533
- if (opts.jettonAdminAddr == "") {
534
- jettonAdminBuffer = Buffer.from(TON_COIN_ACCOUT.slice(2), 'hex')
535
- } else {
536
- jettonAdminBuffer = Address.parseFriendly(opts.jettonAdminAddr).address.hash
537
- }
538
-
539
- logger.info(formatUtil.format("fromBuffer,toBuffer:", fromBuffer.toString('hex'), toBuffer.toString('hex')));
540
- return beginCell()
541
- .storeUint(opcodes.OP_TOKENPAIR_Upsert, 32)
542
- .storeUint(opts.queryID ?? 0, 64)
543
- .storeUint(opts.tokenPairId, 32)
544
- .storeUint(opts.fromChainID, 32)
545
- .storeUint(opts.toChainID, 32)
546
- .storeUint(fromBuffer.length, 8)
547
- .storeUint(toBuffer.length, 8)
548
- .storeRef(beginCell().storeBuffer(fromBuffer).endCell())
549
- .storeRef(beginCell().storeBuffer(toBuffer).endCell())
550
- .storeBuffer(jettonAdminBuffer)
551
- .endCell()
552
- },
553
- "deCode": function (cell: Cell): any {
554
- let slice = cell.beginParse();
555
- let opCode = slice.loadUint(32);
556
- let queryID = slice.loadUint(64);
557
- let tokenPairID = slice.loadUint(32);
558
- let fromChainID = slice.loadUint(32);
559
- let toChainID = slice.loadUint(32);
560
- let fromLen = slice.loadUint(8);
561
- let toLength = slice.loadUint(8);
562
-
563
- let sliceFrom = slice.loadRef().beginParse();
564
- let fromBuffer = sliceFrom.loadBits(8*fromLen);
565
- sliceFrom.endParse();
566
- logger.info(formatUtil.format("fromBuffer=>",fromBuffer));
567
-
568
- let sliceTo = slice.loadRef().beginParse();
569
- let toBuffer = sliceTo.loadBits(8*toLength);
570
- sliceTo.endParse();
571
- logger.info(formatUtil.format("toBuffer=>",toBuffer));
572
- let jettonAdmin = slice.loadBits(256)
573
- slice.endParse();
574
-
575
- return {
576
- opCode,queryID,tokenPairID,fromChainID,toChainID,fromAccount:fromBuffer,toAccount:toBuffer,jettonAdmin:jettonAdmin
577
- }
578
- },
579
- "emitEvent": function(opts){
580
- return {
581
- eventName:"AddTokenPair",
582
- id:opts.tokenPairID,
583
- fromChainID:opts.fromChainID,
584
- fromAccount:opts.fromAccount,
585
- toChainID:opts.toChainID,
586
- toAccount:opts.toAccount,
587
- txHashBase64:opts.txHashBase64,
588
- txHash:opts.txHash,
589
- lt:opts?.lt,
590
- }
591
- }
592
- },
593
- [opcodes.OP_TOKENPAIR_Remove]: {
594
- "enCode": function (opts: any): Cell {
595
- return beginCell()
596
- .storeUint(opcodes.OP_TOKENPAIR_Remove, 32)
597
- .storeUint(opts.queryID ?? 0, 64)
598
- .storeUint(opts.tokenPairId, 32)
599
- .endCell();
600
- },
601
- "deCode": function (cell: Cell): any {
602
- let slice = cell.beginParse();
603
- let opCode = slice.loadUint(32);
604
- let queryID = slice.loadUint(64);
605
- let tokenPairID = slice.loadUint(32);
606
- slice.endParse();
607
-
608
- return {
609
- opCode,queryID,tokenPairID
610
- }
611
- },
612
- "emitEvent": function(opts){
613
- return {
614
- eventName:"RemoveTokenPair",
615
- id:opts.tokenPairID,
616
- txHashBase64:opts.txHashBase64,
617
- txHash:opts.txHash,
618
- lt:opts?.lt,
619
- }
620
- }
621
- }
622
- }
@@ -1,20 +0,0 @@
1
- {
2
- "keep": {
3
- "days": true,
4
- "amount": 10
5
- },
6
- "auditLog": "log/.ba8901062aebb86bf525b42c65ff84f9485419e4-audit.json",
7
- "files": [
8
- {
9
- "date": 1736922538508,
10
- "name": "log/wan-ton-sdk.out.2025-01-15",
11
- "hash": "a6cce10738a23748293b14f1744294dc6ff3d6989c1ed4237bb99bb267bf2a61"
12
- },
13
- {
14
- "date": 1737368456508,
15
- "name": "log/wan-ton-sdk.out.2025-01-20",
16
- "hash": "2e2ae9ecf306023279a14b86c75d2dc8e7875dd9977ee0600f34376690857d4f"
17
- }
18
- ],
19
- "hashType": "sha256"
20
- }
File without changes