@across-protocol/sdk 4.3.138 → 4.3.139-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/cjs/src/arch/evm/UpgradeUtils.d.ts +2 -0
  2. package/dist/cjs/src/arch/evm/UpgradeUtils.js +33 -0
  3. package/dist/cjs/src/arch/evm/UpgradeUtils.js.map +1 -0
  4. package/dist/cjs/src/arch/evm/index.d.ts +1 -0
  5. package/dist/cjs/src/arch/evm/index.js +1 -0
  6. package/dist/cjs/src/arch/evm/index.js.map +1 -1
  7. package/dist/cjs/src/arch/index.d.ts +1 -0
  8. package/dist/cjs/src/arch/index.js +2 -1
  9. package/dist/cjs/src/arch/index.js.map +1 -1
  10. package/dist/cjs/src/arch/tvm/BlockUtils.d.ts +1 -0
  11. package/dist/cjs/src/arch/tvm/BlockUtils.js +7 -0
  12. package/dist/cjs/src/arch/tvm/BlockUtils.js.map +1 -0
  13. package/dist/cjs/src/arch/tvm/MessageUtils.d.ts +1 -0
  14. package/dist/cjs/src/arch/tvm/MessageUtils.js +5 -0
  15. package/dist/cjs/src/arch/tvm/MessageUtils.js.map +1 -0
  16. package/dist/cjs/src/arch/tvm/ResourceUtils.d.ts +14 -0
  17. package/dist/cjs/src/arch/tvm/ResourceUtils.js +69 -0
  18. package/dist/cjs/src/arch/tvm/ResourceUtils.js.map +1 -0
  19. package/dist/cjs/src/arch/tvm/SpokeUtils.d.ts +12 -0
  20. package/dist/cjs/src/arch/tvm/SpokeUtils.js +207 -0
  21. package/dist/cjs/src/arch/tvm/SpokeUtils.js.map +1 -0
  22. package/dist/cjs/src/arch/tvm/TransactionUtils.d.ts +7 -0
  23. package/dist/cjs/src/arch/tvm/TransactionUtils.js +45 -0
  24. package/dist/cjs/src/arch/tvm/TransactionUtils.js.map +1 -0
  25. package/dist/cjs/src/arch/tvm/index.d.ts +6 -0
  26. package/dist/cjs/src/arch/tvm/index.js +10 -0
  27. package/dist/cjs/src/arch/tvm/index.js.map +1 -0
  28. package/dist/cjs/src/arch/tvm/types.d.ts +2 -0
  29. package/dist/cjs/src/arch/tvm/types.js +3 -0
  30. package/dist/cjs/src/arch/tvm/types.js.map +1 -0
  31. package/dist/cjs/src/arch/tvm/utils/address.d.ts +3 -0
  32. package/dist/cjs/src/arch/tvm/utils/address.js +17 -0
  33. package/dist/cjs/src/arch/tvm/utils/address.js.map +1 -0
  34. package/dist/cjs/src/arch/tvm/utils/index.d.ts +2 -0
  35. package/dist/cjs/src/arch/tvm/utils/index.js +6 -0
  36. package/dist/cjs/src/arch/tvm/utils/index.js.map +1 -0
  37. package/dist/cjs/src/arch/tvm/utils/wait.d.ts +1 -0
  38. package/dist/cjs/src/{caching/IPFS/index.js → arch/tvm/utils/wait.js} +2 -2
  39. package/dist/cjs/src/arch/tvm/utils/wait.js.map +1 -0
  40. package/dist/cjs/src/caching/index.d.ts +0 -1
  41. package/dist/cjs/src/caching/index.js +0 -1
  42. package/dist/cjs/src/caching/index.js.map +1 -1
  43. package/dist/cjs/src/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +9 -2
  44. package/dist/cjs/src/clients/SpokePoolClient/EVMSpokePoolClient.js +33 -12
  45. package/dist/cjs/src/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  46. package/dist/cjs/src/clients/SpokePoolClient/TVMSpokePoolClient.d.ts +11 -0
  47. package/dist/cjs/src/clients/SpokePoolClient/TVMSpokePoolClient.js +47 -0
  48. package/dist/cjs/src/clients/SpokePoolClient/TVMSpokePoolClient.js.map +1 -0
  49. package/dist/cjs/src/clients/SpokePoolClient/index.d.ts +3 -0
  50. package/dist/cjs/src/clients/SpokePoolClient/index.js +7 -1
  51. package/dist/cjs/src/clients/SpokePoolClient/index.js.map +1 -1
  52. package/dist/cjs/src/clients/SpokePoolClient/types.d.ts +1 -0
  53. package/dist/cjs/src/clients/SpokePoolClient/types.js +2 -1
  54. package/dist/cjs/src/clients/SpokePoolClient/types.js.map +1 -1
  55. package/dist/cjs/src/clients/index.d.ts +1 -1
  56. package/dist/cjs/src/clients/index.js +3 -1
  57. package/dist/cjs/src/clients/index.js.map +1 -1
  58. package/dist/cjs/src/gasPriceOracle/oracle.js +1 -0
  59. package/dist/cjs/src/gasPriceOracle/oracle.js.map +1 -1
  60. package/dist/cjs/src/relayFeeCalculator/chain-queries/factory.d.ts +79 -151
  61. package/dist/cjs/src/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  62. package/dist/cjs/src/relayFeeCalculator/relayFeeCalculator.d.ts +77 -150
  63. package/dist/cjs/src/utils/AddressUtils.d.ts +11 -0
  64. package/dist/cjs/src/utils/AddressUtils.js +52 -1
  65. package/dist/cjs/src/utils/AddressUtils.js.map +1 -1
  66. package/dist/cjs/src/utils/Multicall.js +1 -0
  67. package/dist/cjs/src/utils/Multicall.js.map +1 -1
  68. package/dist/cjs/src/utils/NetworkUtils.d.ts +1 -0
  69. package/dist/cjs/src/utils/NetworkUtils.js +9 -3
  70. package/dist/cjs/src/utils/NetworkUtils.js.map +1 -1
  71. package/dist/cjs/src/utils/TokenUtils.d.ts +154 -300
  72. package/dist/cjs/src/utils/TypeGuards.d.ts +3 -1
  73. package/dist/cjs/src/utils/TypeGuards.js +5 -0
  74. package/dist/cjs/src/utils/TypeGuards.js.map +1 -1
  75. package/dist/cjs/src/utils/abi/typechain/SP1AutoVerifier.d.ts +42 -0
  76. package/dist/cjs/src/utils/abi/typechain/SP1AutoVerifier.js +3 -0
  77. package/dist/cjs/src/utils/abi/typechain/SP1AutoVerifier.js.map +1 -0
  78. package/dist/cjs/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.d.ts +26 -0
  79. package/dist/cjs/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.js +43 -0
  80. package/dist/cjs/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.js.map +1 -0
  81. package/dist/cjs/src/utils/abi/typechain/factories/index.d.ts +1 -0
  82. package/dist/cjs/src/utils/abi/typechain/factories/index.js +4 -2
  83. package/dist/cjs/src/utils/abi/typechain/factories/index.js.map +1 -1
  84. package/dist/cjs/src/utils/abi/typechain/index.d.ts +2 -0
  85. package/dist/cjs/src/utils/abi/typechain/index.js +4 -2
  86. package/dist/cjs/src/utils/abi/typechain/index.js.map +1 -1
  87. package/dist/cjs/src/utils/index.d.ts +0 -1
  88. package/dist/cjs/src/utils/index.js +0 -1
  89. package/dist/cjs/src/utils/index.js.map +1 -1
  90. package/dist/esm/src/arch/evm/UpgradeUtils.d.ts +9 -0
  91. package/dist/esm/src/arch/evm/UpgradeUtils.js +37 -0
  92. package/dist/esm/src/arch/evm/UpgradeUtils.js.map +1 -0
  93. package/dist/esm/src/arch/evm/index.d.ts +1 -0
  94. package/dist/esm/src/arch/evm/index.js +1 -0
  95. package/dist/esm/src/arch/evm/index.js.map +1 -1
  96. package/dist/esm/src/arch/index.d.ts +1 -0
  97. package/dist/esm/src/arch/index.js +2 -0
  98. package/dist/esm/src/arch/index.js.map +1 -1
  99. package/dist/esm/src/arch/tvm/BlockUtils.d.ts +1 -0
  100. package/dist/esm/src/arch/tvm/BlockUtils.js +2 -0
  101. package/dist/esm/src/arch/tvm/BlockUtils.js.map +1 -0
  102. package/dist/esm/src/arch/tvm/MessageUtils.d.ts +1 -0
  103. package/dist/esm/src/arch/tvm/MessageUtils.js +2 -0
  104. package/dist/esm/src/arch/tvm/MessageUtils.js.map +1 -0
  105. package/dist/esm/src/arch/tvm/ResourceUtils.d.ts +32 -0
  106. package/dist/esm/src/arch/tvm/ResourceUtils.js +88 -0
  107. package/dist/esm/src/arch/tvm/ResourceUtils.js.map +1 -0
  108. package/dist/esm/src/arch/tvm/SpokeUtils.d.ts +48 -0
  109. package/dist/esm/src/arch/tvm/SpokeUtils.js +237 -0
  110. package/dist/esm/src/arch/tvm/SpokeUtils.js.map +1 -0
  111. package/dist/esm/src/arch/tvm/TransactionUtils.d.ts +20 -0
  112. package/dist/esm/src/arch/tvm/TransactionUtils.js +57 -0
  113. package/dist/esm/src/arch/tvm/TransactionUtils.js.map +1 -0
  114. package/dist/esm/src/arch/tvm/index.d.ts +6 -0
  115. package/dist/esm/src/arch/tvm/index.js +7 -0
  116. package/dist/esm/src/arch/tvm/index.js.map +1 -0
  117. package/dist/esm/src/arch/tvm/types.d.ts +2 -0
  118. package/dist/esm/src/arch/tvm/types.js +2 -0
  119. package/dist/esm/src/arch/tvm/types.js.map +1 -0
  120. package/dist/esm/src/arch/tvm/utils/address.d.ts +18 -0
  121. package/dist/esm/src/arch/tvm/utils/address.js +31 -0
  122. package/dist/esm/src/arch/tvm/utils/address.js.map +1 -0
  123. package/dist/esm/src/arch/tvm/utils/index.d.ts +2 -0
  124. package/dist/esm/src/arch/tvm/utils/index.js +3 -0
  125. package/dist/esm/src/arch/tvm/utils/index.js.map +1 -0
  126. package/dist/esm/src/arch/tvm/utils/wait.d.ts +1 -0
  127. package/dist/esm/src/arch/tvm/utils/wait.js +2 -0
  128. package/dist/esm/src/arch/tvm/utils/wait.js.map +1 -0
  129. package/dist/esm/src/caching/index.d.ts +0 -1
  130. package/dist/esm/src/caching/index.js +0 -1
  131. package/dist/esm/src/caching/index.js.map +1 -1
  132. package/dist/esm/src/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +20 -2
  133. package/dist/esm/src/clients/SpokePoolClient/EVMSpokePoolClient.js +44 -12
  134. package/dist/esm/src/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
  135. package/dist/esm/src/clients/SpokePoolClient/TVMSpokePoolClient.d.ts +32 -0
  136. package/dist/esm/src/clients/SpokePoolClient/TVMSpokePoolClient.js +66 -0
  137. package/dist/esm/src/clients/SpokePoolClient/TVMSpokePoolClient.js.map +1 -0
  138. package/dist/esm/src/clients/SpokePoolClient/index.d.ts +8 -0
  139. package/dist/esm/src/clients/SpokePoolClient/index.js +10 -1
  140. package/dist/esm/src/clients/SpokePoolClient/index.js.map +1 -1
  141. package/dist/esm/src/clients/SpokePoolClient/types.d.ts +1 -0
  142. package/dist/esm/src/clients/SpokePoolClient/types.js +1 -0
  143. package/dist/esm/src/clients/SpokePoolClient/types.js.map +1 -1
  144. package/dist/esm/src/clients/index.d.ts +1 -1
  145. package/dist/esm/src/clients/index.js +1 -1
  146. package/dist/esm/src/clients/index.js.map +1 -1
  147. package/dist/esm/src/gasPriceOracle/oracle.js +1 -0
  148. package/dist/esm/src/gasPriceOracle/oracle.js.map +1 -1
  149. package/dist/esm/src/relayFeeCalculator/chain-queries/factory.d.ts +79 -151
  150. package/dist/esm/src/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  151. package/dist/esm/src/relayFeeCalculator/relayFeeCalculator.d.ts +77 -150
  152. package/dist/esm/src/utils/AddressUtils.d.ts +11 -0
  153. package/dist/esm/src/utils/AddressUtils.js +59 -1
  154. package/dist/esm/src/utils/AddressUtils.js.map +1 -1
  155. package/dist/esm/src/utils/Multicall.js +1 -0
  156. package/dist/esm/src/utils/Multicall.js.map +1 -1
  157. package/dist/esm/src/utils/NetworkUtils.d.ts +6 -0
  158. package/dist/esm/src/utils/NetworkUtils.js +13 -3
  159. package/dist/esm/src/utils/NetworkUtils.js.map +1 -1
  160. package/dist/esm/src/utils/TokenUtils.d.ts +154 -300
  161. package/dist/esm/src/utils/TypeGuards.d.ts +3 -1
  162. package/dist/esm/src/utils/TypeGuards.js +4 -0
  163. package/dist/esm/src/utils/TypeGuards.js.map +1 -1
  164. package/dist/esm/src/utils/abi/typechain/SP1AutoVerifier.d.ts +42 -0
  165. package/dist/esm/src/utils/abi/typechain/SP1AutoVerifier.js +2 -0
  166. package/dist/esm/src/utils/abi/typechain/SP1AutoVerifier.js.map +1 -0
  167. package/dist/esm/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.d.ts +26 -0
  168. package/dist/esm/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.js +43 -0
  169. package/dist/esm/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.js.map +1 -0
  170. package/dist/esm/src/utils/abi/typechain/factories/index.d.ts +1 -0
  171. package/dist/esm/src/utils/abi/typechain/factories/index.js +1 -0
  172. package/dist/esm/src/utils/abi/typechain/factories/index.js.map +1 -1
  173. package/dist/esm/src/utils/abi/typechain/index.d.ts +2 -0
  174. package/dist/esm/src/utils/abi/typechain/index.js +1 -0
  175. package/dist/esm/src/utils/abi/typechain/index.js.map +1 -1
  176. package/dist/esm/src/utils/index.d.ts +0 -1
  177. package/dist/esm/src/utils/index.js +0 -1
  178. package/dist/esm/src/utils/index.js.map +1 -1
  179. package/dist/types/src/arch/evm/UpgradeUtils.d.ts +10 -0
  180. package/dist/types/src/arch/evm/UpgradeUtils.d.ts.map +1 -0
  181. package/dist/types/src/arch/evm/index.d.ts +1 -0
  182. package/dist/types/src/arch/evm/index.d.ts.map +1 -1
  183. package/dist/types/src/arch/index.d.ts +1 -0
  184. package/dist/types/src/arch/index.d.ts.map +1 -1
  185. package/dist/types/src/arch/tvm/BlockUtils.d.ts +2 -0
  186. package/dist/types/src/arch/tvm/BlockUtils.d.ts.map +1 -0
  187. package/dist/types/src/arch/tvm/MessageUtils.d.ts +2 -0
  188. package/dist/types/src/arch/tvm/MessageUtils.d.ts.map +1 -0
  189. package/dist/types/src/arch/tvm/ResourceUtils.d.ts +33 -0
  190. package/dist/types/src/arch/tvm/ResourceUtils.d.ts.map +1 -0
  191. package/dist/types/src/arch/tvm/SpokeUtils.d.ts +49 -0
  192. package/dist/types/src/arch/tvm/SpokeUtils.d.ts.map +1 -0
  193. package/dist/types/src/arch/tvm/TransactionUtils.d.ts +21 -0
  194. package/dist/types/src/arch/tvm/TransactionUtils.d.ts.map +1 -0
  195. package/dist/types/src/arch/tvm/index.d.ts +7 -0
  196. package/dist/types/src/arch/tvm/index.d.ts.map +1 -0
  197. package/dist/types/src/arch/tvm/types.d.ts +3 -0
  198. package/dist/types/src/arch/tvm/types.d.ts.map +1 -0
  199. package/dist/types/src/arch/tvm/utils/address.d.ts +19 -0
  200. package/dist/types/src/arch/tvm/utils/address.d.ts.map +1 -0
  201. package/dist/types/src/arch/tvm/utils/index.d.ts +3 -0
  202. package/dist/types/src/arch/tvm/utils/index.d.ts.map +1 -0
  203. package/dist/types/src/arch/tvm/utils/wait.d.ts +2 -0
  204. package/dist/types/src/arch/tvm/utils/wait.d.ts.map +1 -0
  205. package/dist/types/src/caching/index.d.ts +0 -1
  206. package/dist/types/src/caching/index.d.ts.map +1 -1
  207. package/dist/types/src/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +20 -2
  208. package/dist/types/src/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
  209. package/dist/types/src/clients/SpokePoolClient/TVMSpokePoolClient.d.ts +33 -0
  210. package/dist/types/src/clients/SpokePoolClient/TVMSpokePoolClient.d.ts.map +1 -0
  211. package/dist/types/src/clients/SpokePoolClient/index.d.ts +8 -0
  212. package/dist/types/src/clients/SpokePoolClient/index.d.ts.map +1 -1
  213. package/dist/types/src/clients/SpokePoolClient/types.d.ts +1 -0
  214. package/dist/types/src/clients/SpokePoolClient/types.d.ts.map +1 -1
  215. package/dist/types/src/clients/index.d.ts +1 -1
  216. package/dist/types/src/clients/index.d.ts.map +1 -1
  217. package/dist/types/src/relayFeeCalculator/chain-queries/factory.d.ts +79 -151
  218. package/dist/types/src/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  219. package/dist/types/src/relayFeeCalculator/relayFeeCalculator.d.ts +77 -150
  220. package/dist/types/src/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  221. package/dist/types/src/utils/AddressUtils.d.ts +11 -0
  222. package/dist/types/src/utils/AddressUtils.d.ts.map +1 -1
  223. package/dist/types/src/utils/Multicall.d.ts.map +1 -1
  224. package/dist/types/src/utils/NetworkUtils.d.ts +6 -0
  225. package/dist/types/src/utils/NetworkUtils.d.ts.map +1 -1
  226. package/dist/types/src/utils/TokenUtils.d.ts +154 -300
  227. package/dist/types/src/utils/TokenUtils.d.ts.map +1 -1
  228. package/dist/types/src/utils/TypeGuards.d.ts +3 -1
  229. package/dist/types/src/utils/TypeGuards.d.ts.map +1 -1
  230. package/dist/types/src/utils/abi/typechain/SP1AutoVerifier.d.ts +43 -0
  231. package/dist/types/src/utils/abi/typechain/SP1AutoVerifier.d.ts.map +1 -0
  232. package/dist/types/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.d.ts +27 -0
  233. package/dist/types/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.d.ts.map +1 -0
  234. package/dist/types/src/utils/abi/typechain/factories/index.d.ts +1 -0
  235. package/dist/types/src/utils/abi/typechain/factories/index.d.ts.map +1 -1
  236. package/dist/types/src/utils/abi/typechain/index.d.ts +2 -0
  237. package/dist/types/src/utils/abi/typechain/index.d.ts.map +1 -1
  238. package/dist/types/src/utils/index.d.ts +0 -1
  239. package/dist/types/src/utils/index.d.ts.map +1 -1
  240. package/package.json +10 -35
  241. package/src/arch/evm/UpgradeUtils.ts +18 -0
  242. package/src/arch/evm/index.ts +1 -0
  243. package/src/arch/index.ts +1 -0
  244. package/src/arch/tvm/BlockUtils.ts +1 -0
  245. package/src/arch/tvm/MessageUtils.ts +1 -0
  246. package/src/arch/tvm/ResourceUtils.ts +92 -0
  247. package/src/arch/tvm/SpokeUtils.ts +225 -0
  248. package/src/arch/tvm/TransactionUtils.ts +64 -0
  249. package/src/arch/tvm/index.ts +6 -0
  250. package/src/arch/tvm/types.ts +2 -0
  251. package/src/arch/tvm/utils/address.ts +33 -0
  252. package/src/arch/tvm/utils/index.ts +2 -0
  253. package/src/arch/tvm/utils/wait.ts +1 -0
  254. package/src/caching/index.ts +0 -1
  255. package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +44 -18
  256. package/src/clients/SpokePoolClient/TVMSpokePoolClient.ts +65 -0
  257. package/src/clients/SpokePoolClient/index.ts +12 -1
  258. package/src/clients/SpokePoolClient/types.ts +1 -0
  259. package/src/clients/index.ts +2 -0
  260. package/src/gasPriceOracle/oracle.ts +1 -0
  261. package/src/relayFeeCalculator/chain-queries/factory.ts +2 -1
  262. package/src/utils/AddressUtils.ts +61 -1
  263. package/src/utils/Multicall.ts +1 -0
  264. package/src/utils/NetworkUtils.ts +13 -3
  265. package/src/utils/TypeGuards.ts +6 -1
  266. package/src/utils/abi/contracts/SP1AutoVerifier.json +25 -0
  267. package/src/utils/abi/typechain/SP1AutoVerifier.ts +112 -0
  268. package/src/utils/abi/typechain/factories/SP1AutoVerifier__factory.ts +49 -0
  269. package/src/utils/abi/typechain/factories/index.ts +1 -0
  270. package/src/utils/abi/typechain/index.ts +2 -0
  271. package/src/utils/index.ts +0 -1
  272. package/dist/cjs/src/caching/IPFS/PinataIPFSClient.d.ts +0 -11
  273. package/dist/cjs/src/caching/IPFS/PinataIPFSClient.js +0 -67
  274. package/dist/cjs/src/caching/IPFS/PinataIPFSClient.js.map +0 -1
  275. package/dist/cjs/src/caching/IPFS/index.d.ts +0 -1
  276. package/dist/cjs/src/caching/IPFS/index.js.map +0 -1
  277. package/dist/cjs/src/utils/IPFSUtils.d.ts +0 -4
  278. package/dist/cjs/src/utils/IPFSUtils.js +0 -32
  279. package/dist/cjs/src/utils/IPFSUtils.js.map +0 -1
  280. package/dist/esm/src/caching/IPFS/PinataIPFSClient.d.ts +0 -37
  281. package/dist/esm/src/caching/IPFS/PinataIPFSClient.js +0 -81
  282. package/dist/esm/src/caching/IPFS/PinataIPFSClient.js.map +0 -1
  283. package/dist/esm/src/caching/IPFS/index.d.ts +0 -1
  284. package/dist/esm/src/caching/IPFS/index.js +0 -2
  285. package/dist/esm/src/caching/IPFS/index.js.map +0 -1
  286. package/dist/esm/src/utils/IPFSUtils.d.ts +0 -24
  287. package/dist/esm/src/utils/IPFSUtils.js +0 -47
  288. package/dist/esm/src/utils/IPFSUtils.js.map +0 -1
  289. package/dist/types/src/caching/IPFS/PinataIPFSClient.d.ts +0 -38
  290. package/dist/types/src/caching/IPFS/PinataIPFSClient.d.ts.map +0 -1
  291. package/dist/types/src/caching/IPFS/index.d.ts +0 -2
  292. package/dist/types/src/caching/IPFS/index.d.ts.map +0 -1
  293. package/dist/types/src/utils/IPFSUtils.d.ts +0 -25
  294. package/dist/types/src/utils/IPFSUtils.d.ts.map +0 -1
  295. package/scripts/build-bigint-buffer.js +0 -49
  296. package/src/caching/IPFS/PinataIPFSClient.ts +0 -92
  297. package/src/caching/IPFS/index.ts +0 -1
  298. package/src/utils/IPFSUtils.ts +0 -45
@@ -1,38 +0,0 @@
1
- import { CachingMechanismInterface } from "../../interfaces";
2
- import { Struct } from "superstruct";
3
- import winston from "winston";
4
- /**
5
- * A client for interacting with the IPFS. This is a wrapper around the IPFS API.
6
- * This client also is a part of the caching mechanism interface.
7
- * @see https://docs.ipfs.io/reference/http/api/
8
- */
9
- export declare class PinataIPFSClient implements CachingMechanismInterface {
10
- /**
11
- * The IPFS client instance
12
- */
13
- private client;
14
- /**
15
- * Public IPFS gateway URL to retrieve the content from
16
- */
17
- private publicGatewayURL;
18
- /**
19
- * An optional logger for logging messages
20
- */
21
- private logger?;
22
- constructor(projectId: string, projectSecret: string, publicGatewayURL: string, logger?: winston.Logger);
23
- /**
24
- * Calls to a public IPFS gateway to retrieve a value.
25
- * @param key The key to retrieve.
26
- * @param _structValidator An optional struct validator to validate the retrieved value. If the value does not match the struct, null is returned.
27
- * @returns The value if it exists, otherwise null.
28
- */
29
- get<ObjectType>(key?: string, _structValidator?: Struct<unknown, unknown>): Promise<ObjectType | null>;
30
- /**
31
- * Stores a value in the IPFS and returns the CID of the value stored.
32
- * @param key An optional key to store the value with. This is purely in the metadata of the CID.
33
- * @param value The value to store.
34
- * @returns The CID of the value stored.
35
- */
36
- set<T>(key: string, value: T): Promise<string | undefined>;
37
- }
38
- //# sourceMappingURL=PinataIPFSClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PinataIPFSClient.d.ts","sourceRoot":"","sources":["../../../../../src/caching/IPFS/PinataIPFSClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,yBAAyB;IAChE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAe;IAE7B;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEb,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM;IAM9G;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAkC5G;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAW3D"}
@@ -1,2 +0,0 @@
1
- export * from "./PinataIPFSClient";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/caching/IPFS/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1,25 +0,0 @@
1
- import PinataClient from "@pinata/sdk";
2
- /**
3
- * Build an IPFS client for interacting with the IPFS API
4
- * @param APIKey The project ID
5
- * @param secretAPIKey The project secret
6
- * @returns An IPFS client for interacting with Pinata
7
- */
8
- export declare function buildIPFSClient(APIKey: string, secretAPIKey: string): PinataClient;
9
- /**
10
- * Retrieves a value from an IPFS gateway
11
- * @param contentHash The content hash of the value to retrieve
12
- * @param publicGatewayURL The URL of the public IPFS gateway to use
13
- * @returns The value retrieved from the IPFS gateway
14
- * @throws Error if the value could not be retrieved
15
- */
16
- export declare function retrieveValueFromIPFS(contentHash: string, publicGatewayURL: string): Promise<string>;
17
- /**
18
- * Pins a value to the IPFS network
19
- * @param key A key to use for pinning the value. This is a metadata field.
20
- * @param content The value to pin
21
- * @param client The IPFS client to use
22
- * @returns The content hash of the pinned value
23
- */
24
- export declare function storeValueInIPFS(key: string, content: string, client: PinataClient): Promise<string>;
25
- //# sourceMappingURL=IPFSUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IPFSUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/IPFSUtils.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAC;AAGvC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAElF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQpG;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAO1G"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Build Script for bigint-buffer Native Module
3
- *
4
- * Purpose:
5
- * This script handles the native compilation of the bigint-buffer module, which provides
6
- * high-performance BigInt <-> Buffer conversions using native C++ code.
7
- *
8
- * Why JavaScript and not TypeScript or an embedded shell script:
9
- * 1. This is a build script that runs during package installation (postinstall)
10
- * 2. Using TypeScript would require the TypeScript compiler or ts-node to be available during installation
11
- * 3. Plain JavaScript ensures this script can run immediately without compilation
12
- * 4. This script is operating system agnostic, so it can be run on any platform that supports Node.js
13
- */
14
-
15
- const { execSync } = require('child_process');
16
- const { existsSync } = require('fs');
17
- const path = require('path');
18
-
19
- try {
20
- // Check if the bigint-buffer module exists in node_modules
21
- // Using path.join for cross-platform compatibility (Windows/Unix)
22
- const bigintBufferPath = path.join(process.cwd(), 'node_modules/bigint-buffer');
23
-
24
- // Skip if module isn't installed
25
- if (!existsSync(bigintBufferPath)) {
26
- console.log('Skipping bigint-buffer build: folder not found');
27
- process.exit(0);
28
- }
29
-
30
- // Verify node-gyp (native module build tool) is available
31
- // node-gyp is required to compile the C++ code in bigint-buffer
32
- try {
33
- execSync('command -v node-gyp', { stdio: 'ignore' });
34
- } catch {
35
- console.log('Skipping bigint-buffer build: node-gyp not found');
36
- process.exit(0);
37
- }
38
-
39
- // Change to the module directory and run the native build
40
- // node-gyp configure: Creates platform-specific build files
41
- // node-gyp build: Compiles the native code
42
- process.chdir(bigintBufferPath);
43
- execSync('node-gyp configure', { stdio: 'inherit' });
44
- execSync('node-gyp build', { stdio: 'inherit' });
45
- } catch (error) {
46
- // Proper error handling for build failures
47
- console.error('Error building bigint-buffer:', error);
48
- process.exit(1);
49
- }
@@ -1,92 +0,0 @@
1
- import { buildIPFSClient, retrieveValueFromIPFS, storeValueInIPFS } from "../../utils/IPFSUtils";
2
- import { CachingMechanismInterface } from "../../interfaces";
3
- import { Struct } from "superstruct";
4
- import winston from "winston";
5
- import PinataClient from "@pinata/sdk";
6
- import { jsonReviverWithBigNumbers, jsonReplacerWithBigNumbers, formattedLog } from "../../utils";
7
-
8
- /**
9
- * A client for interacting with the IPFS. This is a wrapper around the IPFS API.
10
- * This client also is a part of the caching mechanism interface.
11
- * @see https://docs.ipfs.io/reference/http/api/
12
- */
13
- export class PinataIPFSClient implements CachingMechanismInterface {
14
- /**
15
- * The IPFS client instance
16
- */
17
- private client: PinataClient;
18
-
19
- /**
20
- * Public IPFS gateway URL to retrieve the content from
21
- */
22
- private publicGatewayURL: string;
23
-
24
- /**
25
- * An optional logger for logging messages
26
- */
27
- private logger?: winston.Logger;
28
-
29
- public constructor(projectId: string, projectSecret: string, publicGatewayURL: string, logger?: winston.Logger) {
30
- this.client = buildIPFSClient(projectId, projectSecret);
31
- this.publicGatewayURL = publicGatewayURL;
32
- this.logger = logger;
33
- }
34
-
35
- /**
36
- * Calls to a public IPFS gateway to retrieve a value.
37
- * @param key The key to retrieve.
38
- * @param _structValidator An optional struct validator to validate the retrieved value. If the value does not match the struct, null is returned.
39
- * @returns The value if it exists, otherwise null.
40
- */
41
- async get<ObjectType>(key?: string, _structValidator?: Struct<unknown, unknown>): Promise<ObjectType | null> {
42
- if (!key) {
43
- return null;
44
- }
45
- formattedLog(this.logger, {
46
- level: "debug",
47
- message: `Retrieving value from IPFS with key ${key}`,
48
- at: {
49
- location: "IPFSClient",
50
- function: "get",
51
- },
52
- });
53
-
54
- const arrivedResult = await retrieveValueFromIPFS(key, this.publicGatewayURL);
55
- if (!arrivedResult) {
56
- return null;
57
- }
58
- const revivedResult = JSON.parse(arrivedResult, jsonReviverWithBigNumbers);
59
-
60
- if (_structValidator && !_structValidator.is(revivedResult)) {
61
- formattedLog(this.logger, {
62
- level: "warn",
63
- message: `Retrieved value from IPFS with key ${key} does not match the expected type`,
64
- at: {
65
- location: "IPFSClient",
66
- function: "get",
67
- },
68
- });
69
- return null;
70
- }
71
-
72
- return revivedResult as ObjectType;
73
- }
74
-
75
- /**
76
- * Stores a value in the IPFS and returns the CID of the value stored.
77
- * @param key An optional key to store the value with. This is purely in the metadata of the CID.
78
- * @param value The value to store.
79
- * @returns The CID of the value stored.
80
- */
81
- set<T>(key: string, value: T): Promise<string | undefined> {
82
- formattedLog(this.logger, {
83
- level: "debug",
84
- message: `Setting value from IPFS with key ${key}`,
85
- at: {
86
- location: "IPFSClient",
87
- function: "setWithReturnID",
88
- },
89
- });
90
- return storeValueInIPFS(key, JSON.stringify(value, jsonReplacerWithBigNumbers), this.client);
91
- }
92
- }
@@ -1 +0,0 @@
1
- export * from "./PinataIPFSClient";
@@ -1,45 +0,0 @@
1
- import PinataClient from "@pinata/sdk";
2
- import { fetchWithTimeout } from "./FetchUtils";
3
-
4
- /**
5
- * Build an IPFS client for interacting with the IPFS API
6
- * @param APIKey The project ID
7
- * @param secretAPIKey The project secret
8
- * @returns An IPFS client for interacting with Pinata
9
- */
10
- export function buildIPFSClient(APIKey: string, secretAPIKey: string): PinataClient {
11
- return new PinataClient(APIKey, secretAPIKey);
12
- }
13
-
14
- /**
15
- * Retrieves a value from an IPFS gateway
16
- * @param contentHash The content hash of the value to retrieve
17
- * @param publicGatewayURL The URL of the public IPFS gateway to use
18
- * @returns The value retrieved from the IPFS gateway
19
- * @throws Error if the value could not be retrieved
20
- */
21
- export function retrieveValueFromIPFS(contentHash: string, publicGatewayURL: string): Promise<string> {
22
- return fetchWithTimeout<string>(
23
- `${publicGatewayURL}/ipfs/${contentHash}`,
24
- {},
25
- { Accept: "text/plain" },
26
- undefined,
27
- "text"
28
- );
29
- }
30
-
31
- /**
32
- * Pins a value to the IPFS network
33
- * @param key A key to use for pinning the value. This is a metadata field.
34
- * @param content The value to pin
35
- * @param client The IPFS client to use
36
- * @returns The content hash of the pinned value
37
- */
38
- export async function storeValueInIPFS(key: string, content: string, client: PinataClient): Promise<string> {
39
- const result = await client.pinJSONToIPFS(JSON.parse(content), {
40
- pinataMetadata: {
41
- name: key,
42
- },
43
- });
44
- return result.IpfsHash;
45
- }