@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
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NFT = void 0;
4
4
  const ton_1 = require("@ton/ton");
5
- const wrappers_1 = require("@tonappchain/artifacts/dist/src/ton/wrappers");
6
5
  const ethers_1 = require("ethers");
7
6
  const errors_1 = require("../errors");
8
7
  const Consts_1 = require("../sdk/Consts");
@@ -15,12 +14,12 @@ class NFT {
15
14
  * @description Create NFT from item address. Item MUST BE deployed on TON.
16
15
  * @param configuration - Configuration
17
16
  * @param item - Item address (TVM address)
18
- * @param origin - Origin
19
17
  * @returns NFT
20
18
  */
21
19
  static async fromItem(configuration, item) {
22
20
  Validator_1.Validator.validateTVMAddress(item);
23
- const nftItem = configuration.TONParams.contractOpener.open(wrappers_1.NFTItem.createFromAddress(ton_1.Address.parse(item)));
21
+ const NFTItemC = configuration.artifacts.ton.wrappers.NFTItem;
22
+ const nftItem = configuration.TONParams.contractOpener.open(NFTItemC.createFromAddress(ton_1.Address.parse(item)));
24
23
  const { collectionAddress, index } = await nftItem.getNFTData();
25
24
  const origin = await NFT.getOrigin(configuration, item);
26
25
  return new NFT({ item, collection: collectionAddress.toString(), index: BigInt(index) }, origin, configuration);
@@ -29,7 +28,6 @@ class NFT {
29
28
  * @description Create NFT from collection address. TON-native assets MUST BE deployed on TON.
30
29
  * @param configuration - Configuration
31
30
  * @param item - Item address (TVM address)
32
- * @param origin - Origin
33
31
  * @returns NFT
34
32
  */
35
33
  static async fromCollection(configuration, item) {
@@ -42,12 +40,13 @@ class NFT {
42
40
  }
43
41
  throw e;
44
42
  });
45
- const nftCollection = configuration.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress(ton_1.Address.parse(tvmCollectionAddress)));
43
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
44
+ const NFTItemC = configuration.artifacts.ton.wrappers.NFTItem;
45
+ const nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress(ton_1.Address.parse(tvmCollectionAddress)));
46
46
  const itemAddress = origin === Struct_1.Origin.TAC
47
- ? wrappers_1.NFTItem.createFromConfig({
47
+ ? NFTItemC.createFromConfig({
48
48
  collectionAddress: nftCollection.address,
49
49
  cclAddress: ton_1.Address.parse(configuration.TONParams.crossChainLayerAddress),
50
- // @ts-expect-error // bigint can be used, wrapper is not typed properly
51
50
  index: item.index,
52
51
  }, configuration.TONParams.nftItemCode).address
53
52
  : await nftCollection.getNFTAddressByIndex(item.index);
@@ -58,16 +57,25 @@ class NFT {
58
57
  evmAddress: (0, ethers_1.isAddress)(item.collection) ? item.collection : undefined,
59
58
  }, origin, configuration);
60
59
  }
61
- static async getItemData(contractOpener, itemAddress) {
60
+ static async getItemData(configuration, itemAddress) {
62
61
  Validator_1.Validator.validateTVMAddress(itemAddress);
63
- const nftItem = contractOpener.open(wrappers_1.NFTItem.createFromAddress(ton_1.Address.parse(itemAddress)));
62
+ const NFTItemC = configuration.artifacts.ton.wrappers.NFTItem;
63
+ const contractOpener = configuration.TONParams.contractOpener;
64
+ const nftItem = contractOpener.open(NFTItemC.createFromAddress(ton_1.Address.parse(itemAddress)));
64
65
  return nftItem.getNFTData();
65
66
  }
66
- static async getCollectionData(contractOpener, collectionAddress) {
67
+ async getItemData() {
68
+ return NFT.getItemData(this._configuration, this._addresses.item);
69
+ }
70
+ static async getCollectionData(configuration, collectionAddress) {
67
71
  Validator_1.Validator.validateTVMAddress(collectionAddress);
68
- const nftCollection = contractOpener.open(wrappers_1.NFTCollection.createFromAddress(ton_1.Address.parse(collectionAddress)));
72
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
73
+ const nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress(ton_1.Address.parse(collectionAddress)));
69
74
  return nftCollection.getCollectionData();
70
75
  }
76
+ async getCollectionData() {
77
+ return NFT.getCollectionData(this._configuration, this._addresses.collection);
78
+ }
71
79
  static async getOrigin(configuration, itemOrCollection) {
72
80
  const { nftItemCode, nftCollectionCode } = configuration.TONParams;
73
81
  const { code: givenCodeBOC } = await configuration.TONParams.contractOpener.getContractState(ton_1.Address.parse(itemOrCollection));
@@ -80,35 +88,42 @@ class NFT {
80
88
  }
81
89
  return Struct_1.Origin.TON;
82
90
  }
83
- static getItemAddress(contractOpener, collectionAddress, index) {
91
+ static async getItemAddress(configuration, collectionAddress, index) {
84
92
  Validator_1.Validator.validateTVMAddress(collectionAddress);
85
- const nftCollection = contractOpener.open(wrappers_1.NFTCollection.createFromAddress(ton_1.Address.parse(collectionAddress)));
86
- return nftCollection.getNFTAddressByIndex(index).then(toString);
93
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
94
+ const nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress(ton_1.Address.parse(collectionAddress)));
95
+ const address = await nftCollection.getNFTAddressByIndex(index);
96
+ return address.toString();
87
97
  }
88
98
  static async getTVMAddress(configuration, collectionAddress, tokenId) {
89
99
  Validator_1.Validator.validateEVMAddress(collectionAddress);
90
100
  const exists = await configuration.TACParams.tokenUtils['exists(address)'](collectionAddress);
91
101
  if (exists) {
92
- const erc721Token = configuration.artifacts.tac.wrappers.CrossChainLayerERC721FactoryTAC.connect(collectionAddress, configuration.TACParams.provider);
93
- const info = await erc721Token.getInfo();
94
- const nftCollection = configuration.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress((0, ton_1.address)(info.tvmAddress)));
102
+ const cclErc721TokenAbi = configuration.artifacts.tac.compilationArtifacts.ICrossChainLayerERC721.abi;
103
+ const cclErc721Token = new ethers_1.ethers.Contract(collectionAddress, cclErc721TokenAbi, configuration.TACParams.provider);
104
+ const info = await cclErc721Token.getInfo();
105
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
106
+ const nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress((0, ton_1.address)(info.tvmAddress)));
95
107
  return tokenId == undefined
96
108
  ? nftCollection.address.toString()
97
109
  : (await nftCollection.getNFTAddressByIndex(tokenId)).toString();
98
110
  }
99
111
  else {
100
- const nftCollection = configuration.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromConfig({
101
- ownerAddress: ton_1.Address.parse(configuration.TONParams.crossChainLayerAddress),
102
- content: (0, ton_1.beginCell)().endCell(),
112
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
113
+ const nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromConfig({
114
+ adminAddress: (0, ton_1.address)(configuration.TONParams.crossChainLayerAddress),
115
+ newAdminAddress: null,
116
+ collectionContent: (0, ton_1.beginCell)().endCell(),
117
+ commonContent: (0, ton_1.beginCell)().endCell(),
103
118
  nftItemCode: configuration.TONParams.nftItemCode,
104
119
  originalAddress: collectionAddress,
105
120
  }, configuration.TONParams.nftCollectionCode));
121
+ const NFTItemC = configuration.artifacts.ton.wrappers.NFTItem;
106
122
  return tokenId == undefined
107
123
  ? nftCollection.address.toString()
108
- : wrappers_1.NFTItem.createFromConfig({
124
+ : NFTItemC.createFromConfig({
109
125
  collectionAddress: nftCollection.address,
110
126
  cclAddress: ton_1.Address.parse(configuration.TONParams.crossChainLayerAddress),
111
- // @ts-expect-error // bigint can be used, wrapper is not typed properly
112
127
  index: tokenId,
113
128
  }, configuration.TONParams.nftItemCode).address.toString();
114
129
  }
@@ -118,7 +133,8 @@ class NFT {
118
133
  this._addresses = nftAddress;
119
134
  this._configuration = configuration;
120
135
  this.origin = origin;
121
- this._nftCollection = configuration.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress(ton_1.Address.parse(this._addresses.collection)));
136
+ const NFTCollectionC = configuration.artifacts.ton.wrappers.NFTCollection;
137
+ this._nftCollection = configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress(ton_1.Address.parse(this._addresses.collection)));
122
138
  }
123
139
  get addresses() {
124
140
  return this._addresses;
@@ -132,10 +148,22 @@ class NFT {
132
148
  get clone() {
133
149
  return new NFT(this._addresses, this.origin, this._configuration);
134
150
  }
135
- async withAmount() {
151
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
152
+ withAmount(_amount) {
153
+ // NFTs are non-fungible; amount is always 1. Keep API consistent.
154
+ return this;
155
+ }
156
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
157
+ withRawAmount(_rawAmount) {
158
+ // NFTs are non-fungible; raw amount concept is not applicable. Keep API consistent.
136
159
  return this;
137
160
  }
138
- async addAmount() {
161
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
162
+ addAmount(_amount) {
163
+ return this;
164
+ }
165
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
166
+ addRawAmount(_rawAmount) {
139
167
  return this;
140
168
  }
141
169
  async getEVMAddress() {
@@ -146,7 +174,8 @@ class NFT {
146
174
  const { code: givenNFTCollection } = await this._configuration.TONParams.contractOpener.getContractState(ton_1.Address.parse(tvmNFTAddress));
147
175
  if (givenNFTCollection &&
148
176
  this._configuration.TONParams.nftCollectionCode.equals(ton_1.Cell.fromBoc(givenNFTCollection)[0])) {
149
- const nftCollection = this._configuration.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress((0, ton_1.address)(tvmNFTAddress)));
177
+ const NFTCollectionC = this._configuration.artifacts.ton.wrappers.NFTCollection;
178
+ const nftCollection = this._configuration.TONParams.contractOpener.open(NFTCollectionC.createFromAddress((0, ton_1.address)(tvmNFTAddress)));
150
179
  const evmAddress = await nftCollection.getOriginalAddress();
151
180
  this._addresses.evmAddress = evmAddress.toString();
152
181
  }
@@ -175,13 +204,10 @@ class NFT {
175
204
  return payload;
176
205
  }
177
206
  async isOwnedBy(userAddress) {
178
- const nftData = await NFT.getItemData(this._configuration.TONParams.contractOpener, this.address.toString());
179
- if (nftData.ownerAddress?.equals(ton_1.Address.parse(userAddress))) {
180
- return true;
181
- }
182
- return false;
207
+ const nftData = await NFT.getItemData(this._configuration, this.address.toString());
208
+ return !!nftData.ownerAddress?.equals(ton_1.Address.parse(userAddress));
183
209
  }
184
- async checkCanBeTransferedBy(userAddress) {
210
+ async checkCanBeTransferredBy(userAddress) {
185
211
  if (!(await this.isOwnedBy(userAddress))) {
186
212
  throw (0, errors_1.insufficientBalanceError)(this.address.toString());
187
213
  }
@@ -191,7 +217,8 @@ class NFT {
191
217
  }
192
218
  getBurnPayload(crossChainLayerAddress, evmData, crossChainTonAmount, feeData) {
193
219
  const queryId = (0, Utils_1.generateRandomNumberByTimestamp)().randomNumber;
194
- return wrappers_1.NFTItem.burnMessage(queryId, (0, ton_1.address)(crossChainLayerAddress), crossChainTonAmount, evmData, feeData);
220
+ const NFTItemC = this._configuration.artifacts.ton.wrappers.NFTItem;
221
+ return NFTItemC.burnMessage(queryId, (0, ton_1.address)(crossChainLayerAddress), crossChainTonAmount, evmData, feeData);
195
222
  }
196
223
  getTransferPayload(to, responseAddress, forwardFeeAmount, evmData, crossChainTonAmount, feeData) {
197
224
  const queryId = (0, Utils_1.generateRandomNumberByTimestamp)().randomNumber;
@@ -200,7 +227,8 @@ class NFT {
200
227
  .storeMaybeRef(feeData)
201
228
  .storeMaybeRef(evmData)
202
229
  .endCell();
203
- return wrappers_1.NFTItem.transferMessage(queryId, (0, ton_1.address)(to), (0, ton_1.address)(responseAddress), Number((0, ton_1.fromNano)(Consts_1.NFT_TRANSFER_FORWARD_TON_AMOUNT + forwardFeeAmount + crossChainTonAmount)), forwardPayload);
230
+ const NFTItemC = this._configuration.artifacts.ton.wrappers.NFTItem;
231
+ return NFTItemC.transferMessage(queryId, (0, ton_1.address)(to), (0, ton_1.address)(responseAddress), Number((0, ton_1.fromNano)(Consts_1.NFT_TRANSFER_FORWARD_TON_AMOUNT + forwardFeeAmount + crossChainTonAmount)), forwardPayload);
204
232
  }
205
233
  }
206
234
  exports.NFT = NFT;
@@ -1,8 +1,8 @@
1
1
  import { Cell } from '@ton/ton';
2
+ import { Asset, IConfiguration } from '../interfaces';
2
3
  import type { SenderAbstraction } from '../sender';
3
4
  import type { ShardTransaction } from '../structs/InternalStruct';
4
- import { IConfiguration } from '../structs/Services';
5
- import { Asset, AssetType, FeeParams } from '../structs/Struct';
5
+ import { AssetType, FeeParams } from '../structs/Struct';
6
6
  export declare class TON implements Asset {
7
7
  readonly address: string;
8
8
  readonly type: AssetType;
@@ -12,16 +12,10 @@ export declare class TON implements Asset {
12
12
  static create(config: IConfiguration): TON;
13
13
  get rawAmount(): bigint;
14
14
  get clone(): TON;
15
- withAmount(amount: {
16
- rawAmount: bigint;
17
- } | {
18
- amount: number;
19
- }): Promise<TON>;
20
- addAmount(amount: {
21
- rawAmount: bigint;
22
- } | {
23
- amount: number;
24
- }): Promise<TON>;
15
+ withAmount(amount: number): TON;
16
+ withRawAmount(rawAmount: bigint): TON;
17
+ addAmount(amount: number): TON;
18
+ addRawAmount(rawAmount: bigint): TON;
25
19
  getEVMAddress(): Promise<string>;
26
20
  getTVMAddress(): Promise<string>;
27
21
  generatePayload(params: {
@@ -33,6 +27,6 @@ export declare class TON implements Asset {
33
27
  }): Promise<Cell>;
34
28
  getUserBalance(userAddress: string): Promise<bigint>;
35
29
  static checkBalance(sender: SenderAbstraction, config: IConfiguration, transactions: ShardTransaction[]): Promise<void>;
36
- checkCanBeTransferedBy(userAddress: string): Promise<void>;
30
+ checkCanBeTransferredBy(userAddress: string): Promise<void>;
37
31
  getBalanceOf(userAddress: string): Promise<bigint>;
38
32
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TON = void 0;
4
4
  const ton_1 = require("@ton/ton");
5
- const instances_1 = require("../errors/instances");
5
+ const errors_1 = require("../errors");
6
6
  const Consts_1 = require("../sdk/Consts");
7
7
  const Utils_1 = require("../sdk/Utils");
8
8
  const Struct_1 = require("../structs/Struct");
@@ -24,28 +24,30 @@ class TON {
24
24
  ton._rawAmount = this._rawAmount;
25
25
  return ton;
26
26
  }
27
- async withAmount(amount) {
27
+ withAmount(amount) {
28
28
  if (this._rawAmount > 0n) {
29
- // clone token if withAmount set before to avoid changing the original token
30
29
  const newToken = this.clone;
31
- newToken._rawAmount = 'rawAmount' in amount ? amount.rawAmount : (0, Utils_1.calculateRawAmount)(amount.amount, 9);
30
+ newToken._rawAmount = (0, Utils_1.calculateRawAmount)(amount, 9);
32
31
  return newToken;
33
32
  }
34
- if ('rawAmount' in amount) {
35
- this._rawAmount = amount.rawAmount;
36
- }
37
- else {
38
- this._rawAmount = (0, Utils_1.calculateRawAmount)(amount.amount, 9);
39
- }
33
+ this._rawAmount = (0, Utils_1.calculateRawAmount)(amount, 9);
40
34
  return this;
41
35
  }
42
- async addAmount(amount) {
43
- if ('rawAmount' in amount) {
44
- this._rawAmount = this._rawAmount + amount.rawAmount;
45
- }
46
- else {
47
- this._rawAmount = this._rawAmount + (0, Utils_1.calculateRawAmount)(amount.amount, 9);
36
+ withRawAmount(rawAmount) {
37
+ if (this._rawAmount > 0n) {
38
+ const newToken = this.clone;
39
+ newToken._rawAmount = rawAmount;
40
+ return newToken;
48
41
  }
42
+ this._rawAmount = rawAmount;
43
+ return this;
44
+ }
45
+ addAmount(amount) {
46
+ this._rawAmount = this._rawAmount + (0, Utils_1.calculateRawAmount)(amount, 9);
47
+ return this;
48
+ }
49
+ addRawAmount(rawAmount) {
50
+ this._rawAmount = this._rawAmount + rawAmount;
49
51
  return this;
50
52
  }
51
53
  async getEVMAddress() {
@@ -61,7 +63,7 @@ class TON {
61
63
  return (0, ton_1.beginCell)()
62
64
  .storeUint(this._config.artifacts.ton.wrappers.CrossChainLayerOpCodes.anyone_tvmMsgToEVM, 32)
63
65
  .storeUint(queryId, 64)
64
- .storeUint(this._config.artifacts.ton.wrappers.OperationType.tonTransfer, 32)
66
+ .storeUint(this._config.artifacts.ton.wrappers.MsgType.tonTransfer, 32)
65
67
  .storeCoins(this._rawAmount)
66
68
  .storeMaybeRef(feeData)
67
69
  .storeAddress(ton_1.Address.parse(excessReceiver))
@@ -75,13 +77,13 @@ class TON {
75
77
  const totalValue = transactions.reduce((acc, transaction) => acc + transaction.messages.reduce((acc, message) => acc + message.value, 0n), 0n);
76
78
  const balance = await sender.getBalance(config.TONParams.contractOpener);
77
79
  if (balance < totalValue) {
78
- throw (0, instances_1.insufficientBalanceError)(Consts_1.TON_SYMBOL);
80
+ throw (0, errors_1.insufficientBalanceError)(Consts_1.TON_SYMBOL);
79
81
  }
80
82
  }
81
- async checkCanBeTransferedBy(userAddress) {
83
+ async checkCanBeTransferredBy(userAddress) {
82
84
  const balance = await this.getUserBalance(userAddress);
83
85
  if (balance < this._rawAmount) {
84
- throw (0, instances_1.insufficientBalanceError)(Consts_1.TON_SYMBOL);
86
+ throw (0, errors_1.insufficientBalanceError)(Consts_1.TON_SYMBOL);
85
87
  }
86
88
  }
87
89
  async getBalanceOf(userAddress) {
@@ -0,0 +1,2 @@
1
+ export { AddressError, BitError, ContractError, EVMCallError, FetchError, FormatError, KeyError, MetadataError, SettingError, TokenError, WalletError, } from './errors';
2
+ export { allEndpointsFailedError, emptyArrayError, emptyContractError, emptySettingError, evmAddressError, indexRequiredError, insufficientBalanceError, invalidMethodNameError, missingDecimals, missingFeeParamsError, missingGasLimitError, missingJettonDataError, missingTvmExecutorFeeError, notMultiplyOf8Error, operationFetchError, prefixError, profilingFetchError, simulationFetchError, statusFetchError, tvmAddressError, unknownTokenTypeError, unknownWalletError, unsupportedFormatError, unsupportedKeyError, zeroRawAmountError, } from './instances';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.tvmAddressError = exports.statusFetchError = exports.simulationError = exports.profilingFetchError = exports.prefixError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.invalidMethodNameError = exports.insufficientBalanceError = exports.indexRequiredError = exports.evmAddressError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.allEndpointsFailedError = exports.WalletError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
3
+ exports.zeroRawAmountError = exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.tvmAddressError = exports.statusFetchError = exports.simulationFetchError = exports.profilingFetchError = exports.prefixError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.missingTvmExecutorFeeError = exports.missingJettonDataError = exports.missingGasLimitError = exports.missingFeeParamsError = exports.missingDecimals = exports.invalidMethodNameError = exports.insufficientBalanceError = exports.indexRequiredError = exports.evmAddressError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.allEndpointsFailedError = exports.WalletError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
4
4
  var errors_1 = require("./errors");
5
5
  Object.defineProperty(exports, "AddressError", { enumerable: true, get: function () { return errors_1.AddressError; } });
6
6
  Object.defineProperty(exports, "BitError", { enumerable: true, get: function () { return errors_1.BitError; } });
@@ -22,14 +22,20 @@ Object.defineProperty(exports, "evmAddressError", { enumerable: true, get: funct
22
22
  Object.defineProperty(exports, "indexRequiredError", { enumerable: true, get: function () { return instances_1.indexRequiredError; } });
23
23
  Object.defineProperty(exports, "insufficientBalanceError", { enumerable: true, get: function () { return instances_1.insufficientBalanceError; } });
24
24
  Object.defineProperty(exports, "invalidMethodNameError", { enumerable: true, get: function () { return instances_1.invalidMethodNameError; } });
25
+ Object.defineProperty(exports, "missingDecimals", { enumerable: true, get: function () { return instances_1.missingDecimals; } });
26
+ Object.defineProperty(exports, "missingFeeParamsError", { enumerable: true, get: function () { return instances_1.missingFeeParamsError; } });
27
+ Object.defineProperty(exports, "missingGasLimitError", { enumerable: true, get: function () { return instances_1.missingGasLimitError; } });
28
+ Object.defineProperty(exports, "missingJettonDataError", { enumerable: true, get: function () { return instances_1.missingJettonDataError; } });
29
+ Object.defineProperty(exports, "missingTvmExecutorFeeError", { enumerable: true, get: function () { return instances_1.missingTvmExecutorFeeError; } });
25
30
  Object.defineProperty(exports, "notMultiplyOf8Error", { enumerable: true, get: function () { return instances_1.notMultiplyOf8Error; } });
26
31
  Object.defineProperty(exports, "operationFetchError", { enumerable: true, get: function () { return instances_1.operationFetchError; } });
27
32
  Object.defineProperty(exports, "prefixError", { enumerable: true, get: function () { return instances_1.prefixError; } });
28
33
  Object.defineProperty(exports, "profilingFetchError", { enumerable: true, get: function () { return instances_1.profilingFetchError; } });
29
- Object.defineProperty(exports, "simulationError", { enumerable: true, get: function () { return instances_1.simulationError; } });
34
+ Object.defineProperty(exports, "simulationFetchError", { enumerable: true, get: function () { return instances_1.simulationFetchError; } });
30
35
  Object.defineProperty(exports, "statusFetchError", { enumerable: true, get: function () { return instances_1.statusFetchError; } });
31
36
  Object.defineProperty(exports, "tvmAddressError", { enumerable: true, get: function () { return instances_1.tvmAddressError; } });
32
37
  Object.defineProperty(exports, "unknownTokenTypeError", { enumerable: true, get: function () { return instances_1.unknownTokenTypeError; } });
33
38
  Object.defineProperty(exports, "unknownWalletError", { enumerable: true, get: function () { return instances_1.unknownWalletError; } });
34
39
  Object.defineProperty(exports, "unsupportedFormatError", { enumerable: true, get: function () { return instances_1.unsupportedFormatError; } });
35
40
  Object.defineProperty(exports, "unsupportedKeyError", { enumerable: true, get: function () { return instances_1.unsupportedKeyError; } });
41
+ Object.defineProperty(exports, "zeroRawAmountError", { enumerable: true, get: function () { return instances_1.zeroRawAmountError; } });
@@ -11,7 +11,6 @@ export declare const notMultiplyOf8Error: BitError;
11
11
  export declare const prefixError: MetadataError;
12
12
  export declare const emptySettingError: (setting: string) => SettingError;
13
13
  export declare const invalidMethodNameError: (methodName: string) => EVMCallError;
14
- export declare const simulationError: (inner: unknown) => FetchError;
15
14
  export declare const profilingFetchError: (msg: string, inner?: unknown) => FetchError;
16
15
  export declare const emptyArrayError: (msg: string) => FetchError;
17
16
  export declare const invalidAssetType: FormatError;
@@ -22,3 +21,14 @@ export declare const allContractOpenerFailedError: (inner: unknown) => FetchErro
22
21
  export declare const insufficientBalanceError: (token: string) => InsufficientBalanceError;
23
22
  export declare const unknownTokenTypeError: (token: string, reason?: string) => TokenError;
24
23
  export declare const indexRequiredError: (token: string) => TokenError;
24
+ export declare const convertCurrencyFetchError: (msg: string, inner?: unknown) => FetchError;
25
+ export declare const simulationFetchError: (msg: string, inner?: unknown) => FetchError;
26
+ export declare const getTONFeeInfoFetchError: (msg: string, inner?: unknown) => FetchError;
27
+ export declare const missingFeeParamsError: FormatError;
28
+ export declare const missingTvmExecutorFeeError: FormatError;
29
+ export declare const missingGasLimitError: FormatError;
30
+ export declare const missingDecimals: MetadataError;
31
+ export declare const missingJettonDataError: MetadataError;
32
+ export declare const zeroRawAmountError: (assetAddress: string) => TokenError;
33
+ export declare const sendCrossChainTransactionFailedError: (msg: string) => WalletError;
34
+ export declare const convertCurrencyNegativeOrZeroValueError: FormatError;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertCurrencyNegativeOrZeroValueError = exports.sendCrossChainTransactionFailedError = exports.zeroRawAmountError = exports.missingJettonDataError = exports.missingDecimals = exports.missingGasLimitError = exports.missingTvmExecutorFeeError = exports.missingFeeParamsError = exports.getTONFeeInfoFetchError = exports.simulationFetchError = exports.convertCurrencyFetchError = exports.indexRequiredError = exports.unknownTokenTypeError = exports.insufficientBalanceError = exports.allContractOpenerFailedError = exports.allEndpointsFailedError = exports.noValidGroupFoundError = exports.prepareMessageGroupError = exports.invalidAssetType = exports.emptyArrayError = exports.profilingFetchError = exports.invalidMethodNameError = exports.emptySettingError = exports.prefixError = exports.notMultiplyOf8Error = exports.unsupportedFormatError = exports.unsupportedKeyError = exports.unknownWalletError = exports.evmAddressError = exports.tvmAddressError = exports.statusFetchError = exports.operationFetchError = exports.emptyContractError = void 0;
4
+ const errors_1 = require("./errors");
5
+ exports.emptyContractError = new errors_1.ContractError('unexpected empty contract code of given jetton.', 100);
6
+ const operationFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch OperationId: ${msg}`, 101, inner);
7
+ exports.operationFetchError = operationFetchError;
8
+ const statusFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch status transaction: ${msg}`, 102, inner);
9
+ exports.statusFetchError = statusFetchError;
10
+ const tvmAddressError = (addr) => new errors_1.AddressError(`invalid tvm address ${addr}`, 103);
11
+ exports.tvmAddressError = tvmAddressError;
12
+ const evmAddressError = (addr) => new errors_1.AddressError(`invalid evm address ${addr}`, 104);
13
+ exports.evmAddressError = evmAddressError;
14
+ const unknownWalletError = (version) => new errors_1.WalletError(`Unknown wallet version ${version}`, 105);
15
+ exports.unknownWalletError = unknownWalletError;
16
+ const unsupportedKeyError = (key) => new errors_1.KeyError(`Unsupported onchain key: ${key}`, 106);
17
+ exports.unsupportedKeyError = unsupportedKeyError;
18
+ exports.unsupportedFormatError = new errors_1.FormatError('Only snake format is supported', 107);
19
+ exports.notMultiplyOf8Error = new errors_1.BitError('Number remaining of bits is not multiply of 8', 108);
20
+ exports.prefixError = new errors_1.MetadataError('Unexpected wrappers metadata content prefix', 109);
21
+ const emptySettingError = (setting) => new errors_1.SettingError(`unexpected empty ${setting}. Make sure the settings contract is valid.`, 110);
22
+ exports.emptySettingError = emptySettingError;
23
+ const invalidMethodNameError = (methodName) => new errors_1.EVMCallError(`Invalid Solidity method name: "${methodName}". Method must be either a valid identifier or have parameters (bytes,bytes).`, 111);
24
+ exports.invalidMethodNameError = invalidMethodNameError;
25
+ const profilingFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch stage profiling: ${msg}`, 112, inner);
26
+ exports.profilingFetchError = profilingFetchError;
27
+ const emptyArrayError = (msg) => new errors_1.FetchError(`empty array: ${msg}`, 113);
28
+ exports.emptyArrayError = emptyArrayError;
29
+ exports.invalidAssetType = new errors_1.FormatError('Invalid asset type', 114);
30
+ const prepareMessageGroupError = (isBocSizeValid, isDepthValid) => new errors_1.PrepareMessageGroupError(`Failed to prepare message group: BOC size valid: ${isBocSizeValid}, depth valid: ${isDepthValid}`, 115);
31
+ exports.prepareMessageGroupError = prepareMessageGroupError;
32
+ exports.noValidGroupFoundError = new errors_1.NoValidGroupFoundError('Failed to prepare valid message group', 116);
33
+ const allEndpointsFailedError = (inner) => new errors_1.FetchError('All endpoints failed, last err: ' + inner.message, 117, inner);
34
+ exports.allEndpointsFailedError = allEndpointsFailedError;
35
+ const allContractOpenerFailedError = (inner) => new errors_1.FetchError('All contract opener failed', 118, inner);
36
+ exports.allContractOpenerFailedError = allContractOpenerFailedError;
37
+ const insufficientBalanceError = (token) => new errors_1.InsufficientBalanceError(`Insufficient balance of ${token}`, 119);
38
+ exports.insufficientBalanceError = insufficientBalanceError;
39
+ const unknownTokenTypeError = (token, reason) => new errors_1.TokenError(`Unknown token type of ${token}: ${reason}`, 120);
40
+ exports.unknownTokenTypeError = unknownTokenTypeError;
41
+ const indexRequiredError = (token) => new errors_1.TokenError(`Index is required for collection ${token}`, 121);
42
+ exports.indexRequiredError = indexRequiredError;
43
+ const convertCurrencyFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch convert currency: ${msg}`, 122, inner);
44
+ exports.convertCurrencyFetchError = convertCurrencyFetchError;
45
+ const simulationFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch simulate tac msg: ${msg}`, 123, inner);
46
+ exports.simulationFetchError = simulationFetchError;
47
+ const getTONFeeInfoFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch simulate tac msg: ${msg}`, 124, inner);
48
+ exports.getTONFeeInfoFetchError = getTONFeeInfoFetchError;
49
+ exports.missingFeeParamsError = new errors_1.FormatError('When withoutSimulation is true, protocolFee and evmExecutorFee must be provided in options', 125);
50
+ exports.missingTvmExecutorFeeError = new errors_1.FormatError('When withoutSimulation is true and isRoundTrip is true, tvmExecutorFee must be provided in options', 126);
51
+ exports.missingGasLimitError = new errors_1.FormatError('When withoutSimulation is true, gasLimit must be provided in evmProxyMsg', 127);
52
+ exports.missingDecimals = new errors_1.MetadataError('Missing decimals in jetton metadata', 128);
53
+ exports.missingJettonDataError = new errors_1.MetadataError('Jetton data should be available for TON origin', 129);
54
+ const zeroRawAmountError = (assetAddress) => new errors_1.TokenError(`FT asset with zero rawAmount/amount is not allowed: ${assetAddress}`, 130);
55
+ exports.zeroRawAmountError = zeroRawAmountError;
56
+ const sendCrossChainTransactionFailedError = (msg) => new errors_1.WalletError(`failed to send cross chain transaction: ${msg}`, 131);
57
+ exports.sendCrossChainTransactionFailedError = sendCrossChainTransactionFailedError;
58
+ exports.convertCurrencyNegativeOrZeroValueError = new errors_1.FormatError('Value cannot be negative or zero for currency conversion', 132);
@@ -0,0 +1,21 @@
1
+ export * from './adapters';
2
+ export { AgnosticProxySDK } from './agnosticSdk/AgnosticSdk';
3
+ export * as AgnosticStructs from './agnosticSdk/AgnosticStructs';
4
+ export * from './assets';
5
+ export * from './errors';
6
+ export * from './interfaces';
7
+ export { AxiosHttpClient } from './sdk/AxiosHttpClient';
8
+ export { Configuration } from './sdk/Configuration';
9
+ export { LiteSequencerClient } from './sdk/LiteSequencerClient';
10
+ export { ConsoleLogger, NoopLogger } from './sdk/Logger';
11
+ export { OperationTracker } from './sdk/OperationTracker';
12
+ export { Simulator } from './sdk/Simulator';
13
+ export { startTracking, startTrackingMultiple } from './sdk/StartTracking';
14
+ export { TacSdk } from './sdk/TacSdk';
15
+ export { TACTransactionManager } from './sdk/TACTransactionManager';
16
+ export { TONTransactionManager } from './sdk/TONTransactionManager';
17
+ export * from './sender';
18
+ export * from './structs/Struct';
19
+ export * from './wrappers/ContentUtils';
20
+ export * from './wrappers/HighloadQueryId';
21
+ export * from './wrappers/HighloadWalletV3';
@@ -10,15 +10,42 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
13
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
20
  };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
16
38
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.JettonWalletOpCodes = exports.JettonWallet = exports.HighloadWalletV3 = exports.readJettonMetadata = exports.SimplifiedStatuses = exports.Network = exports.TransactionManager = exports.TacSdk = exports.startTrackingMultiple = exports.startTracking = exports.Simulator = exports.OperationTracker = exports.NoopLogger = exports.ConsoleLogger = exports.LiteSequencerClient = exports.Configuration = exports.orbsOpener = exports.liteClientOpener = void 0;
18
- var contractOpener_1 = require("./adapters/contractOpener");
19
- Object.defineProperty(exports, "liteClientOpener", { enumerable: true, get: function () { return contractOpener_1.liteClientOpener; } });
20
- Object.defineProperty(exports, "orbsOpener", { enumerable: true, get: function () { return contractOpener_1.orbsOpener; } });
39
+ exports.TONTransactionManager = exports.TACTransactionManager = exports.TacSdk = exports.startTrackingMultiple = exports.startTracking = exports.Simulator = exports.OperationTracker = exports.NoopLogger = exports.ConsoleLogger = exports.LiteSequencerClient = exports.Configuration = exports.AxiosHttpClient = exports.AgnosticStructs = exports.AgnosticProxySDK = void 0;
40
+ __exportStar(require("./adapters"), exports);
41
+ var AgnosticSdk_1 = require("./agnosticSdk/AgnosticSdk");
42
+ Object.defineProperty(exports, "AgnosticProxySDK", { enumerable: true, get: function () { return AgnosticSdk_1.AgnosticProxySDK; } });
43
+ exports.AgnosticStructs = __importStar(require("./agnosticSdk/AgnosticStructs"));
44
+ __exportStar(require("./assets"), exports);
21
45
  __exportStar(require("./errors"), exports);
46
+ __exportStar(require("./interfaces"), exports);
47
+ var AxiosHttpClient_1 = require("./sdk/AxiosHttpClient");
48
+ Object.defineProperty(exports, "AxiosHttpClient", { enumerable: true, get: function () { return AxiosHttpClient_1.AxiosHttpClient; } });
22
49
  var Configuration_1 = require("./sdk/Configuration");
23
50
  Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return Configuration_1.Configuration; } });
24
51
  var LiteSequencerClient_1 = require("./sdk/LiteSequencerClient");
@@ -35,19 +62,12 @@ Object.defineProperty(exports, "startTracking", { enumerable: true, get: functio
35
62
  Object.defineProperty(exports, "startTrackingMultiple", { enumerable: true, get: function () { return StartTracking_1.startTrackingMultiple; } });
36
63
  var TacSdk_1 = require("./sdk/TacSdk");
37
64
  Object.defineProperty(exports, "TacSdk", { enumerable: true, get: function () { return TacSdk_1.TacSdk; } });
38
- var TransactionManager_1 = require("./sdk/TransactionManager");
39
- Object.defineProperty(exports, "TransactionManager", { enumerable: true, get: function () { return TransactionManager_1.TransactionManager; } });
65
+ var TACTransactionManager_1 = require("./sdk/TACTransactionManager");
66
+ Object.defineProperty(exports, "TACTransactionManager", { enumerable: true, get: function () { return TACTransactionManager_1.TACTransactionManager; } });
67
+ var TONTransactionManager_1 = require("./sdk/TONTransactionManager");
68
+ Object.defineProperty(exports, "TONTransactionManager", { enumerable: true, get: function () { return TONTransactionManager_1.TONTransactionManager; } });
40
69
  __exportStar(require("./sender"), exports);
41
- __exportStar(require("./structs/Services"), exports);
42
70
  __exportStar(require("./structs/Struct"), exports);
43
- var Struct_1 = require("./structs/Struct");
44
- Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return Struct_1.Network; } });
45
- Object.defineProperty(exports, "SimplifiedStatuses", { enumerable: true, get: function () { return Struct_1.SimplifiedStatuses; } });
46
- __exportStar(require("./assets"), exports);
47
- var ContentUtils_1 = require("./wrappers/ContentUtils");
48
- Object.defineProperty(exports, "readJettonMetadata", { enumerable: true, get: function () { return ContentUtils_1.readJettonMetadata; } });
49
- var HighloadWalletV3_1 = require("./wrappers/HighloadWalletV3");
50
- Object.defineProperty(exports, "HighloadWalletV3", { enumerable: true, get: function () { return HighloadWalletV3_1.HighloadWalletV3; } });
51
- var JettonWallet_1 = require("./wrappers/JettonWallet");
52
- Object.defineProperty(exports, "JettonWallet", { enumerable: true, get: function () { return JettonWallet_1.JettonWallet; } });
53
- Object.defineProperty(exports, "JettonWalletOpCodes", { enumerable: true, get: function () { return JettonWallet_1.JettonWalletOpCodes; } });
71
+ __exportStar(require("./wrappers/ContentUtils"), exports);
72
+ __exportStar(require("./wrappers/HighloadQueryId"), exports);
73
+ __exportStar(require("./wrappers/HighloadWalletV3"), exports);
@@ -0,0 +1,78 @@
1
+ import type { Cell } from '@ton/ton';
2
+ import { AssetType, FeeParams } from '../structs/Struct';
3
+ export interface Asset {
4
+ address: string;
5
+ type: AssetType;
6
+ rawAmount: bigint;
7
+ clone: Asset;
8
+ /**
9
+ * Returns a new asset instance with the specified transfer amount in human-readable units.
10
+ * Does not mutate the current asset instance.
11
+ * @param amount Amount in human units (e.g., 1.5 TON). Decimals are resolved during asset creation.
12
+ * @returns A new Asset reflecting the requested amount.
13
+ */
14
+ withAmount(amount: number): Asset;
15
+ /**
16
+ * Returns a new asset instance with the specified transfer amount in raw base units.
17
+ * Does not mutate the current asset instance.
18
+ * @param rawAmount Amount in raw base units (bigint).
19
+ * @returns A new Asset reflecting the requested raw amount.
20
+ */
21
+ withRawAmount(rawAmount: bigint): Asset;
22
+ /**
23
+ * Increases the transfer amount by the specified value (human-readable units) and returns a new asset instance.
24
+ * Does not mutate the current asset instance.
25
+ * @param amount Amount in human units (e.g., 1.5 TON). Decimals are resolved during asset creation.
26
+ * @returns A new Asset with the increased amount.
27
+ */
28
+ addAmount(amount: number): Asset;
29
+ /**
30
+ * Increases the transfer amount by the specified raw base units and returns a new asset instance.
31
+ * Does not mutate the current asset instance.
32
+ * @param rawAmount Amount in raw base units (bigint).
33
+ * @returns A new Asset with the increased amount in raw units.
34
+ */
35
+ addRawAmount(rawAmount: bigint): Asset;
36
+ /**
37
+ * Resolves the corresponding EVM token address for this asset.
38
+ * Useful when bridging or interacting with EVM-compatible networks.
39
+ * @returns Promise that resolves to the EVM address as a checksum string.
40
+ */
41
+ getEVMAddress(): Promise<string>;
42
+ /**
43
+ * Returns the TVM (TON Virtual Machine) address for this asset.
44
+ * @returns Promise that resolves to the TVM address as a friendly or raw string depending on implementation.
45
+ */
46
+ getTVMAddress(): Promise<string>;
47
+ /**
48
+ * Generates a TVM payload for transferring or interacting with this asset across chains.
49
+ * Implementations may include cross-chain metadata, fees, and forwarding info.
50
+ * @param params Parameters that describe the payload composition.
51
+ * @param params.excessReceiver Address that will receive the excess TON after execution.
52
+ * @param params.evmData Serialized EVM-side call data to be forwarded via the bridge.
53
+ * @param params.crossChainTonAmount Optional TON amount to transfer cross-chain with the message.
54
+ * @param params.forwardFeeTonAmount Optional TON amount used to cover forwarding fees on TON.
55
+ * @param params.feeParams Optional fee parameters to fine-tune execution costs.
56
+ * @returns Promise that resolves to a Cell containing the encoded payload.
57
+ */
58
+ generatePayload(params: {
59
+ excessReceiver: string;
60
+ evmData: Cell;
61
+ crossChainTonAmount?: bigint;
62
+ forwardFeeTonAmount?: bigint;
63
+ feeParams?: FeeParams;
64
+ }): Promise<Cell>;
65
+ /**
66
+ * Validates whether the specified user is allowed to transfer this asset.
67
+ * Implementations should throw if the transfer is not permitted (e.g., frozen asset, missing wallet, insufficient permissions).
68
+ * @param userAddress TVM address of the user attempting to transfer the asset.
69
+ * @returns Promise that resolves if transfer is allowed; rejects with an error otherwise.
70
+ */
71
+ checkCanBeTransferredBy(userAddress: string): Promise<void>;
72
+ /**
73
+ * Retrieves the current balance of this asset for the given user address.
74
+ * @param userAddress TVM address of the user.
75
+ * @returns Promise that resolves to the balance in raw base units (bigint).
76
+ */
77
+ getBalanceOf(userAddress: string): Promise<bigint>;
78
+ }