@sudobility/contracts 0.14.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 (322) hide show
  1. package/README.md +353 -0
  2. package/artifacts/contracts/Mailer.sol/Mailer.d.ts +1146 -0
  3. package/artifacts/contracts/Mailer.sol/Mailer.dbg.json +4 -0
  4. package/artifacts/contracts/Mailer.sol/Mailer.json +1096 -0
  5. package/artifacts/contracts/Mailer.sol/artifacts.d.ts +21 -0
  6. package/artifacts/contracts/MockUSDC.sol/MockUSDC.d.ts +284 -0
  7. package/artifacts/contracts/MockUSDC.sol/MockUSDC.dbg.json +4 -0
  8. package/artifacts/contracts/MockUSDC.sol/MockUSDC.json +234 -0
  9. package/artifacts/contracts/MockUSDC.sol/artifacts.d.ts +21 -0
  10. package/artifacts/contracts/interfaces/IERC20.sol/IERC20.d.ts +157 -0
  11. package/artifacts/contracts/interfaces/IERC20.sol/IERC20.dbg.json +4 -0
  12. package/artifacts/contracts/interfaces/IERC20.sol/IERC20.json +107 -0
  13. package/artifacts/contracts/interfaces/IERC20.sol/artifacts.d.ts +21 -0
  14. package/dist/evm/src/evm/index.d.ts +4 -0
  15. package/dist/evm/src/evm/index.d.ts.map +1 -0
  16. package/dist/evm/src/evm/index.js +10 -0
  17. package/dist/evm/src/evm/index.js.map +1 -0
  18. package/dist/evm/src/evm/mailer-client.d.ts +966 -0
  19. package/dist/evm/src/evm/mailer-client.d.ts.map +1 -0
  20. package/dist/evm/src/evm/mailer-client.js +619 -0
  21. package/dist/evm/src/evm/mailer-client.js.map +1 -0
  22. package/dist/evm/typechain-types/Mailer.d.ts +698 -0
  23. package/dist/evm/typechain-types/Mailer.d.ts.map +1 -0
  24. package/dist/evm/typechain-types/Mailer.js +3 -0
  25. package/dist/evm/typechain-types/Mailer.js.map +1 -0
  26. package/dist/evm/typechain-types/MockUSDC.d.ts +118 -0
  27. package/dist/evm/typechain-types/MockUSDC.d.ts.map +1 -0
  28. package/dist/evm/typechain-types/MockUSDC.js +3 -0
  29. package/dist/evm/typechain-types/MockUSDC.js.map +1 -0
  30. package/dist/evm/typechain-types/common.d.ts +51 -0
  31. package/dist/evm/typechain-types/common.d.ts.map +1 -0
  32. package/dist/evm/typechain-types/common.js +3 -0
  33. package/dist/evm/typechain-types/common.js.map +1 -0
  34. package/dist/evm/typechain-types/factories/Mailer__factory.d.ts +875 -0
  35. package/dist/evm/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
  36. package/dist/evm/typechain-types/factories/Mailer__factory.js +1125 -0
  37. package/dist/evm/typechain-types/factories/Mailer__factory.js.map +1 -0
  38. package/dist/evm/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
  39. package/dist/evm/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
  40. package/dist/evm/typechain-types/factories/MockUSDC__factory.js +263 -0
  41. package/dist/evm/typechain-types/factories/MockUSDC__factory.js.map +1 -0
  42. package/dist/evm/typechain-types/factories/index.d.ts +4 -0
  43. package/dist/evm/typechain-types/factories/index.d.ts.map +1 -0
  44. package/dist/evm/typechain-types/factories/index.js +45 -0
  45. package/dist/evm/typechain-types/factories/index.js.map +1 -0
  46. package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
  47. package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
  48. package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.js +116 -0
  49. package/dist/evm/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
  50. package/dist/evm/typechain-types/factories/interfaces/index.d.ts +2 -0
  51. package/dist/evm/typechain-types/factories/interfaces/index.d.ts.map +1 -0
  52. package/dist/evm/typechain-types/factories/interfaces/index.js +9 -0
  53. package/dist/evm/typechain-types/factories/interfaces/index.js.map +1 -0
  54. package/dist/evm/typechain-types/index.d.ts +10 -0
  55. package/dist/evm/typechain-types/index.d.ts.map +1 -0
  56. package/dist/evm/typechain-types/index.js +44 -0
  57. package/dist/evm/typechain-types/index.js.map +1 -0
  58. package/dist/evm/typechain-types/interfaces/IERC20.d.ts +70 -0
  59. package/dist/evm/typechain-types/interfaces/IERC20.d.ts.map +1 -0
  60. package/dist/evm/typechain-types/interfaces/IERC20.js +3 -0
  61. package/dist/evm/typechain-types/interfaces/IERC20.js.map +1 -0
  62. package/dist/evm/typechain-types/interfaces/index.d.ts +2 -0
  63. package/dist/evm/typechain-types/interfaces/index.d.ts.map +1 -0
  64. package/dist/evm/typechain-types/interfaces/index.js +3 -0
  65. package/dist/evm/typechain-types/interfaces/index.js.map +1 -0
  66. package/dist/solana/solana/index.d.ts +3 -0
  67. package/dist/solana/solana/index.d.ts.map +1 -0
  68. package/dist/solana/solana/index.js +21 -0
  69. package/dist/solana/solana/index.js.map +1 -0
  70. package/dist/solana/solana/mailer-client.d.ts +282 -0
  71. package/dist/solana/solana/mailer-client.d.ts.map +1 -0
  72. package/dist/solana/solana/mailer-client.js +989 -0
  73. package/dist/solana/solana/mailer-client.js.map +1 -0
  74. package/dist/solana/solana/types.d.ts +28 -0
  75. package/dist/solana/solana/types.d.ts.map +1 -0
  76. package/dist/solana/solana/types.js +23 -0
  77. package/dist/solana/solana/types.js.map +1 -0
  78. package/dist/solana/utils/currency.d.ts +26 -0
  79. package/dist/solana/utils/currency.d.ts.map +1 -0
  80. package/dist/solana/utils/currency.js +36 -0
  81. package/dist/solana/utils/currency.js.map +1 -0
  82. package/dist/unified/package.json +3 -0
  83. package/dist/unified/src/evm/index.d.ts +4 -0
  84. package/dist/unified/src/evm/index.d.ts.map +1 -0
  85. package/dist/unified/src/evm/index.js +10 -0
  86. package/dist/unified/src/evm/index.js.map +1 -0
  87. package/dist/unified/src/evm/mailer-client.d.ts +966 -0
  88. package/dist/unified/src/evm/mailer-client.d.ts.map +1 -0
  89. package/dist/unified/src/evm/mailer-client.js +619 -0
  90. package/dist/unified/src/evm/mailer-client.js.map +1 -0
  91. package/dist/unified/src/react/context/MailerProvider.d.ts +102 -0
  92. package/dist/unified/src/react/context/MailerProvider.d.ts.map +1 -0
  93. package/dist/unified/src/react/context/MailerProvider.js +160 -0
  94. package/dist/unified/src/react/context/MailerProvider.js.map +1 -0
  95. package/dist/unified/src/react/hooks/useMailerMutations.d.ts +301 -0
  96. package/dist/unified/src/react/hooks/useMailerMutations.d.ts.map +1 -0
  97. package/dist/unified/src/react/hooks/useMailerMutations.js +417 -0
  98. package/dist/unified/src/react/hooks/useMailerMutations.js.map +1 -0
  99. package/dist/unified/src/react/hooks/useMailerQueries.d.ts +130 -0
  100. package/dist/unified/src/react/hooks/useMailerQueries.d.ts.map +1 -0
  101. package/dist/unified/src/react/hooks/useMailerQueries.js +197 -0
  102. package/dist/unified/src/react/hooks/useMailerQueries.js.map +1 -0
  103. package/dist/unified/src/react/index.d.ts +37 -0
  104. package/dist/unified/src/react/index.d.ts.map +1 -0
  105. package/dist/unified/src/react/index.js +70 -0
  106. package/dist/unified/src/react/index.js.map +1 -0
  107. package/dist/unified/src/solana/index.d.ts +3 -0
  108. package/dist/unified/src/solana/index.d.ts.map +1 -0
  109. package/dist/unified/src/solana/index.js +21 -0
  110. package/dist/unified/src/solana/index.js.map +1 -0
  111. package/dist/unified/src/solana/mailer-client.d.ts +282 -0
  112. package/dist/unified/src/solana/mailer-client.d.ts.map +1 -0
  113. package/dist/unified/src/solana/mailer-client.js +989 -0
  114. package/dist/unified/src/solana/mailer-client.js.map +1 -0
  115. package/dist/unified/src/solana/types.d.ts +28 -0
  116. package/dist/unified/src/solana/types.d.ts.map +1 -0
  117. package/dist/unified/src/solana/types.js +23 -0
  118. package/dist/unified/src/solana/types.js.map +1 -0
  119. package/dist/unified/src/unified/index.d.ts +4 -0
  120. package/dist/unified/src/unified/index.d.ts.map +1 -0
  121. package/dist/unified/src/unified/index.js +9 -0
  122. package/dist/unified/src/unified/index.js.map +1 -0
  123. package/dist/unified/src/unified/onchain-mailer-client.d.ts +173 -0
  124. package/dist/unified/src/unified/onchain-mailer-client.d.ts.map +1 -0
  125. package/dist/unified/src/unified/onchain-mailer-client.js +1048 -0
  126. package/dist/unified/src/unified/onchain-mailer-client.js.map +1 -0
  127. package/dist/unified/src/unified/types.d.ts +47 -0
  128. package/dist/unified/src/unified/types.d.ts.map +1 -0
  129. package/dist/unified/src/unified/types.js +3 -0
  130. package/dist/unified/src/unified/types.js.map +1 -0
  131. package/dist/unified/src/unified/wallet-detector.d.ts +28 -0
  132. package/dist/unified/src/unified/wallet-detector.d.ts.map +1 -0
  133. package/dist/unified/src/unified/wallet-detector.js +63 -0
  134. package/dist/unified/src/unified/wallet-detector.js.map +1 -0
  135. package/dist/unified/src/utils/chain-config.d.ts +75 -0
  136. package/dist/unified/src/utils/chain-config.d.ts.map +1 -0
  137. package/dist/unified/src/utils/chain-config.js +203 -0
  138. package/dist/unified/src/utils/chain-config.js.map +1 -0
  139. package/dist/unified/src/utils/currency.d.ts +26 -0
  140. package/dist/unified/src/utils/currency.d.ts.map +1 -0
  141. package/dist/unified/src/utils/currency.js +36 -0
  142. package/dist/unified/src/utils/currency.js.map +1 -0
  143. package/dist/unified/src/utils/index.d.ts +4 -0
  144. package/dist/unified/src/utils/index.d.ts.map +1 -0
  145. package/dist/unified/src/utils/index.js +20 -0
  146. package/dist/unified/src/utils/index.js.map +1 -0
  147. package/dist/unified/src/utils/validation.d.ts +10 -0
  148. package/dist/unified/src/utils/validation.d.ts.map +1 -0
  149. package/dist/unified/src/utils/validation.js +102 -0
  150. package/dist/unified/src/utils/validation.js.map +1 -0
  151. package/dist/unified/typechain-types/Mailer.d.ts +698 -0
  152. package/dist/unified/typechain-types/Mailer.d.ts.map +1 -0
  153. package/dist/unified/typechain-types/Mailer.js +3 -0
  154. package/dist/unified/typechain-types/Mailer.js.map +1 -0
  155. package/dist/unified/typechain-types/MockUSDC.d.ts +118 -0
  156. package/dist/unified/typechain-types/MockUSDC.d.ts.map +1 -0
  157. package/dist/unified/typechain-types/MockUSDC.js +3 -0
  158. package/dist/unified/typechain-types/MockUSDC.js.map +1 -0
  159. package/dist/unified/typechain-types/common.d.ts +51 -0
  160. package/dist/unified/typechain-types/common.d.ts.map +1 -0
  161. package/dist/unified/typechain-types/common.js +3 -0
  162. package/dist/unified/typechain-types/common.js.map +1 -0
  163. package/dist/unified/typechain-types/factories/Mailer__factory.d.ts +875 -0
  164. package/dist/unified/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
  165. package/dist/unified/typechain-types/factories/Mailer__factory.js +1125 -0
  166. package/dist/unified/typechain-types/factories/Mailer__factory.js.map +1 -0
  167. package/dist/unified/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
  168. package/dist/unified/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
  169. package/dist/unified/typechain-types/factories/MockUSDC__factory.js +263 -0
  170. package/dist/unified/typechain-types/factories/MockUSDC__factory.js.map +1 -0
  171. package/dist/unified/typechain-types/factories/index.d.ts +4 -0
  172. package/dist/unified/typechain-types/factories/index.d.ts.map +1 -0
  173. package/dist/unified/typechain-types/factories/index.js +45 -0
  174. package/dist/unified/typechain-types/factories/index.js.map +1 -0
  175. package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
  176. package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
  177. package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js +116 -0
  178. package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
  179. package/dist/unified/typechain-types/factories/interfaces/index.d.ts +2 -0
  180. package/dist/unified/typechain-types/factories/interfaces/index.d.ts.map +1 -0
  181. package/dist/unified/typechain-types/factories/interfaces/index.js +9 -0
  182. package/dist/unified/typechain-types/factories/interfaces/index.js.map +1 -0
  183. package/dist/unified/typechain-types/index.d.ts +10 -0
  184. package/dist/unified/typechain-types/index.d.ts.map +1 -0
  185. package/dist/unified/typechain-types/index.js +44 -0
  186. package/dist/unified/typechain-types/index.js.map +1 -0
  187. package/dist/unified/typechain-types/interfaces/IERC20.d.ts +70 -0
  188. package/dist/unified/typechain-types/interfaces/IERC20.d.ts.map +1 -0
  189. package/dist/unified/typechain-types/interfaces/IERC20.js +3 -0
  190. package/dist/unified/typechain-types/interfaces/IERC20.js.map +1 -0
  191. package/dist/unified/typechain-types/interfaces/index.d.ts +2 -0
  192. package/dist/unified/typechain-types/interfaces/index.d.ts.map +1 -0
  193. package/dist/unified/typechain-types/interfaces/index.js +3 -0
  194. package/dist/unified/typechain-types/interfaces/index.js.map +1 -0
  195. package/dist/unified-esm/src/evm/index.d.ts +4 -0
  196. package/dist/unified-esm/src/evm/index.d.ts.map +1 -0
  197. package/dist/unified-esm/src/evm/index.js +5 -0
  198. package/dist/unified-esm/src/evm/index.js.map +1 -0
  199. package/dist/unified-esm/src/evm/mailer-client.d.ts +966 -0
  200. package/dist/unified-esm/src/evm/mailer-client.d.ts.map +1 -0
  201. package/dist/unified-esm/src/evm/mailer-client.js +615 -0
  202. package/dist/unified-esm/src/evm/mailer-client.js.map +1 -0
  203. package/dist/unified-esm/src/react/context/MailerProvider.d.ts +102 -0
  204. package/dist/unified-esm/src/react/context/MailerProvider.d.ts.map +1 -0
  205. package/dist/unified-esm/src/react/context/MailerProvider.js +120 -0
  206. package/dist/unified-esm/src/react/context/MailerProvider.js.map +1 -0
  207. package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts +301 -0
  208. package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts.map +1 -0
  209. package/dist/unified-esm/src/react/hooks/useMailerMutations.js +400 -0
  210. package/dist/unified-esm/src/react/hooks/useMailerMutations.js.map +1 -0
  211. package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts +130 -0
  212. package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts.map +1 -0
  213. package/dist/unified-esm/src/react/hooks/useMailerQueries.js +186 -0
  214. package/dist/unified-esm/src/react/hooks/useMailerQueries.js.map +1 -0
  215. package/dist/unified-esm/src/react/index.d.ts +37 -0
  216. package/dist/unified-esm/src/react/index.d.ts.map +1 -0
  217. package/dist/unified-esm/src/react/index.js +39 -0
  218. package/dist/unified-esm/src/react/index.js.map +1 -0
  219. package/dist/unified-esm/src/solana/index.d.ts +3 -0
  220. package/dist/unified-esm/src/solana/index.d.ts.map +1 -0
  221. package/dist/unified-esm/src/solana/index.js +3 -0
  222. package/dist/unified-esm/src/solana/index.js.map +1 -0
  223. package/dist/unified-esm/src/solana/mailer-client.d.ts +282 -0
  224. package/dist/unified-esm/src/solana/mailer-client.d.ts.map +1 -0
  225. package/dist/unified-esm/src/solana/mailer-client.js +985 -0
  226. package/dist/unified-esm/src/solana/mailer-client.js.map +1 -0
  227. package/dist/unified-esm/src/solana/types.d.ts +28 -0
  228. package/dist/unified-esm/src/solana/types.d.ts.map +1 -0
  229. package/dist/unified-esm/src/solana/types.js +16 -0
  230. package/dist/unified-esm/src/solana/types.js.map +1 -0
  231. package/dist/unified-esm/src/unified/index.d.ts +4 -0
  232. package/dist/unified-esm/src/unified/index.d.ts.map +1 -0
  233. package/dist/unified-esm/src/unified/index.js +4 -0
  234. package/dist/unified-esm/src/unified/index.js.map +1 -0
  235. package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts +173 -0
  236. package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts.map +1 -0
  237. package/dist/unified-esm/src/unified/onchain-mailer-client.js +1011 -0
  238. package/dist/unified-esm/src/unified/onchain-mailer-client.js.map +1 -0
  239. package/dist/unified-esm/src/unified/types.d.ts +47 -0
  240. package/dist/unified-esm/src/unified/types.d.ts.map +1 -0
  241. package/dist/unified-esm/src/unified/types.js +2 -0
  242. package/dist/unified-esm/src/unified/types.js.map +1 -0
  243. package/dist/unified-esm/src/unified/wallet-detector.d.ts +28 -0
  244. package/dist/unified-esm/src/unified/wallet-detector.d.ts.map +1 -0
  245. package/dist/unified-esm/src/unified/wallet-detector.js +59 -0
  246. package/dist/unified-esm/src/unified/wallet-detector.js.map +1 -0
  247. package/dist/unified-esm/src/utils/chain-config.d.ts +75 -0
  248. package/dist/unified-esm/src/utils/chain-config.d.ts.map +1 -0
  249. package/dist/unified-esm/src/utils/chain-config.js +199 -0
  250. package/dist/unified-esm/src/utils/chain-config.js.map +1 -0
  251. package/dist/unified-esm/src/utils/currency.d.ts +26 -0
  252. package/dist/unified-esm/src/utils/currency.d.ts.map +1 -0
  253. package/dist/unified-esm/src/utils/currency.js +31 -0
  254. package/dist/unified-esm/src/utils/currency.js.map +1 -0
  255. package/dist/unified-esm/src/utils/index.d.ts +4 -0
  256. package/dist/unified-esm/src/utils/index.d.ts.map +1 -0
  257. package/dist/unified-esm/src/utils/index.js +4 -0
  258. package/dist/unified-esm/src/utils/index.js.map +1 -0
  259. package/dist/unified-esm/src/utils/validation.d.ts +10 -0
  260. package/dist/unified-esm/src/utils/validation.d.ts.map +1 -0
  261. package/dist/unified-esm/src/utils/validation.js +96 -0
  262. package/dist/unified-esm/src/utils/validation.js.map +1 -0
  263. package/dist/unified-esm/typechain-types/Mailer.d.ts +698 -0
  264. package/dist/unified-esm/typechain-types/Mailer.d.ts.map +1 -0
  265. package/dist/unified-esm/typechain-types/Mailer.js +2 -0
  266. package/dist/unified-esm/typechain-types/Mailer.js.map +1 -0
  267. package/dist/unified-esm/typechain-types/MockUSDC.d.ts +118 -0
  268. package/dist/unified-esm/typechain-types/MockUSDC.d.ts.map +1 -0
  269. package/dist/unified-esm/typechain-types/MockUSDC.js +2 -0
  270. package/dist/unified-esm/typechain-types/MockUSDC.js.map +1 -0
  271. package/dist/unified-esm/typechain-types/common.d.ts +51 -0
  272. package/dist/unified-esm/typechain-types/common.d.ts.map +1 -0
  273. package/dist/unified-esm/typechain-types/common.js +2 -0
  274. package/dist/unified-esm/typechain-types/common.js.map +1 -0
  275. package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts +875 -0
  276. package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts.map +1 -0
  277. package/dist/unified-esm/typechain-types/factories/Mailer__factory.js +1121 -0
  278. package/dist/unified-esm/typechain-types/factories/Mailer__factory.js.map +1 -0
  279. package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts +193 -0
  280. package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts.map +1 -0
  281. package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js +259 -0
  282. package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js.map +1 -0
  283. package/dist/unified-esm/typechain-types/factories/index.d.ts +4 -0
  284. package/dist/unified-esm/typechain-types/factories/index.d.ts.map +1 -0
  285. package/dist/unified-esm/typechain-types/factories/index.js +7 -0
  286. package/dist/unified-esm/typechain-types/factories/index.js.map +1 -0
  287. package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts +80 -0
  288. package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +1 -0
  289. package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js +112 -0
  290. package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -0
  291. package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts +2 -0
  292. package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts.map +1 -0
  293. package/dist/unified-esm/typechain-types/factories/interfaces/index.js +5 -0
  294. package/dist/unified-esm/typechain-types/factories/interfaces/index.js.map +1 -0
  295. package/dist/unified-esm/typechain-types/index.d.ts +10 -0
  296. package/dist/unified-esm/typechain-types/index.d.ts.map +1 -0
  297. package/dist/unified-esm/typechain-types/index.js +5 -0
  298. package/dist/unified-esm/typechain-types/index.js.map +1 -0
  299. package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts +70 -0
  300. package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts.map +1 -0
  301. package/dist/unified-esm/typechain-types/interfaces/IERC20.js +2 -0
  302. package/dist/unified-esm/typechain-types/interfaces/IERC20.js.map +1 -0
  303. package/dist/unified-esm/typechain-types/interfaces/index.d.ts +2 -0
  304. package/dist/unified-esm/typechain-types/interfaces/index.d.ts.map +1 -0
  305. package/dist/unified-esm/typechain-types/interfaces/index.js +2 -0
  306. package/dist/unified-esm/typechain-types/interfaces/index.js.map +1 -0
  307. package/package.json +250 -0
  308. package/programs/mailer/Cargo.toml +29 -0
  309. package/programs/mailer/src/lib.rs +2034 -0
  310. package/programs/mailer/tests/integration_tests.rs +1236 -0
  311. package/typechain-types/Mailer.ts +1393 -0
  312. package/typechain-types/MockUSDC.ts +236 -0
  313. package/typechain-types/common.ts +131 -0
  314. package/typechain-types/factories/Mailer__factory.ts +1157 -0
  315. package/typechain-types/factories/MockUSDC__factory.ts +284 -0
  316. package/typechain-types/factories/index.ts +6 -0
  317. package/typechain-types/factories/interfaces/IERC20__factory.ts +115 -0
  318. package/typechain-types/factories/interfaces/index.ts +4 -0
  319. package/typechain-types/hardhat.d.ts +99 -0
  320. package/typechain-types/index.ts +12 -0
  321. package/typechain-types/interfaces/IERC20.ts +148 -0
  322. package/typechain-types/interfaces/index.ts +4 -0
@@ -0,0 +1,417 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSendMessage = useSendMessage;
4
+ exports.useSendPrepared = useSendPrepared;
5
+ exports.useSendToEmail = useSendToEmail;
6
+ exports.useSendPreparedToEmail = useSendPreparedToEmail;
7
+ exports.useClaimRevenue = useClaimRevenue;
8
+ exports.useClaimOwnerShare = useClaimOwnerShare;
9
+ exports.useClaimExpiredShares = useClaimExpiredShares;
10
+ exports.useDelegateTo = useDelegateTo;
11
+ exports.useRejectDelegation = useRejectDelegation;
12
+ exports.useSetFee = useSetFee;
13
+ exports.useSetDelegationFee = useSetDelegationFee;
14
+ exports.usePause = usePause;
15
+ exports.useUnpause = useUnpause;
16
+ exports.useEmergencyUnpause = useEmergencyUnpause;
17
+ exports.useDistributeClaimableFunds = useDistributeClaimableFunds;
18
+ const react_query_1 = require("@tanstack/react-query");
19
+ const MailerProvider_1 = require("../context/MailerProvider");
20
+ const useMailerQueries_1 = require("./useMailerQueries");
21
+ /**
22
+ * Hook to send a message
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * function SendMessageForm() {
27
+ * const sendMessage = useSendMessage();
28
+ *
29
+ * const handleSend = () => {
30
+ * sendMessage.mutate({
31
+ * subject: 'Hello',
32
+ * body: 'World!',
33
+ * priority: true,
34
+ * resolveSenderToName: false
35
+ * });
36
+ * };
37
+ *
38
+ * return (
39
+ * <button onClick={handleSend} disabled={sendMessage.isPending}>
40
+ * {sendMessage.isPending ? 'Sending...' : 'Send Message'}
41
+ * </button>
42
+ * );
43
+ * }
44
+ * ```
45
+ */
46
+ function useSendMessage(options) {
47
+ const client = (0, MailerProvider_1.useMailerClient)();
48
+ const queryClient = (0, react_query_1.useQueryClient)();
49
+ return (0, react_query_1.useMutation)({
50
+ mutationFn: async ({ subject, body, priority = false, resolveSenderToName = false }) => client.sendMessage(subject, body, priority, resolveSenderToName),
51
+ onSuccess: () => {
52
+ // Invalidate claimable amounts as sending affects balances
53
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.claimableAmount() });
54
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
55
+ },
56
+ ...options,
57
+ });
58
+ }
59
+ /**
60
+ * Hook to send a prepared message
61
+ *
62
+ * @example
63
+ * ```tsx
64
+ * function SendPreparedButton() {
65
+ * const sendPrepared = useSendPrepared();
66
+ *
67
+ * return (
68
+ * <button
69
+ * onClick={() => sendPrepared.mutate({
70
+ * to: '0x123...',
71
+ * mailId: 'template-001',
72
+ * priority: true
73
+ * })}
74
+ * disabled={sendPrepared.isPending}
75
+ * >
76
+ * Send Prepared
77
+ * </button>
78
+ * );
79
+ * }
80
+ * ```
81
+ */
82
+ function useSendPrepared(options) {
83
+ const client = (0, MailerProvider_1.useMailerClient)();
84
+ const queryClient = (0, react_query_1.useQueryClient)();
85
+ return (0, react_query_1.useMutation)({
86
+ mutationFn: async ({ to, mailId, priority = false, resolveSenderToName = false }) => client.sendPrepared(to, mailId, priority, resolveSenderToName),
87
+ onSuccess: () => {
88
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.claimableAmount() });
89
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
90
+ },
91
+ ...options,
92
+ });
93
+ }
94
+ /**
95
+ * Hook to send message to email address
96
+ *
97
+ * @example
98
+ * ```tsx
99
+ * function SendToEmailForm() {
100
+ * const sendToEmail = useSendToEmail();
101
+ *
102
+ * return (
103
+ * <button
104
+ * onClick={() => sendToEmail.mutate({
105
+ * toEmail: 'user@example.com',
106
+ * subject: 'Hello',
107
+ * body: 'Welcome!'
108
+ * })}
109
+ * >
110
+ * Send to Email
111
+ * </button>
112
+ * );
113
+ * }
114
+ * ```
115
+ */
116
+ function useSendToEmail(options) {
117
+ const client = (0, MailerProvider_1.useMailerClient)();
118
+ const queryClient = (0, react_query_1.useQueryClient)();
119
+ return (0, react_query_1.useMutation)({
120
+ mutationFn: async ({ toEmail, subject, body }) => client.sendToEmail(toEmail, subject, body),
121
+ onSuccess: () => {
122
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
123
+ },
124
+ ...options,
125
+ });
126
+ }
127
+ /**
128
+ * Hook to send prepared message to email address
129
+ */
130
+ function useSendPreparedToEmail(options) {
131
+ const client = (0, MailerProvider_1.useMailerClient)();
132
+ const queryClient = (0, react_query_1.useQueryClient)();
133
+ return (0, react_query_1.useMutation)({
134
+ mutationFn: async ({ toEmail, mailId }) => client.sendPreparedToEmail(toEmail, mailId),
135
+ onSuccess: () => {
136
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
137
+ },
138
+ ...options,
139
+ });
140
+ }
141
+ /**
142
+ * Hook to claim revenue share
143
+ *
144
+ * @example
145
+ * ```tsx
146
+ * function ClaimButton() {
147
+ * const { data: claimable } = useGetClaimableAmount();
148
+ * const claimRevenue = useClaimRevenue();
149
+ *
150
+ * if (!claimable || claimable === 0n) return null;
151
+ *
152
+ * return (
153
+ * <button
154
+ * onClick={() => claimRevenue.mutate()}
155
+ * disabled={claimRevenue.isPending}
156
+ * >
157
+ * Claim {Number(claimable) / 1_000_000} USDC
158
+ * </button>
159
+ * );
160
+ * }
161
+ * ```
162
+ */
163
+ function useClaimRevenue(options) {
164
+ const client = (0, MailerProvider_1.useMailerClient)();
165
+ const queryClient = (0, react_query_1.useQueryClient)();
166
+ return (0, react_query_1.useMutation)({
167
+ mutationFn: () => client.claimRevenue(),
168
+ onSuccess: () => {
169
+ // Invalidate claimable amount after successful claim
170
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.claimableAmount() });
171
+ },
172
+ ...options,
173
+ });
174
+ }
175
+ /**
176
+ * Hook to claim owner share (owner only)
177
+ *
178
+ * @example
179
+ * ```tsx
180
+ * function OwnerClaimButton() {
181
+ * const { data: ownerClaimable } = useGetOwnerClaimable();
182
+ * const claimOwner = useClaimOwnerShare();
183
+ *
184
+ * return (
185
+ * <button onClick={() => claimOwner.mutate()}>
186
+ * Claim Owner Fees: {Number(ownerClaimable) / 1_000_000} USDC
187
+ * </button>
188
+ * );
189
+ * }
190
+ * ```
191
+ */
192
+ function useClaimOwnerShare(options) {
193
+ const client = (0, MailerProvider_1.useMailerClient)();
194
+ const queryClient = (0, react_query_1.useQueryClient)();
195
+ return (0, react_query_1.useMutation)({
196
+ mutationFn: () => client.claimOwnerShare(),
197
+ onSuccess: () => {
198
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
199
+ },
200
+ ...options,
201
+ });
202
+ }
203
+ /**
204
+ * Hook to reclaim expired recipient shares (owner only)
205
+ */
206
+ function useClaimExpiredShares(options) {
207
+ const client = (0, MailerProvider_1.useMailerClient)();
208
+ const queryClient = (0, react_query_1.useQueryClient)();
209
+ return (0, react_query_1.useMutation)({
210
+ mutationFn: async ({ recipient }) => client.claimExpiredShares(recipient),
211
+ onSuccess: (_, variables) => {
212
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.claimableAmount(variables.recipient) });
213
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
214
+ },
215
+ ...options,
216
+ });
217
+ }
218
+ /**
219
+ * Hook to delegate to another address
220
+ *
221
+ * @example
222
+ * ```tsx
223
+ * function DelegateButton() {
224
+ * const delegate = useDelegateTo();
225
+ *
226
+ * return (
227
+ * <button
228
+ * onClick={() => delegate.mutate({ delegate: '0xABC...' })}
229
+ * disabled={delegate.isPending}
230
+ * >
231
+ * Delegate
232
+ * </button>
233
+ * );
234
+ * }
235
+ * ```
236
+ */
237
+ function useDelegateTo(options) {
238
+ const client = (0, MailerProvider_1.useMailerClient)();
239
+ const queryClient = (0, react_query_1.useQueryClient)();
240
+ return (0, react_query_1.useMutation)({
241
+ mutationFn: async ({ delegate }) => client.delegateTo(delegate),
242
+ onSuccess: () => {
243
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.delegation() });
244
+ },
245
+ ...options,
246
+ });
247
+ }
248
+ /**
249
+ * Hook to reject a delegation made to you
250
+ *
251
+ * @example
252
+ * ```tsx
253
+ * function RejectDelegationButton({ delegatorAddress }: { delegatorAddress: string }) {
254
+ * const rejectDelegation = useRejectDelegation();
255
+ *
256
+ * return (
257
+ * <button
258
+ * onClick={() => rejectDelegation.mutate({ delegatorAddress })}
259
+ * >
260
+ * Reject Delegation
261
+ * </button>
262
+ * );
263
+ * }
264
+ * ```
265
+ */
266
+ function useRejectDelegation(options) {
267
+ const client = (0, MailerProvider_1.useMailerClient)();
268
+ const queryClient = (0, react_query_1.useQueryClient)();
269
+ return (0, react_query_1.useMutation)({
270
+ mutationFn: async ({ delegatorAddress }) => client.rejectDelegation(delegatorAddress),
271
+ onSuccess: () => {
272
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.delegation() });
273
+ },
274
+ ...options,
275
+ });
276
+ }
277
+ /**
278
+ * Hook to set send fee (owner only)
279
+ *
280
+ * @example
281
+ * ```tsx
282
+ * function SetFeeForm() {
283
+ * const setFee = useSetFee();
284
+ *
285
+ * return (
286
+ * <button onClick={() => setFee.mutate({ newFee: 200000n })}>
287
+ * Update Fee to 0.2 USDC
288
+ * </button>
289
+ * );
290
+ * }
291
+ * ```
292
+ */
293
+ function useSetFee(options) {
294
+ const client = (0, MailerProvider_1.useMailerClient)();
295
+ const queryClient = (0, react_query_1.useQueryClient)();
296
+ return (0, react_query_1.useMutation)({
297
+ mutationFn: async ({ newFee }) => client.setFee(newFee),
298
+ onSuccess: () => {
299
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.sendFee() });
300
+ },
301
+ ...options,
302
+ });
303
+ }
304
+ /**
305
+ * Hook to set delegation fee (owner only)
306
+ */
307
+ function useSetDelegationFee(options) {
308
+ const client = (0, MailerProvider_1.useMailerClient)();
309
+ const queryClient = (0, react_query_1.useQueryClient)();
310
+ return (0, react_query_1.useMutation)({
311
+ mutationFn: async ({ newFee }) => client.setDelegationFee(newFee),
312
+ onSuccess: () => {
313
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.delegationFee() });
314
+ },
315
+ ...options,
316
+ });
317
+ }
318
+ /**
319
+ * Hook to pause the contract (owner only)
320
+ *
321
+ * @example
322
+ * ```tsx
323
+ * function PauseButton() {
324
+ * const pause = usePause();
325
+ *
326
+ * return (
327
+ * <button
328
+ * onClick={() => pause.mutate()}
329
+ * disabled={pause.isPending}
330
+ * >
331
+ * Pause Contract
332
+ * </button>
333
+ * );
334
+ * }
335
+ * ```
336
+ */
337
+ function usePause(options) {
338
+ const client = (0, MailerProvider_1.useMailerClient)();
339
+ const queryClient = (0, react_query_1.useQueryClient)();
340
+ return (0, react_query_1.useMutation)({
341
+ mutationFn: () => client.pause(),
342
+ onSuccess: () => {
343
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.isPaused() });
344
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.ownerClaimable() });
345
+ },
346
+ ...options,
347
+ });
348
+ }
349
+ /**
350
+ * Hook to unpause the contract (owner only)
351
+ *
352
+ * @example
353
+ * ```tsx
354
+ * function UnpauseButton() {
355
+ * const unpause = useUnpause();
356
+ *
357
+ * return (
358
+ * <button onClick={() => unpause.mutate()}>
359
+ * Unpause Contract
360
+ * </button>
361
+ * );
362
+ * }
363
+ * ```
364
+ */
365
+ function useUnpause(options) {
366
+ const client = (0, MailerProvider_1.useMailerClient)();
367
+ const queryClient = (0, react_query_1.useQueryClient)();
368
+ return (0, react_query_1.useMutation)({
369
+ mutationFn: () => client.unpause(),
370
+ onSuccess: () => {
371
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.isPaused() });
372
+ },
373
+ ...options,
374
+ });
375
+ }
376
+ /**
377
+ * Hook to emergency unpause (owner only)
378
+ */
379
+ function useEmergencyUnpause(options) {
380
+ const client = (0, MailerProvider_1.useMailerClient)();
381
+ const queryClient = (0, react_query_1.useQueryClient)();
382
+ return (0, react_query_1.useMutation)({
383
+ mutationFn: () => client.emergencyUnpause(),
384
+ onSuccess: () => {
385
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.isPaused() });
386
+ },
387
+ ...options,
388
+ });
389
+ }
390
+ /**
391
+ * Hook to distribute claimable funds (anyone can call when paused)
392
+ *
393
+ * @example
394
+ * ```tsx
395
+ * function DistributeFundsButton({ recipient }: { recipient: string }) {
396
+ * const distribute = useDistributeClaimableFunds();
397
+ *
398
+ * return (
399
+ * <button onClick={() => distribute.mutate({ recipient })}>
400
+ * Distribute Funds to {recipient}
401
+ * </button>
402
+ * );
403
+ * }
404
+ * ```
405
+ */
406
+ function useDistributeClaimableFunds(options) {
407
+ const client = (0, MailerProvider_1.useMailerClient)();
408
+ const queryClient = (0, react_query_1.useQueryClient)();
409
+ return (0, react_query_1.useMutation)({
410
+ mutationFn: async ({ recipient }) => client.distributeClaimableFunds(recipient),
411
+ onSuccess: (_, variables) => {
412
+ queryClient.invalidateQueries({ queryKey: useMailerQueries_1.mailerQueryKeys.claimableAmount(variables.recipient) });
413
+ },
414
+ ...options,
415
+ });
416
+ }
417
+ //# sourceMappingURL=useMailerMutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMailerMutations.js","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerMutations.ts"],"names":[],"mappings":";;AA8BA,wCAwBC;AAyBD,0CAuBC;AAwBD,wCAiBC;AAKD,wDAaC;AAwBD,0CAcC;AAmBD,gDAaC;AAKD,sDAcC;AAqBD,sCAaC;AAoBD,kDAaC;AAkBD,8BAaC;AAKD,kDAaC;AAqBD,4BAcC;AAkBD,gCAaC;AAKD,kDAaC;AAkBD,kEAaC;AAjeD,uDAA2G;AAC3G,8DAA4D;AAC5D,yDAAqD;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,cAAc,CAC5B,OAIC;IAMD,MAAM,MAAM,GAAG,IAAA,gCAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IAErC,OAAO,IAAA,yBAAW,EAAC;QACjB,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,mBAAmB,GAAG,KAAK,EAAE,EAAE,EAAE,CACrF,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,CAAC;QAClE,SAAS,EAAE,GAAG,EAAE;YACd,2DAA2D;YAC3D,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,kCAAe,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YAC/E,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,kCAAe,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAChF,CAAC;QACD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MAAM,MAAM,GAAG,IAAA,gCAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IAErC,OAAO,IAAA,yBAAW,EAAC;QACjB,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE;QAC3C,SAAS,EAAE,GAAG,EAAE;YACd,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,kCAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,2BAA2B,CACzC,OAA8E;IAE9E,MAAM,MAAM,GAAG,IAAA,gCAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IAErC,OAAO,IAAA,yBAAW,EAAC;QACjB,UAAU,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC;QAC/E,SAAS,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE;YAC1B,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,kCAAe,CAAC,eAAe,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACpG,CAAC;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
+ /**
3
+ * Query keys for React Query cache management
4
+ */
5
+ export declare const mailerQueryKeys: {
6
+ all: readonly ["mailer"];
7
+ sendFee: () => readonly ["mailer", "sendFee"];
8
+ delegationFee: () => readonly ["mailer", "delegationFee"];
9
+ claimableAmount: (address?: string) => readonly ["mailer", "claimableAmount", string | undefined];
10
+ ownerClaimable: () => readonly ["mailer", "ownerClaimable"];
11
+ delegation: (address?: string) => readonly ["mailer", "delegation", string | undefined];
12
+ isPaused: () => readonly ["mailer", "isPaused"];
13
+ };
14
+ /**
15
+ * Hook to get the current send fee
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * function FeeDisplay() {
20
+ * const { data: fee, isLoading } = useGetSendFee();
21
+ *
22
+ * if (isLoading) return <div>Loading...</div>;
23
+ * return <div>Send Fee: {Number(fee) / 1_000_000} USDC</div>;
24
+ * }
25
+ * ```
26
+ */
27
+ export declare function useGetSendFee(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
28
+ /**
29
+ * Hook to get the current delegation fee
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * function DelegationFeeDisplay() {
34
+ * const { data: fee, isLoading } = useGetDelegationFee();
35
+ *
36
+ * if (isLoading) return <div>Loading...</div>;
37
+ * return <div>Delegation Fee: {Number(fee) / 1_000_000} USDC</div>;
38
+ * }
39
+ * ```
40
+ */
41
+ export declare function useGetDelegationFee(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
42
+ /**
43
+ * Hook to get claimable amount for an address
44
+ *
45
+ * @param address - Address to check (defaults to connected wallet)
46
+ * @example
47
+ * ```tsx
48
+ * function ClaimableBalance() {
49
+ * const { data: amount, isLoading } = useGetClaimableAmount();
50
+ *
51
+ * if (isLoading) return <div>Loading...</div>;
52
+ * if (!amount || amount === 0n) return <div>No claimable balance</div>;
53
+ * return <div>Claimable: {Number(amount) / 1_000_000} USDC</div>;
54
+ * }
55
+ * ```
56
+ */
57
+ export declare function useGetClaimableAmount(address?: string, options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
58
+ /**
59
+ * Hook to get owner's claimable fee balance
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * function OwnerDashboard() {
64
+ * const { data: amount, isLoading } = useGetOwnerClaimable();
65
+ *
66
+ * if (isLoading) return <div>Loading...</div>;
67
+ * return <div>Owner Fees: {Number(amount) / 1_000_000} USDC</div>;
68
+ * }
69
+ * ```
70
+ */
71
+ export declare function useGetOwnerClaimable(options?: Omit<UseQueryOptions<bigint, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<bigint, Error>;
72
+ /**
73
+ * Hook to get delegation information for an address
74
+ *
75
+ * @param address - Address to check delegation for (defaults to connected wallet)
76
+ * @example
77
+ * ```tsx
78
+ * function DelegationStatus() {
79
+ * const { data: delegate, isLoading } = useGetDelegation();
80
+ *
81
+ * if (isLoading) return <div>Loading...</div>;
82
+ * if (!delegate) return <div>No delegation set</div>;
83
+ * return <div>Delegated to: {delegate}</div>;
84
+ * }
85
+ * ```
86
+ */
87
+ export declare function useGetDelegation(address?: string, options?: Omit<UseQueryOptions<string | null, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<string | null, Error>;
88
+ /**
89
+ * Hook to check if contract is currently paused
90
+ *
91
+ * @example
92
+ * ```tsx
93
+ * function PauseStatus() {
94
+ * const { data: isPaused, isLoading } = useIsPaused();
95
+ *
96
+ * if (isLoading) return <div>Loading...</div>;
97
+ * return (
98
+ * <div>
99
+ * Contract Status: {isPaused ? '⏸️ Paused' : '✅ Active'}
100
+ * </div>
101
+ * );
102
+ * }
103
+ * ```
104
+ */
105
+ export declare function useIsPaused(options?: Omit<UseQueryOptions<boolean, Error>, 'queryKey' | 'queryFn'>): UseQueryResult<boolean, Error>;
106
+ /**
107
+ * Hook to get wallet address from the client
108
+ *
109
+ * @example
110
+ * ```tsx
111
+ * function WalletAddress() {
112
+ * const address = useWalletAddress();
113
+ * return <div>Connected: {address}</div>;
114
+ * }
115
+ * ```
116
+ */
117
+ export declare function useWalletAddress(): string;
118
+ /**
119
+ * Hook to get chain type (EVM or Solana)
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * function ChainBadge() {
124
+ * const chainType = useChainType();
125
+ * return <div>Chain: {chainType}</div>;
126
+ * }
127
+ * ```
128
+ */
129
+ export declare function useChainType(): import("@sudobility/types").ChainType;
130
+ //# sourceMappingURL=useMailerQueries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMailerQueries.d.ts","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGlF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;gCAIE,MAAM;;2BAEX,MAAM;;CAE9B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GACrE,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAS/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,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