@tonappchain/sdk 0.7.0-rc8 → 0.7.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.
Files changed (423) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +198 -191
  3. package/dist/artifacts/dev/index.d.ts +9 -0
  4. package/dist/artifacts/dev/index.js +52 -0
  5. package/dist/artifacts/dev/tac/addresses.d.ts +4 -0
  6. package/dist/artifacts/dev/tac/addresses.js +8 -0
  7. package/dist/artifacts/dev/tac/artifacts.d.ts +330 -0
  8. package/dist/artifacts/dev/tac/artifacts.js +26 -0
  9. package/dist/artifacts/dev/tac/endpoints.d.ts +2 -0
  10. package/dist/artifacts/dev/tac/endpoints.js +5 -0
  11. package/dist/artifacts/dev/tac/index.d.ts +6 -0
  12. package/dist/artifacts/dev/tac/index.js +43 -0
  13. package/dist/artifacts/dev/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
  14. package/dist/artifacts/dev/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
  15. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
  16. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
  17. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
  18. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
  19. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
  20. package/dist/artifacts/dev/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
  21. package/dist/artifacts/dev/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
  22. package/dist/artifacts/dev/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
  23. package/dist/artifacts/dev/tac/internal/scripts/utils/encoding.d.ts +4 -0
  24. package/dist/artifacts/dev/tac/internal/scripts/utils/encoding.js +18 -0
  25. package/dist/artifacts/dev/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
  26. package/dist/artifacts/dev/tac/internal/typechain-types/common.d.ts +50 -0
  27. package/dist/artifacts/dev/tac/internal/typechain-types/common.js +2 -0
  28. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
  29. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
  30. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
  31. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
  32. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
  33. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
  34. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
  35. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
  36. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
  37. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
  38. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
  39. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
  40. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
  41. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
  42. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
  43. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
  44. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
  45. package/dist/artifacts/dev/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
  46. package/dist/artifacts/dev/tac/multicall.d.ts +1 -0
  47. package/dist/artifacts/dev/tac/multicall.js +22 -0
  48. package/dist/artifacts/dev/tac/structs.d.ts +1 -0
  49. package/dist/artifacts/dev/tac/structs.js +2 -0
  50. package/dist/artifacts/dev/tac/utils.d.ts +1 -0
  51. package/dist/artifacts/dev/tac/utils.js +5 -0
  52. package/dist/artifacts/dev/tac/wrappers.d.ts +9 -0
  53. package/dist/artifacts/dev/tac/wrappers.js +2 -0
  54. package/dist/artifacts/dev/ton/addresses.d.ts +1 -0
  55. package/dist/artifacts/dev/ton/addresses.js +5 -0
  56. package/dist/artifacts/dev/ton/artifacts.d.ts +47 -0
  57. package/dist/artifacts/dev/ton/artifacts.js +26 -0
  58. package/dist/artifacts/dev/ton/endpoints.d.ts +3 -0
  59. package/dist/artifacts/dev/ton/endpoints.js +6 -0
  60. package/dist/artifacts/dev/ton/index.d.ts +3 -0
  61. package/dist/artifacts/dev/ton/index.js +40 -0
  62. package/dist/artifacts/dev/ton/internal/build/CrossChainLayer.compiled.json +1 -0
  63. package/dist/artifacts/dev/ton/internal/build/Executor.compiled.json +1 -0
  64. package/dist/artifacts/dev/ton/internal/build/JettonMinter.compiled.json +1 -0
  65. package/dist/artifacts/dev/ton/internal/build/JettonProxy.compiled.json +1 -0
  66. package/dist/artifacts/dev/ton/internal/build/JettonWallet.compiled.json +1 -0
  67. package/dist/artifacts/dev/ton/internal/build/NFTCollection.compiled.json +1 -0
  68. package/dist/artifacts/dev/ton/internal/build/NFTItem.compiled.json +1 -0
  69. package/dist/artifacts/dev/ton/internal/build/NFTProxy.compiled.json +1 -0
  70. package/dist/artifacts/dev/ton/internal/build/Settings.compiled.json +1 -0
  71. package/dist/artifacts/dev/ton/internal/wrappers/Constants.d.ts +56 -0
  72. package/dist/artifacts/dev/ton/internal/wrappers/Constants.js +62 -0
  73. package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
  74. package/dist/artifacts/dev/ton/internal/wrappers/CrossChainLayer.js +336 -0
  75. package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.d.ts +94 -0
  76. package/dist/artifacts/dev/ton/internal/wrappers/JettonMinter.js +202 -0
  77. package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.d.ts +80 -0
  78. package/dist/artifacts/dev/ton/internal/wrappers/JettonProxy.js +158 -0
  79. package/dist/{wrappers → artifacts/dev/ton/internal/wrappers}/JettonWallet.d.ts +52 -13
  80. package/dist/artifacts/dev/ton/internal/wrappers/JettonWallet.js +193 -0
  81. package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.d.ts +75 -0
  82. package/dist/artifacts/dev/ton/internal/wrappers/NFTCollection.js +151 -0
  83. package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.d.ts +82 -0
  84. package/dist/artifacts/dev/ton/internal/wrappers/NFTItem.js +148 -0
  85. package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.d.ts +84 -0
  86. package/dist/artifacts/dev/ton/internal/wrappers/NFTProxy.js +157 -0
  87. package/dist/artifacts/dev/ton/internal/wrappers/Settings.d.ts +80 -0
  88. package/dist/artifacts/dev/ton/internal/wrappers/Settings.js +152 -0
  89. package/dist/artifacts/dev/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
  90. package/dist/artifacts/dev/ton/internal/wrappers/utils/GasUtils.js +291 -0
  91. package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
  92. package/dist/artifacts/dev/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
  93. package/dist/artifacts/dev/ton/wrappers.d.ts +8 -0
  94. package/dist/artifacts/dev/ton/wrappers.js +27 -0
  95. package/dist/artifacts/index.d.ts +3 -0
  96. package/dist/artifacts/index.js +39 -0
  97. package/dist/artifacts/mainnet/index.d.ts +9 -0
  98. package/dist/artifacts/mainnet/index.js +52 -0
  99. package/dist/artifacts/mainnet/tac/addresses.d.ts +4 -0
  100. package/dist/artifacts/mainnet/tac/addresses.js +7 -0
  101. package/dist/artifacts/mainnet/tac/artifacts.d.ts +330 -0
  102. package/dist/artifacts/mainnet/tac/artifacts.js +26 -0
  103. package/dist/artifacts/mainnet/tac/endpoints.d.ts +2 -0
  104. package/dist/artifacts/mainnet/tac/endpoints.js +5 -0
  105. package/dist/artifacts/mainnet/tac/index.d.ts +6 -0
  106. package/dist/artifacts/mainnet/tac/index.js +43 -0
  107. package/dist/artifacts/mainnet/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
  108. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
  109. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
  110. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
  111. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
  112. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
  113. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
  114. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
  115. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
  116. package/dist/artifacts/mainnet/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
  117. package/dist/artifacts/mainnet/tac/internal/scripts/utils/encoding.d.ts +4 -0
  118. package/dist/artifacts/mainnet/tac/internal/scripts/utils/encoding.js +18 -0
  119. package/dist/artifacts/mainnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
  120. package/dist/artifacts/mainnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js +2 -0
  121. package/dist/artifacts/mainnet/tac/internal/typechain-types/common.d.ts +50 -0
  122. package/dist/artifacts/mainnet/tac/internal/typechain-types/common.js +2 -0
  123. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
  124. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
  125. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
  126. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
  127. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
  128. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
  129. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
  130. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
  131. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
  132. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
  133. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
  134. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
  135. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
  136. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
  137. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
  138. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
  139. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
  140. package/dist/artifacts/mainnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
  141. package/dist/artifacts/mainnet/tac/multicall.d.ts +1 -0
  142. package/dist/artifacts/mainnet/tac/multicall.js +22 -0
  143. package/dist/artifacts/mainnet/tac/structs.d.ts +1 -0
  144. package/dist/artifacts/mainnet/tac/structs.js +2 -0
  145. package/dist/artifacts/mainnet/tac/utils.d.ts +1 -0
  146. package/dist/artifacts/mainnet/tac/utils.js +5 -0
  147. package/dist/artifacts/mainnet/tac/wrappers.d.ts +9 -0
  148. package/dist/artifacts/mainnet/tac/wrappers.js +2 -0
  149. package/dist/artifacts/mainnet/ton/addresses.d.ts +1 -0
  150. package/dist/artifacts/mainnet/ton/addresses.js +4 -0
  151. package/dist/artifacts/mainnet/ton/artifacts.d.ts +47 -0
  152. package/dist/artifacts/mainnet/ton/artifacts.js +26 -0
  153. package/dist/artifacts/mainnet/ton/endpoints.d.ts +3 -0
  154. package/dist/artifacts/mainnet/ton/endpoints.js +6 -0
  155. package/dist/artifacts/mainnet/ton/index.d.ts +3 -0
  156. package/dist/artifacts/mainnet/ton/index.js +40 -0
  157. package/dist/artifacts/mainnet/ton/internal/build/CrossChainLayer.compiled.json +1 -0
  158. package/dist/artifacts/mainnet/ton/internal/build/Executor.compiled.json +1 -0
  159. package/dist/artifacts/mainnet/ton/internal/build/JettonMinter.compiled.json +1 -0
  160. package/dist/artifacts/mainnet/ton/internal/build/JettonProxy.compiled.json +1 -0
  161. package/dist/artifacts/mainnet/ton/internal/build/JettonWallet.compiled.json +1 -0
  162. package/dist/artifacts/mainnet/ton/internal/build/NFTCollection.compiled.json +1 -0
  163. package/dist/artifacts/mainnet/ton/internal/build/NFTItem.compiled.json +1 -0
  164. package/dist/artifacts/mainnet/ton/internal/build/NFTProxy.compiled.json +1 -0
  165. package/dist/artifacts/mainnet/ton/internal/build/Settings.compiled.json +1 -0
  166. package/dist/artifacts/mainnet/ton/internal/wrappers/Constants.d.ts +56 -0
  167. package/dist/artifacts/mainnet/ton/internal/wrappers/Constants.js +62 -0
  168. package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
  169. package/dist/artifacts/mainnet/ton/internal/wrappers/CrossChainLayer.js +336 -0
  170. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.d.ts +94 -0
  171. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonMinter.js +202 -0
  172. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonProxy.d.ts +80 -0
  173. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonProxy.js +158 -0
  174. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonWallet.d.ts +95 -0
  175. package/dist/artifacts/mainnet/ton/internal/wrappers/JettonWallet.js +193 -0
  176. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTCollection.d.ts +75 -0
  177. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTCollection.js +151 -0
  178. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTItem.d.ts +82 -0
  179. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTItem.js +148 -0
  180. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTProxy.d.ts +84 -0
  181. package/dist/artifacts/mainnet/ton/internal/wrappers/NFTProxy.js +157 -0
  182. package/dist/artifacts/mainnet/ton/internal/wrappers/Settings.d.ts +80 -0
  183. package/dist/artifacts/mainnet/ton/internal/wrappers/Settings.js +152 -0
  184. package/dist/artifacts/mainnet/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
  185. package/dist/artifacts/mainnet/ton/internal/wrappers/utils/GasUtils.js +291 -0
  186. package/dist/artifacts/mainnet/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
  187. package/dist/artifacts/mainnet/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
  188. package/dist/artifacts/mainnet/ton/wrappers.d.ts +8 -0
  189. package/dist/artifacts/mainnet/ton/wrappers.js +27 -0
  190. package/dist/artifacts/tacTypes.d.ts +13 -0
  191. package/dist/artifacts/tacTypes.js +2 -0
  192. package/dist/artifacts/testnet/index.d.ts +9 -0
  193. package/dist/artifacts/testnet/index.js +52 -0
  194. package/dist/artifacts/testnet/tac/addresses.d.ts +4 -0
  195. package/dist/artifacts/testnet/tac/addresses.js +7 -0
  196. package/dist/artifacts/testnet/tac/artifacts.d.ts +330 -0
  197. package/dist/artifacts/testnet/tac/artifacts.js +26 -0
  198. package/dist/artifacts/testnet/tac/endpoints.d.ts +2 -0
  199. package/dist/artifacts/testnet/tac/endpoints.js +5 -0
  200. package/dist/artifacts/testnet/tac/index.d.ts +6 -0
  201. package/dist/artifacts/testnet/tac/index.js +43 -0
  202. package/dist/artifacts/testnet/tac/internal/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
  203. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/core/Structs.sol/IStructsInterface.json +1087 -0
  204. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ICrossChainLayer.sol/ICrossChainLayer.json +114 -0
  205. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ISettings.sol/ISettings.json +194 -0
  206. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/ITokenUtils.sol/ITokenUtils.json +164 -0
  207. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC20.sol/ICrossChainLayerERC20.json +278 -0
  208. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/ICrossChainLayerERC721.sol/ICrossChainLayerERC721.json +380 -0
  209. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/interfaces/tokens/IERC20WithDecimals.sol/IERC20WithDecimals.json +207 -0
  210. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/smart-account/interfaces/ISAFactory.sol/ISAFactory.json +103 -0
  211. package/dist/artifacts/testnet/tac/internal/artifacts/contracts/smart-account/interfaces/ITacSmartAccount.sol/ITacSmartAccount.json +181 -0
  212. package/dist/artifacts/testnet/tac/internal/scripts/utils/encoding.d.ts +4 -0
  213. package/dist/artifacts/testnet/tac/internal/scripts/utils/encoding.js +18 -0
  214. package/dist/artifacts/testnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
  215. package/dist/artifacts/testnet/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js +2 -0
  216. package/dist/artifacts/testnet/tac/internal/typechain-types/common.d.ts +50 -0
  217. package/dist/artifacts/testnet/tac/internal/typechain-types/common.js +2 -0
  218. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.d.ts +356 -0
  219. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/core/Structs.sol/IStructsInterface.js +2 -0
  220. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.d.ts +75 -0
  221. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ICrossChainLayer.js +2 -0
  222. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ISettings.d.ts +123 -0
  223. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ISettings.js +2 -0
  224. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.d.ts +99 -0
  225. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/ITokenUtils.js +2 -0
  226. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.d.ts +182 -0
  227. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC20.js +2 -0
  228. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.d.ts +244 -0
  229. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/ICrossChainLayerERC721.js +2 -0
  230. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.d.ts +133 -0
  231. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/interfaces/tokens/IERC20WithDecimals.js +2 -0
  232. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.d.ts +77 -0
  233. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ISAFactory.js +2 -0
  234. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.d.ts +127 -0
  235. package/dist/artifacts/testnet/tac/internal/typechain-types/contracts/smart-account/interfaces/ITacSmartAccount.js +2 -0
  236. package/dist/artifacts/testnet/tac/multicall.d.ts +1 -0
  237. package/dist/artifacts/testnet/tac/multicall.js +22 -0
  238. package/dist/artifacts/testnet/tac/structs.d.ts +1 -0
  239. package/dist/artifacts/testnet/tac/structs.js +2 -0
  240. package/dist/artifacts/testnet/tac/utils.d.ts +1 -0
  241. package/dist/artifacts/testnet/tac/utils.js +5 -0
  242. package/dist/artifacts/testnet/tac/wrappers.d.ts +9 -0
  243. package/dist/artifacts/testnet/tac/wrappers.js +2 -0
  244. package/dist/artifacts/testnet/ton/addresses.d.ts +1 -0
  245. package/dist/artifacts/testnet/ton/addresses.js +4 -0
  246. package/dist/artifacts/testnet/ton/artifacts.d.ts +47 -0
  247. package/dist/artifacts/testnet/ton/artifacts.js +26 -0
  248. package/dist/artifacts/testnet/ton/endpoints.d.ts +3 -0
  249. package/dist/artifacts/testnet/ton/endpoints.js +6 -0
  250. package/dist/artifacts/testnet/ton/index.d.ts +3 -0
  251. package/dist/artifacts/testnet/ton/index.js +40 -0
  252. package/dist/artifacts/testnet/ton/internal/build/CrossChainLayer.compiled.json +1 -0
  253. package/dist/artifacts/testnet/ton/internal/build/Executor.compiled.json +1 -0
  254. package/dist/artifacts/testnet/ton/internal/build/JettonMinter.compiled.json +1 -0
  255. package/dist/artifacts/testnet/ton/internal/build/JettonProxy.compiled.json +1 -0
  256. package/dist/artifacts/testnet/ton/internal/build/JettonWallet.compiled.json +1 -0
  257. package/dist/artifacts/testnet/ton/internal/build/NFTCollection.compiled.json +1 -0
  258. package/dist/artifacts/testnet/ton/internal/build/NFTItem.compiled.json +1 -0
  259. package/dist/artifacts/testnet/ton/internal/build/NFTProxy.compiled.json +1 -0
  260. package/dist/artifacts/testnet/ton/internal/build/Settings.compiled.json +1 -0
  261. package/dist/artifacts/testnet/ton/internal/wrappers/Constants.d.ts +56 -0
  262. package/dist/artifacts/testnet/ton/internal/wrappers/Constants.js +62 -0
  263. package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.d.ts +164 -0
  264. package/dist/artifacts/testnet/ton/internal/wrappers/CrossChainLayer.js +336 -0
  265. package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.d.ts +94 -0
  266. package/dist/artifacts/testnet/ton/internal/wrappers/JettonMinter.js +202 -0
  267. package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.d.ts +80 -0
  268. package/dist/artifacts/testnet/ton/internal/wrappers/JettonProxy.js +158 -0
  269. package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.d.ts +95 -0
  270. package/dist/artifacts/testnet/ton/internal/wrappers/JettonWallet.js +193 -0
  271. package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.d.ts +75 -0
  272. package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.js +151 -0
  273. package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.d.ts +82 -0
  274. package/dist/artifacts/testnet/ton/internal/wrappers/NFTItem.js +148 -0
  275. package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.d.ts +84 -0
  276. package/dist/artifacts/testnet/ton/internal/wrappers/NFTProxy.js +157 -0
  277. package/dist/artifacts/testnet/ton/internal/wrappers/Settings.d.ts +80 -0
  278. package/dist/artifacts/testnet/ton/internal/wrappers/Settings.js +152 -0
  279. package/dist/artifacts/testnet/ton/internal/wrappers/utils/GasUtils.d.ts +79 -0
  280. package/dist/artifacts/testnet/ton/internal/wrappers/utils/GasUtils.js +291 -0
  281. package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.d.ts +7 -0
  282. package/dist/artifacts/testnet/ton/internal/wrappers/utils/MerkleRoots.js +27 -0
  283. package/dist/artifacts/testnet/ton/wrappers.d.ts +8 -0
  284. package/dist/artifacts/testnet/ton/wrappers.js +27 -0
  285. package/dist/artifacts/tonTypes.d.ts +20 -0
  286. package/dist/artifacts/tonTypes.js +2 -0
  287. package/dist/{adapters → src/adapters}/contractOpener.d.ts +2 -1
  288. package/dist/{adapters → src/adapters}/contractOpener.js +39 -6
  289. package/dist/src/adapters/index.d.ts +2 -0
  290. package/dist/src/adapters/index.js +18 -0
  291. package/dist/{adapters → src/adapters}/retryableContractOpener.d.ts +6 -3
  292. package/dist/{adapters → src/adapters}/retryableContractOpener.js +10 -11
  293. package/dist/src/agnosticSdk/AbiHandler.d.ts +27 -0
  294. package/dist/src/agnosticSdk/AbiHandler.js +137 -0
  295. package/dist/src/agnosticSdk/AgnosticSdk.d.ts +201 -0
  296. package/dist/src/agnosticSdk/AgnosticSdk.js +201 -0
  297. package/dist/src/agnosticSdk/AgnosticStructs.d.ts +108 -0
  298. package/dist/src/agnosticSdk/AgnosticStructs.js +23 -0
  299. package/dist/src/agnosticSdk/DebugHelpers.d.ts +88 -0
  300. package/dist/src/agnosticSdk/DebugHelpers.js +274 -0
  301. package/dist/src/agnosticSdk/HooksHandler.d.ts +43 -0
  302. package/dist/src/agnosticSdk/HooksHandler.js +102 -0
  303. package/dist/src/agnosticSdk/ReplacementHelper.d.ts +95 -0
  304. package/dist/src/agnosticSdk/ReplacementHelper.js +235 -0
  305. package/dist/{assets → src/assets}/AssetCache.d.ts +1 -1
  306. package/dist/{assets → src/assets}/AssetFactory.d.ts +2 -2
  307. package/dist/{assets → src/assets}/AssetFactory.js +1 -1
  308. package/dist/{assets → src/assets}/FT.d.ts +15 -17
  309. package/dist/{assets → src/assets}/FT.js +103 -56
  310. package/dist/{assets → src/assets}/NFT.d.ts +15 -16
  311. package/dist/{assets → src/assets}/NFT.js +62 -34
  312. package/dist/{assets → src/assets}/TON.d.ts +7 -13
  313. package/dist/{assets → src/assets}/TON.js +22 -20
  314. package/dist/src/errors/index.d.ts +2 -0
  315. package/dist/{errors → src/errors}/index.js +8 -2
  316. package/dist/{errors → src/errors}/instances.d.ts +11 -1
  317. package/dist/src/errors/instances.js +58 -0
  318. package/dist/src/index.d.ts +21 -0
  319. package/dist/{index.js → src/index.js} +38 -18
  320. package/dist/src/interfaces/Asset.d.ts +78 -0
  321. package/dist/src/interfaces/Asset.js +2 -0
  322. package/dist/src/interfaces/ContractOpener.d.ts +21 -0
  323. package/dist/src/interfaces/ContractOpener.js +2 -0
  324. package/dist/src/interfaces/IConfiguration.d.ts +35 -0
  325. package/dist/src/interfaces/IConfiguration.js +2 -0
  326. package/dist/src/interfaces/IHttpClient.d.ts +16 -0
  327. package/dist/src/interfaces/IHttpClient.js +2 -0
  328. package/dist/src/interfaces/ILiteSequencerClient.d.ts +43 -0
  329. package/dist/src/interfaces/ILiteSequencerClient.js +2 -0
  330. package/dist/src/interfaces/ILiteSequencerClientFactory.d.ts +9 -0
  331. package/dist/src/interfaces/ILiteSequencerClientFactory.js +2 -0
  332. package/dist/src/interfaces/ILogger.d.ts +10 -0
  333. package/dist/src/interfaces/ILogger.js +2 -0
  334. package/dist/src/interfaces/IOperationTracker.d.ts +81 -0
  335. package/dist/src/interfaces/IOperationTracker.js +2 -0
  336. package/dist/src/interfaces/ISimulator.d.ts +18 -0
  337. package/dist/src/interfaces/ISimulator.js +2 -0
  338. package/dist/src/interfaces/ITACTransactionManager.d.ts +15 -0
  339. package/dist/src/interfaces/ITACTransactionManager.js +2 -0
  340. package/dist/src/interfaces/ITONTransactionManager.d.ts +20 -0
  341. package/dist/src/interfaces/ITONTransactionManager.js +2 -0
  342. package/dist/src/interfaces/ITacSDK.d.ts +185 -0
  343. package/dist/src/interfaces/ITacSDK.js +2 -0
  344. package/dist/src/interfaces/SenderAbstraction.d.ts +35 -0
  345. package/dist/src/interfaces/SenderAbstraction.js +2 -0
  346. package/dist/src/interfaces/WalletInstanse.d.ts +20 -0
  347. package/dist/src/interfaces/WalletInstanse.js +2 -0
  348. package/dist/src/interfaces/index.d.ts +14 -0
  349. package/dist/src/interfaces/index.js +30 -0
  350. package/dist/src/sdk/AxiosHttpClient.d.ts +12 -0
  351. package/dist/src/sdk/AxiosHttpClient.js +23 -0
  352. package/dist/{sdk → src/sdk}/Configuration.d.ts +6 -5
  353. package/dist/src/sdk/Configuration.js +195 -0
  354. package/dist/{sdk → src/sdk}/Consts.d.ts +3 -0
  355. package/dist/{sdk → src/sdk}/Consts.js +4 -1
  356. package/dist/src/sdk/LiteSequencerClient.d.ts +18 -0
  357. package/dist/{sdk → src/sdk}/LiteSequencerClient.js +81 -25
  358. package/dist/{sdk → src/sdk}/Logger.d.ts +5 -5
  359. package/dist/{sdk → src/sdk}/Logger.js +12 -4
  360. package/dist/{sdk → src/sdk}/OperationTracker.d.ts +5 -13
  361. package/dist/{sdk → src/sdk}/OperationTracker.js +112 -16
  362. package/dist/src/sdk/Simulator.d.ts +11 -0
  363. package/dist/src/sdk/Simulator.js +70 -0
  364. package/dist/{sdk → src/sdk}/StartTracking.d.ts +1 -1
  365. package/dist/src/sdk/TACTransactionManager.d.ts +10 -0
  366. package/dist/src/sdk/TACTransactionManager.js +101 -0
  367. package/dist/src/sdk/TONTransactionManager.d.ts +17 -0
  368. package/dist/src/sdk/TONTransactionManager.js +220 -0
  369. package/dist/src/sdk/TacSdk.d.ts +44 -0
  370. package/dist/src/sdk/TacSdk.js +181 -0
  371. package/dist/{sdk → src/sdk}/TxFinalizer.d.ts +3 -2
  372. package/dist/{sdk → src/sdk}/TxFinalizer.js +13 -8
  373. package/dist/{sdk → src/sdk}/Utils.d.ts +14 -7
  374. package/dist/{sdk → src/sdk}/Utils.js +127 -34
  375. package/dist/{sdk → src/sdk}/Validator.d.ts +2 -2
  376. package/dist/{sdk → src/sdk}/Validator.js +6 -6
  377. package/dist/{sender → src/sender}/BatchSender.d.ts +1 -2
  378. package/dist/{sender → src/sender}/RawSender.d.ts +3 -3
  379. package/dist/{sender → src/sender}/SenderFactory.d.ts +1 -1
  380. package/dist/{sender → src/sender}/SenderFactory.js +1 -1
  381. package/dist/{sender → src/sender}/TonConnectSender.d.ts +2 -2
  382. package/dist/{sender → src/sender}/TonConnectSender.js +3 -3
  383. package/dist/{sender → src/sender}/index.d.ts +1 -1
  384. package/dist/{sender → src/sender}/index.js +1 -1
  385. package/dist/{structs → src/structs}/InternalStruct.d.ts +30 -6
  386. package/dist/{structs → src/structs}/Struct.d.ts +109 -62
  387. package/dist/{structs → src/structs}/Struct.js +7 -1
  388. package/dist/{wrappers → src/wrappers}/ContentUtils.js +0 -1
  389. package/dist/{wrappers → src/wrappers}/HighloadWalletV3.d.ts +2 -2
  390. package/package.json +57 -6
  391. package/dist/errors/index.d.ts +0 -2
  392. package/dist/errors/instances.js +0 -47
  393. package/dist/index.d.ts +0 -19
  394. package/dist/sdk/Configuration.js +0 -90
  395. package/dist/sdk/LiteSequencerClient.d.ts +0 -13
  396. package/dist/sdk/Simulator.d.ts +0 -23
  397. package/dist/sdk/Simulator.js +0 -169
  398. package/dist/sdk/TacSdk.d.ts +0 -24
  399. package/dist/sdk/TacSdk.js +0 -101
  400. package/dist/sdk/TransactionManager.d.ts +0 -22
  401. package/dist/sdk/TransactionManager.js +0 -269
  402. package/dist/sender/SenderAbstraction.d.ts +0 -22
  403. package/dist/sender/SenderAbstraction.js +0 -5
  404. package/dist/structs/Services.d.ts +0 -41
  405. package/dist/wrappers/JettonMaster.d.ts +0 -24
  406. package/dist/wrappers/JettonMaster.js +0 -53
  407. package/dist/wrappers/JettonWallet.js +0 -124
  408. package/dist/wrappers/Settings.d.ts +0 -10
  409. package/dist/wrappers/Settings.js +0 -38
  410. /package/dist/{structs/Services.js → artifacts/dev/tac/internal/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.js} +0 -0
  411. /package/dist/{assets → src/assets}/AssetCache.js +0 -0
  412. /package/dist/{assets → src/assets}/index.d.ts +0 -0
  413. /package/dist/{assets → src/assets}/index.js +0 -0
  414. /package/dist/{errors → src/errors}/errors.d.ts +0 -0
  415. /package/dist/{errors → src/errors}/errors.js +0 -0
  416. /package/dist/{sdk → src/sdk}/StartTracking.js +0 -0
  417. /package/dist/{sender → src/sender}/BatchSender.js +0 -0
  418. /package/dist/{sender → src/sender}/RawSender.js +0 -0
  419. /package/dist/{structs → src/structs}/InternalStruct.js +0 -0
  420. /package/dist/{wrappers → src/wrappers}/ContentUtils.d.ts +0 -0
  421. /package/dist/{wrappers → src/wrappers}/HighloadQueryId.d.ts +0 -0
  422. /package/dist/{wrappers → src/wrappers}/HighloadQueryId.js +0 -0
  423. /package/dist/{wrappers → src/wrappers}/HighloadWalletV3.js +0 -0
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgnosticProxySDK = void 0;
4
+ const mainnet_1 = require("../../artifacts/mainnet");
5
+ const testnet_1 = require("../../artifacts/testnet");
6
+ const Struct_1 = require("../structs/Struct");
7
+ const AbiHandler_1 = require("./AbiHandler");
8
+ const DebugHelpers_1 = require("./DebugHelpers");
9
+ const HooksHandler_1 = require("./HooksHandler");
10
+ const ReplacementHelper_1 = require("./ReplacementHelper");
11
+ /**
12
+ * SDK for building AgnosticProxy Zap calls with efficient hook encoding
13
+ * @param network - The network to use (MAINNET || TESTNET || DEV)
14
+ * @param agnosticProxyAddress - The address of the agnostic proxy(optional)
15
+ */
16
+ class AgnosticProxySDK {
17
+ constructor(network, agnosticProxyAddress) {
18
+ switch (network) {
19
+ case Struct_1.Network.MAINNET:
20
+ this.agnosticProxyAddress = agnosticProxyAddress ?? mainnet_1.AGNOSTIC_PROXY_ADDRESS;
21
+ break;
22
+ case Struct_1.Network.TESTNET:
23
+ this.agnosticProxyAddress = agnosticProxyAddress ?? testnet_1.AGNOSTIC_PROXY_ADDRESS;
24
+ break;
25
+ case Struct_1.Network.DEV:
26
+ if (!agnosticProxyAddress) {
27
+ throw new Error('Agnostic proxy address is required for dev network');
28
+ }
29
+ this.agnosticProxyAddress = agnosticProxyAddress;
30
+ break;
31
+ }
32
+ this.abiHandler = new AbiHandler_1.AbiHandler();
33
+ this.replacementHelper = new ReplacementHelper_1.ReplacementHelper();
34
+ this.hooksHandler = new HooksHandler_1.HooksHandler();
35
+ this.debugHelpers = new DebugHelpers_1.DebugHelpers();
36
+ }
37
+ addContractInterface(address, abi) {
38
+ this.abiHandler.addContractInterface(address, abi);
39
+ return this;
40
+ }
41
+ /**
42
+ * Create a custom hook with optional dynamic value replacement
43
+ * @param contractAddress - The address of the contract to call
44
+ * @param functionName - The name of the function to call
45
+ * @param params - The parameters of the function to call
46
+ * @param options - The options of the custom hook
47
+ * @returns The custom hook
48
+ */
49
+ createCustomHook(contractAddress, functionName, params, options = {}) {
50
+ return this.hooksHandler.createCustomHook(contractAddress, functionName, params, this.abiHandler.contractInterfaces, options);
51
+ }
52
+ /**
53
+ * Create a full balance approve hook
54
+ * @param token - The token to approve
55
+ * @param to - The address to approve to
56
+ * @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
57
+ * @returns The full balance approve hook
58
+ */
59
+ createFullBalanceApproveHook(token, to, isFromSAPerspective = true) {
60
+ return this.hooksHandler.createFullBalanceApproveHook(token, to, isFromSAPerspective);
61
+ }
62
+ /**
63
+ * Create a full balance transfer hook
64
+ * @param token - The token to transfer
65
+ * @param to - The address to transfer to
66
+ * @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
67
+ * @returns The full balance transfer hook
68
+ */
69
+ createFullBalanceTransferHook(token, to, isFromSAPerspective = true) {
70
+ return this.hooksHandler.createFullBalanceTransferHook(token, to, isFromSAPerspective);
71
+ }
72
+ /**
73
+ * Utility: Create multiple approve hooks at once
74
+ * @param approvals - The approvals to create
75
+ * @returns The multiple approve hooks
76
+ */
77
+ createMultipleApproves(approvals) {
78
+ return this.hooksHandler.createMultipleApproves(approvals);
79
+ }
80
+ /**
81
+ * Utility: Create a sequence of custom hooks
82
+ * @param calls - The calls to create
83
+ * @returns The hook sequence
84
+ */
85
+ createHookSequence(calls) {
86
+ return calls.map((call) => this.createCustomHook(call.contract, call.functionName, call.params, call.options));
87
+ }
88
+ /**
89
+ * Helper to create dynamic amount replacement for a specific parameter
90
+ * @param paramIndex - The index of the parameter to replace
91
+ * @param token - The token to replace
92
+ * @param balanceAddress - The address to replace the parameter with
93
+ * @returns The amount replacement
94
+ */
95
+ createAmountReplacement(paramIndex, token, balanceAddress) {
96
+ return this.replacementHelper.createAmountReplacement(paramIndex, token, balanceAddress);
97
+ }
98
+ /**
99
+ * Advanced replacement calculator - calculates position and length for any parameter type
100
+ * Required that you have added the contract interface first using addContractInterface().
101
+ * If human readable abi is used, need to provide function and params names also
102
+ * @param contractAddress - The address of the contract to call
103
+ * @param functionName - The name of the function to call
104
+ * @param parameterName - The name of the parameter to replace
105
+ * @param token - The token to replace
106
+ * @param balanceAddress - The address to replace the parameter with
107
+ * @returns The replacement data
108
+ */
109
+ calculateReplacementData(contractAddress, functionName, parameterName, token, balanceAddress) {
110
+ return this.replacementHelper.calculateReplacementData(contractAddress, functionName, parameterName, token, balanceAddress, this.abiHandler.contractInterfaces);
111
+ }
112
+ /**
113
+ * Get replacement helper - shows available functions and parameters for a contract
114
+ * Required that you have added the contract interface first using addContractInterface().
115
+ * If human readable abi is used, need to provide function and params names also
116
+ * @param contractAddress - The address of the contract to call
117
+ * @returns The replacement helper
118
+ */
119
+ getReplacementHelper(contractAddress) {
120
+ return this.replacementHelper.getReplacementHelper(contractAddress, this.abiHandler.contractInterfaces);
121
+ }
122
+ /**
123
+ * Interactive replacement builder - helps build replacement step by step
124
+ * @param contractAddress - The address of the contract to call
125
+ * @param functionName - The name of the function to call
126
+ * @param parameterName - The name of the parameter to replace
127
+ * @param token - The token to replace
128
+ * @param balanceAddress - The address to replace the parameter with
129
+ * @param options - The options of the interactive replacement builder
130
+ * @returns The interactive replacement builder
131
+ */
132
+ buildReplacementInteractive(contractAddress, functionName, parameterName, token, balanceAddress, options = {}) {
133
+ return this.replacementHelper.buildReplacementInteractive(contractAddress, functionName, parameterName, token, balanceAddress, this.abiHandler.contractInterfaces, options);
134
+ }
135
+ /**
136
+ * Debug helper: Decode hook data back to readable format
137
+ * @param hook - The hook to decode
138
+ * @returns The decoded hook
139
+ */
140
+ decodeHookData(hook) {
141
+ return this.debugHelpers.decodeHookData(hook);
142
+ }
143
+ /**
144
+ * Debug helper: Get estimated gas for a ZapCall
145
+ * @param zapCall - The zap call to estimate the gas usage for
146
+ * @returns The estimated gas usage
147
+ */
148
+ estimateGasUsage(zapCall) {
149
+ return this.debugHelpers.estimateGasUsage(zapCall);
150
+ }
151
+ /**
152
+ * Visualize ZapCall chain - Human readable description of all operations
153
+ * @param zapCall - The zap call to visualize
154
+ */
155
+ visualizeZapCall(zapCall) {
156
+ return this.debugHelpers.visualizeZapCall(zapCall, this.abiHandler.contractInterfaces);
157
+ }
158
+ /**
159
+ * Get a detailed breakdown of a ZapCall for logging
160
+ * @param zapCall - The zap call to get the breakdown for
161
+ * @returns The breakdown of the zap call
162
+ */
163
+ getZapCallBreakdown(zapCall) {
164
+ return this.debugHelpers.getZapCallBreakdown(zapCall, this.abiHandler.contractInterfaces);
165
+ }
166
+ /**
167
+ * Compare two ZapCalls and show differences
168
+ * @param zapCall1 - The first zap call to compare
169
+ * @param zapCall2 - The second zap call to compare
170
+ * @param label1 - The label of the first zap call
171
+ * @param label2 - The label of the second zap call
172
+ */
173
+ compareZapCalls(zapCall1, zapCall2, label1 = 'ZapCall 1', label2 = 'ZapCall 2') {
174
+ return this.debugHelpers.compareZapCalls(zapCall1, zapCall2, label1, label2, this.abiHandler.contractInterfaces);
175
+ }
176
+ getAgnosticCallParams() {
177
+ return {
178
+ evmTargetAddress: this.agnosticProxyAddress,
179
+ methodName: 'Zap(bytes,bytes)',
180
+ };
181
+ }
182
+ /**
183
+ * Build a complete ZapCall
184
+ * @param hooks - The hooks of the zap call
185
+ * @param bridgeTokens - The tokens to bridge
186
+ * @param bridgeNFTs - The nfts to bridge
187
+ * @returns The zap call
188
+ */
189
+ buildZapCall(hooks, bridgeTokens = [], bridgeNFTs = []) {
190
+ return this.debugHelpers.buildZapCall(hooks, bridgeTokens, bridgeNFTs);
191
+ }
192
+ /**
193
+ * Encode ZapCall for transaction
194
+ * @param zapCall - The zap call to encode
195
+ * @returns The encoded zap call that can be used as calldata in tac sdk
196
+ */
197
+ encodeZapCall(zapCall) {
198
+ return this.debugHelpers.encodeZapCall(zapCall);
199
+ }
200
+ }
201
+ exports.AgnosticProxySDK = AgnosticProxySDK;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * NFTData is a struct that contains the nft, id, and amount of the nft
3
+ * @param nft - The address of the nft
4
+ * @param id - The id of the nft
5
+ * @param amount - The amount of the nft to transfer(for ERC1155, but currently supported only ERC721)
6
+ */
7
+ export interface NFTData {
8
+ nft: string;
9
+ id: bigint;
10
+ amount: bigint;
11
+ }
12
+ /**
13
+ * BridgeData is a struct that contains the tokens, nfts, and isRequired of the bridge data
14
+ * @param tokens - The addresses of the tokens to bridge
15
+ * @param nfts - The nfts to bridge
16
+ * @param isRequired - Whether the bridge is required
17
+ */
18
+ export interface BridgeData {
19
+ tokens: string[];
20
+ nfts: NFTData[];
21
+ isRequired: boolean;
22
+ }
23
+ /**
24
+ * HookType is an enum that contains the type of the hook
25
+ * @param Custom - The custom hook
26
+ * @param FullBalanceApprove - The full balance approve hook
27
+ * @param FullBalanceTransfer - The full balance transfer hook
28
+ */
29
+ export declare enum HookType {
30
+ Custom = 0,
31
+ FullBalanceApprove = 1,
32
+ FullBalanceTransfer = 2
33
+ }
34
+ /**
35
+ * ReplacementType is an enum that contains the type of the replacement
36
+ * @param Amount - The amount replacement
37
+ */
38
+ export declare enum ReplacementType {
39
+ Amount = 0
40
+ }
41
+ /**
42
+ * AmountChange is a struct that contains the position, length, token, and balance address of the amount change
43
+ * @param position - The position of the amount change(position of the parameter in the function call)
44
+ * @param len - The length of the amount change(length of the parameter in the function call)
45
+ * @param token - The token of the amount change
46
+ * @param balanceAddress - The balance address of the amount change(address to check balance for)
47
+ */
48
+ export interface AmountChange {
49
+ position: number;
50
+ len: number;
51
+ token: string;
52
+ balanceAddress: string;
53
+ }
54
+ /**
55
+ * CustomHookData is a struct that contains the isFromSAPerspective, contractAddress, value, data, and improvedMissionInfo of the custom hook
56
+ * @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
57
+ * @param contractAddress - The address of the contract to call
58
+ * @param value - The value of the hook
59
+ * @param data - The data of the hook
60
+ * @param improvedMissionInfo - The improved mission info of the hook
61
+ */
62
+ export interface CustomHookData {
63
+ isFromSAPerspective: boolean;
64
+ contractAddress: string;
65
+ value: bigint;
66
+ data: string;
67
+ improvedMissionInfo: string;
68
+ }
69
+ /**
70
+ * ApproveHookData is a struct that contains the token, to, and isFromSAPerspective of the approve hook
71
+ * @param token - The token to approve
72
+ * @param to - The address to approve to
73
+ * @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
74
+ */
75
+ export interface ApproveHookData {
76
+ token: string;
77
+ to: string;
78
+ isFromSAPerspective: boolean;
79
+ }
80
+ /**
81
+ * TransferHookData is a struct that contains the token, to, and isFromSAPerspective of the transfer hook
82
+ * @param token - The token to transfer
83
+ * @param to - The address to transfer to
84
+ * @param isFromSAPerspective - Whether the hook is from the smart account perspective or from proxy perspective
85
+ */
86
+ export interface TransferHookData {
87
+ token: string;
88
+ to: string;
89
+ isFromSAPerspective: boolean;
90
+ }
91
+ /**
92
+ * Hook is a struct that contains the hookType and hookData of the hook
93
+ * @param hookType - The type of the hook
94
+ * @param hookData - The data of the hook
95
+ */
96
+ export interface Hook {
97
+ hookType: HookType;
98
+ hookData: string;
99
+ }
100
+ /**
101
+ * ZapCall is a struct that contains the hooks and bridgeData of the zap call
102
+ * @param hooks - The hooks of the zap call
103
+ * @param bridgeData - The bridge data of the zap call
104
+ */
105
+ export interface ZapCall {
106
+ hooks: Hook[];
107
+ bridgeData: BridgeData;
108
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplacementType = exports.HookType = void 0;
4
+ /**
5
+ * HookType is an enum that contains the type of the hook
6
+ * @param Custom - The custom hook
7
+ * @param FullBalanceApprove - The full balance approve hook
8
+ * @param FullBalanceTransfer - The full balance transfer hook
9
+ */
10
+ var HookType;
11
+ (function (HookType) {
12
+ HookType[HookType["Custom"] = 0] = "Custom";
13
+ HookType[HookType["FullBalanceApprove"] = 1] = "FullBalanceApprove";
14
+ HookType[HookType["FullBalanceTransfer"] = 2] = "FullBalanceTransfer";
15
+ })(HookType || (exports.HookType = HookType = {}));
16
+ /**
17
+ * ReplacementType is an enum that contains the type of the replacement
18
+ * @param Amount - The amount replacement
19
+ */
20
+ var ReplacementType;
21
+ (function (ReplacementType) {
22
+ ReplacementType[ReplacementType["Amount"] = 0] = "Amount";
23
+ })(ReplacementType || (exports.ReplacementType = ReplacementType = {}));
@@ -0,0 +1,88 @@
1
+ import { Interface } from 'ethers';
2
+ import { Hook, NFTData, ZapCall } from './AgnosticStructs';
3
+ export declare class DebugHelpers {
4
+ /**
5
+ * Build a complete ZapCall
6
+ * @param hooks - The hooks of the zap call
7
+ * @param bridgeTokens - The tokens to bridge
8
+ * @param bridgeNFTs - The nfts to bridge
9
+ * @returns The zap call
10
+ */
11
+ buildZapCall(hooks: Hook[], bridgeTokens?: string[], bridgeNFTs?: NFTData[]): ZapCall;
12
+ /**
13
+ * Debug helper: Decode hook data back to readable format
14
+ * @param hook - The hook to decode
15
+ * @returns The decoded hook
16
+ */
17
+ decodeHookData(hook: Hook): any;
18
+ /**
19
+ * Debug helper: Get estimated gas for a ZapCall
20
+ * @param zapCall - The zap call to estimate the gas usage for
21
+ * @returns The estimated gas usage
22
+ */
23
+ estimateGasUsage(zapCall: ZapCall): number;
24
+ /**
25
+ * Visualize ZapCall chain - Human readable description of all operations
26
+ * @param zapCall - The zap call to visualize
27
+ */
28
+ visualizeZapCall(zapCall: ZapCall, contractInterfaces: Map<string, Interface>): void;
29
+ /**
30
+ * Private helper to describe individual hooks
31
+ * @param hook - The hook to describe
32
+ * @returns The description of the hook
33
+ */
34
+ private _describeHook;
35
+ /**
36
+ * Describe custom hook with function details
37
+ * @param hook - The hook to describe
38
+ * @returns The description of the hook
39
+ */
40
+ private _describeCustomHook;
41
+ /**
42
+ * Describe approve hook
43
+ * @param hook - The hook to describe
44
+ * @returns The description of the hook
45
+ */
46
+ private _describeApproveHook;
47
+ /**
48
+ * Describe transfer hook
49
+ * @param hook - The hook to describe
50
+ * @returns The description of the hook
51
+ */
52
+ private _describeTransferHook;
53
+ /**
54
+ * Format address for display (show first 6 and last 4 characters)
55
+ * @param address - The address to format
56
+ * @returns The formatted address
57
+ */
58
+ private _formatAddress;
59
+ /**
60
+ * Get a detailed breakdown of a ZapCall for logging
61
+ * @param zapCall - The zap call to get the breakdown for
62
+ * @returns The breakdown of the zap call
63
+ */
64
+ getZapCallBreakdown(zapCall: ZapCall, contractInterfaces: Map<string, Interface>): {
65
+ totalHooks: number;
66
+ hookTypes: {
67
+ [key: string]: number;
68
+ };
69
+ gasEstimate: number;
70
+ encodedSize: number;
71
+ bridgeRequired: boolean;
72
+ hookDescriptions: string[];
73
+ };
74
+ /**
75
+ * Compare two ZapCalls and show differences
76
+ * @param zapCall1 - The first zap call to compare
77
+ * @param zapCall2 - The second zap call to compare
78
+ * @param label1 - The label of the first zap call
79
+ * @param label2 - The label of the second zap call
80
+ */
81
+ compareZapCalls(zapCall1: ZapCall, zapCall2: ZapCall, label1: string | undefined, label2: string | undefined, contractInterfaces: Map<string, Interface>): void;
82
+ /**
83
+ * Encode ZapCall for transaction
84
+ * @param zapCall - The zap call to encode
85
+ * @returns The encoded zap call that can be used as calldata in tac sdk
86
+ */
87
+ encodeZapCall(zapCall: ZapCall): string;
88
+ }