@andrewkimjoseph/celina-sdk 0.15.1 → 0.15.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 (361) hide show
  1. package/build/config/celina-tag.d.ts +5 -0
  2. package/build/config/celina-tag.js +67 -3
  3. package/build/config/celina-tag.js.map +1 -1
  4. package/build/index.d.ts +1 -1
  5. package/build/index.js +1 -1
  6. package/build/index.js.map +1 -1
  7. package/build/src/a2a/agent-card.d.ts +37 -0
  8. package/build/src/a2a/agent-card.js +46 -0
  9. package/build/src/a2a/agent-card.js.map +1 -0
  10. package/build/src/a2a/index.d.ts +2 -0
  11. package/build/src/a2a/index.js +3 -0
  12. package/build/src/a2a/index.js.map +1 -0
  13. package/build/src/a2a/skills.d.ts +18 -0
  14. package/build/src/a2a/skills.js +106 -0
  15. package/build/src/a2a/skills.js.map +1 -0
  16. package/build/src/aa/create-aa-client.d.ts +44 -0
  17. package/build/src/aa/create-aa-client.js +115 -0
  18. package/build/src/aa/create-aa-client.js.map +1 -0
  19. package/build/src/aa/gas-sponsorship.d.ts +27 -0
  20. package/build/src/aa/gas-sponsorship.js +65 -0
  21. package/build/src/aa/gas-sponsorship.js.map +1 -0
  22. package/build/src/aa/index.d.ts +4 -0
  23. package/build/src/aa/index.js +4 -0
  24. package/build/src/aa/index.js.map +1 -0
  25. package/build/src/aa/prepared-calls.d.ts +8 -0
  26. package/build/src/aa/prepared-calls.js +27 -0
  27. package/build/src/aa/prepared-calls.js.map +1 -0
  28. package/build/src/aa/types.d.ts +61 -0
  29. package/build/src/aa/types.js +2 -0
  30. package/build/src/aa/types.js.map +1 -0
  31. package/build/src/abis/aave-pool.d.ts +37 -0
  32. package/build/src/abis/aave-pool.js +26 -0
  33. package/build/src/abis/aave-pool.js.map +1 -0
  34. package/build/src/abis/accounts.d.ts +13 -0
  35. package/build/src/abis/accounts.js +10 -0
  36. package/build/src/abis/accounts.js.map +1 -0
  37. package/build/src/abis/election.d.ts +124 -0
  38. package/build/src/abis/election.js +88 -0
  39. package/build/src/abis/election.js.map +1 -0
  40. package/build/src/abis/gooddollar-broker.d.ts +77 -0
  41. package/build/src/abis/gooddollar-broker.js +44 -0
  42. package/build/src/abis/gooddollar-broker.js.map +1 -0
  43. package/build/src/abis/gooddollar-identity.d.ts +85 -0
  44. package/build/src/abis/gooddollar-identity.js +52 -0
  45. package/build/src/abis/gooddollar-identity.js.map +1 -0
  46. package/build/src/abis/governance.d.ts +86 -0
  47. package/build/src/abis/governance.js +68 -0
  48. package/build/src/abis/governance.js.map +1 -0
  49. package/build/src/abis/locked-gold.d.ts +10 -0
  50. package/build/src/abis/locked-gold.js +10 -0
  51. package/build/src/abis/locked-gold.js.map +1 -0
  52. package/build/src/abis/nft.d.ts +107 -0
  53. package/build/src/abis/nft.js +75 -0
  54. package/build/src/abis/nft.js.map +1 -0
  55. package/build/src/abis/permit2.d.ts +43 -0
  56. package/build/src/abis/permit2.js +30 -0
  57. package/build/src/abis/permit2.js.map +1 -0
  58. package/build/src/abis/self-registry.d.ts +194 -0
  59. package/build/src/abis/self-registry.js +120 -0
  60. package/build/src/abis/self-registry.js.map +1 -0
  61. package/build/src/abis/ubi-scheme.d.ts +91 -0
  62. package/build/src/abis/ubi-scheme.js +66 -0
  63. package/build/src/abis/ubi-scheme.js.map +1 -0
  64. package/build/src/abis/uniswap-state-view.d.ts +34 -0
  65. package/build/src/abis/uniswap-state-view.js +22 -0
  66. package/build/src/abis/uniswap-state-view.js.map +1 -0
  67. package/build/src/abis/uniswap-v4-quoter.d.ts +86 -0
  68. package/build/src/abis/uniswap-v4-quoter.js +64 -0
  69. package/build/src/abis/uniswap-v4-quoter.js.map +1 -0
  70. package/build/src/abis/universal-router.d.ts +16 -0
  71. package/build/src/abis/universal-router.js +14 -0
  72. package/build/src/abis/universal-router.js.map +1 -0
  73. package/build/src/abis/validators-minimal.d.ts +65 -0
  74. package/build/src/abis/validators-minimal.js +39 -0
  75. package/build/src/abis/validators-minimal.js.map +1 -0
  76. package/build/src/analytics/amplitude.d.ts +11 -0
  77. package/build/src/analytics/amplitude.js +76 -0
  78. package/build/src/analytics/amplitude.js.map +1 -0
  79. package/build/src/analytics/config.d.ts +7 -0
  80. package/build/src/analytics/config.js +25 -0
  81. package/build/src/analytics/config.js.map +1 -0
  82. package/build/src/analytics/consumer-package.d.ts +9 -0
  83. package/build/src/analytics/consumer-package.js +143 -0
  84. package/build/src/analytics/consumer-package.js.map +1 -0
  85. package/build/src/analytics/mcp-tool-events.d.ts +5 -0
  86. package/build/src/analytics/mcp-tool-events.js +53 -0
  87. package/build/src/analytics/mcp-tool-events.js.map +1 -0
  88. package/build/src/analytics/wallet-context.d.ts +11 -0
  89. package/build/src/analytics/wallet-context.js +81 -0
  90. package/build/src/analytics/wallet-context.js.map +1 -0
  91. package/build/src/analytics/wallet-extract.d.ts +9 -0
  92. package/build/src/analytics/wallet-extract.js +21 -0
  93. package/build/src/analytics/wallet-extract.js.map +1 -0
  94. package/build/src/analytics/wrap-service.d.ts +5 -0
  95. package/build/src/analytics/wrap-service.js +38 -0
  96. package/build/src/analytics/wrap-service.js.map +1 -0
  97. package/build/src/clients/celo-client.d.ts +19 -0
  98. package/build/src/clients/celo-client.js +32 -0
  99. package/build/src/clients/celo-client.js.map +1 -0
  100. package/build/src/clients/ens-client.d.ts +17 -0
  101. package/build/src/clients/ens-client.js +30 -0
  102. package/build/src/clients/ens-client.js.map +1 -0
  103. package/build/src/clients/mento-sdk.d.ts +2 -0
  104. package/build/src/clients/mento-sdk.js +9 -0
  105. package/build/src/clients/mento-sdk.js.map +1 -0
  106. package/build/src/clients/self-api.d.ts +82 -0
  107. package/build/src/clients/self-api.js +242 -0
  108. package/build/src/clients/self-api.js.map +1 -0
  109. package/build/src/clients/uniswap-sdk.d.ts +4 -0
  110. package/build/src/clients/uniswap-sdk.js +13 -0
  111. package/build/src/clients/uniswap-sdk.js.map +1 -0
  112. package/build/src/config/aave.d.ts +17 -0
  113. package/build/src/config/aave.js +77 -0
  114. package/build/src/config/aave.js.map +1 -0
  115. package/build/src/config/celina-tag.d.ts +55 -0
  116. package/build/src/config/celina-tag.js +234 -0
  117. package/build/src/config/celina-tag.js.map +1 -0
  118. package/build/src/config/celo-core-contracts.d.ts +8 -0
  119. package/build/src/config/celo-core-contracts.js +9 -0
  120. package/build/src/config/celo-core-contracts.js.map +1 -0
  121. package/build/src/config/chains.d.ts +937 -0
  122. package/build/src/config/chains.js +319 -0
  123. package/build/src/config/chains.js.map +1 -0
  124. package/build/src/config/gooddollar.d.ts +16 -0
  125. package/build/src/config/gooddollar.js +24 -0
  126. package/build/src/config/gooddollar.js.map +1 -0
  127. package/build/src/config/sdk-config.d.ts +44 -0
  128. package/build/src/config/sdk-config.js +28 -0
  129. package/build/src/config/sdk-config.js.map +1 -0
  130. package/build/src/config/self.d.ts +22 -0
  131. package/build/src/config/self.js +27 -0
  132. package/build/src/config/self.js.map +1 -0
  133. package/build/src/config/uniswap.d.ts +42 -0
  134. package/build/src/config/uniswap.js +76 -0
  135. package/build/src/config/uniswap.js.map +1 -0
  136. package/build/src/index.d.ts +127 -0
  137. package/build/src/index.js +72 -0
  138. package/build/src/index.js.map +1 -0
  139. package/build/src/oasf/index.d.ts +2 -0
  140. package/build/src/oasf/index.js +3 -0
  141. package/build/src/oasf/index.js.map +1 -0
  142. package/build/src/oasf/record.d.ts +39 -0
  143. package/build/src/oasf/record.js +35 -0
  144. package/build/src/oasf/record.js.map +1 -0
  145. package/build/src/oasf/taxonomy.d.ts +19 -0
  146. package/build/src/oasf/taxonomy.js +46 -0
  147. package/build/src/oasf/taxonomy.js.map +1 -0
  148. package/build/src/services/aave.service.d.ts +59 -0
  149. package/build/src/services/aave.service.js +210 -0
  150. package/build/src/services/aave.service.js.map +1 -0
  151. package/build/src/services/account.service.d.ts +22 -0
  152. package/build/src/services/account.service.js +29 -0
  153. package/build/src/services/account.service.js.map +1 -0
  154. package/build/src/services/agentkarma.service.d.ts +89 -0
  155. package/build/src/services/agentkarma.service.js +102 -0
  156. package/build/src/services/agentkarma.service.js.map +1 -0
  157. package/build/src/services/blockchain.service.d.ts +126 -0
  158. package/build/src/services/blockchain.service.js +188 -0
  159. package/build/src/services/blockchain.service.js.map +1 -0
  160. package/build/src/services/contract.service.d.ts +78 -0
  161. package/build/src/services/contract.service.js +117 -0
  162. package/build/src/services/contract.service.js.map +1 -0
  163. package/build/src/services/ens.service.d.ts +44 -0
  164. package/build/src/services/ens.service.js +92 -0
  165. package/build/src/services/ens.service.js.map +1 -0
  166. package/build/src/services/gooddollar.service.d.ts +184 -0
  167. package/build/src/services/gooddollar.service.js +675 -0
  168. package/build/src/services/gooddollar.service.js.map +1 -0
  169. package/build/src/services/governance.service.d.ts +96 -0
  170. package/build/src/services/governance.service.js +255 -0
  171. package/build/src/services/governance.service.js.map +1 -0
  172. package/build/src/services/mento-fx.service.d.ts +81 -0
  173. package/build/src/services/mento-fx.service.js +318 -0
  174. package/build/src/services/mento-fx.service.js.map +1 -0
  175. package/build/src/services/nft.service.d.ts +58 -0
  176. package/build/src/services/nft.service.js +222 -0
  177. package/build/src/services/nft.service.js.map +1 -0
  178. package/build/src/services/self-session-store.d.ts +19 -0
  179. package/build/src/services/self-session-store.js +28 -0
  180. package/build/src/services/self-session-store.js.map +1 -0
  181. package/build/src/services/self.service.d.ts +241 -0
  182. package/build/src/services/self.service.js +699 -0
  183. package/build/src/services/self.service.js.map +1 -0
  184. package/build/src/services/staking.service.d.ts +140 -0
  185. package/build/src/services/staking.service.js +444 -0
  186. package/build/src/services/staking.service.js.map +1 -0
  187. package/build/src/services/token.service.d.ts +110 -0
  188. package/build/src/services/token.service.js +189 -0
  189. package/build/src/services/token.service.js.map +1 -0
  190. package/build/src/services/transaction.service.d.ts +69 -0
  191. package/build/src/services/transaction.service.js +197 -0
  192. package/build/src/services/transaction.service.js.map +1 -0
  193. package/build/src/services/uniswap-path-router.d.ts +40 -0
  194. package/build/src/services/uniswap-path-router.js +168 -0
  195. package/build/src/services/uniswap-path-router.js.map +1 -0
  196. package/build/src/services/uniswap-pool-discovery.d.ts +55 -0
  197. package/build/src/services/uniswap-pool-discovery.js +198 -0
  198. package/build/src/services/uniswap-pool-discovery.js.map +1 -0
  199. package/build/src/services/uniswap.service.d.ts +83 -0
  200. package/build/src/services/uniswap.service.js +352 -0
  201. package/build/src/services/uniswap.service.js.map +1 -0
  202. package/build/src/simulation/index.d.ts +5 -0
  203. package/build/src/simulation/index.js +2 -0
  204. package/build/src/simulation/index.js.map +1 -0
  205. package/build/src/simulation/simulate-prepared-step.d.ts +17 -0
  206. package/build/src/simulation/simulate-prepared-step.js +42 -0
  207. package/build/src/simulation/simulate-prepared-step.js.map +1 -0
  208. package/build/src/tools/catalog.d.ts +11 -0
  209. package/build/src/tools/catalog.js +43 -0
  210. package/build/src/tools/catalog.js.map +1 -0
  211. package/build/src/tools/domains/aave.d.ts +2 -0
  212. package/build/src/tools/domains/aave.js +115 -0
  213. package/build/src/tools/domains/aave.js.map +1 -0
  214. package/build/src/tools/domains/agentkarma.d.ts +2 -0
  215. package/build/src/tools/domains/agentkarma.js +92 -0
  216. package/build/src/tools/domains/agentkarma.js.map +1 -0
  217. package/build/src/tools/domains/blockchain.d.ts +2 -0
  218. package/build/src/tools/domains/blockchain.js +122 -0
  219. package/build/src/tools/domains/blockchain.js.map +1 -0
  220. package/build/src/tools/domains/browser.d.ts +2 -0
  221. package/build/src/tools/domains/browser.js +45 -0
  222. package/build/src/tools/domains/browser.js.map +1 -0
  223. package/build/src/tools/domains/contract.d.ts +2 -0
  224. package/build/src/tools/domains/contract.js +67 -0
  225. package/build/src/tools/domains/contract.js.map +1 -0
  226. package/build/src/tools/domains/ens.d.ts +2 -0
  227. package/build/src/tools/domains/ens.js +16 -0
  228. package/build/src/tools/domains/ens.js.map +1 -0
  229. package/build/src/tools/domains/gooddollar.d.ts +2 -0
  230. package/build/src/tools/domains/gooddollar.js +171 -0
  231. package/build/src/tools/domains/gooddollar.js.map +1 -0
  232. package/build/src/tools/domains/governance.d.ts +2 -0
  233. package/build/src/tools/domains/governance.js +41 -0
  234. package/build/src/tools/domains/governance.js.map +1 -0
  235. package/build/src/tools/domains/index.d.ts +1 -0
  236. package/build/src/tools/domains/index.js +33 -0
  237. package/build/src/tools/domains/index.js.map +1 -0
  238. package/build/src/tools/domains/mento-fx.d.ts +2 -0
  239. package/build/src/tools/domains/mento-fx.js +67 -0
  240. package/build/src/tools/domains/mento-fx.js.map +1 -0
  241. package/build/src/tools/domains/nft.d.ts +2 -0
  242. package/build/src/tools/domains/nft.js +38 -0
  243. package/build/src/tools/domains/nft.js.map +1 -0
  244. package/build/src/tools/domains/self.d.ts +2 -0
  245. package/build/src/tools/domains/self.js +187 -0
  246. package/build/src/tools/domains/self.js.map +1 -0
  247. package/build/src/tools/domains/staking.d.ts +2 -0
  248. package/build/src/tools/domains/staking.js +74 -0
  249. package/build/src/tools/domains/staking.js.map +1 -0
  250. package/build/src/tools/domains/token.d.ts +2 -0
  251. package/build/src/tools/domains/token.js +74 -0
  252. package/build/src/tools/domains/token.js.map +1 -0
  253. package/build/src/tools/domains/transaction.d.ts +2 -0
  254. package/build/src/tools/domains/transaction.js +120 -0
  255. package/build/src/tools/domains/transaction.js.map +1 -0
  256. package/build/src/tools/domains/uniswap.d.ts +2 -0
  257. package/build/src/tools/domains/uniswap.js +67 -0
  258. package/build/src/tools/domains/uniswap.js.map +1 -0
  259. package/build/src/tools/filter.d.ts +2 -0
  260. package/build/src/tools/filter.js +50 -0
  261. package/build/src/tools/filter.js.map +1 -0
  262. package/build/src/tools/index.d.ts +7 -0
  263. package/build/src/tools/index.js +7 -0
  264. package/build/src/tools/index.js.map +1 -0
  265. package/build/src/tools/schemas/common.d.ts +165 -0
  266. package/build/src/tools/schemas/common.js +207 -0
  267. package/build/src/tools/schemas/common.js.map +1 -0
  268. package/build/src/tools/schemas/wallet-params.d.ts +9 -0
  269. package/build/src/tools/schemas/wallet-params.js +52 -0
  270. package/build/src/tools/schemas/wallet-params.js.map +1 -0
  271. package/build/src/tools/swap-routing.d.ts +25 -0
  272. package/build/src/tools/swap-routing.js +174 -0
  273. package/build/src/tools/swap-routing.js.map +1 -0
  274. package/build/src/tools/types.d.ts +124 -0
  275. package/build/src/tools/types.js +2 -0
  276. package/build/src/tools/types.js.map +1 -0
  277. package/build/src/tools/utils/normalize-token.d.ts +2 -0
  278. package/build/src/tools/utils/normalize-token.js +12 -0
  279. package/build/src/tools/utils/normalize-token.js.map +1 -0
  280. package/build/src/tools/utils/wallet.d.ts +4 -0
  281. package/build/src/tools/utils/wallet.js +8 -0
  282. package/build/src/tools/utils/wallet.js.map +1 -0
  283. package/build/src/tools/website-sync.d.ts +28 -0
  284. package/build/src/tools/website-sync.js +198 -0
  285. package/build/src/tools/website-sync.js.map +1 -0
  286. package/build/src/types/prepared.d.ts +43 -0
  287. package/build/src/types/prepared.js +15 -0
  288. package/build/src/types/prepared.js.map +1 -0
  289. package/build/src/utils/celo-format.d.ts +6 -0
  290. package/build/src/utils/celo-format.js +17 -0
  291. package/build/src/utils/celo-format.js.map +1 -0
  292. package/build/src/utils/erc20-allowance-storage.d.ts +20 -0
  293. package/build/src/utils/erc20-allowance-storage.js +64 -0
  294. package/build/src/utils/erc20-allowance-storage.js.map +1 -0
  295. package/build/src/utils/format-date.d.ts +2 -0
  296. package/build/src/utils/format-date.js +13 -0
  297. package/build/src/utils/format-date.js.map +1 -0
  298. package/build/src/utils/format-duration.d.ts +2 -0
  299. package/build/src/utils/format-duration.js +17 -0
  300. package/build/src/utils/format-duration.js.map +1 -0
  301. package/build/src/utils/format-unix-datetime.d.ts +4 -0
  302. package/build/src/utils/format-unix-datetime.js +18 -0
  303. package/build/src/utils/format-unix-datetime.js.map +1 -0
  304. package/build/src/utils/gooddollar-ubi-period.d.ts +23 -0
  305. package/build/src/utils/gooddollar-ubi-period.js +23 -0
  306. package/build/src/utils/gooddollar-ubi-period.js.map +1 -0
  307. package/build/src/utils/normalize-address.d.ts +7 -0
  308. package/build/src/utils/normalize-address.js +16 -0
  309. package/build/src/utils/normalize-address.js.map +1 -0
  310. package/build/src/utils/self-format.d.ts +28 -0
  311. package/build/src/utils/self-format.js +79 -0
  312. package/build/src/utils/self-format.js.map +1 -0
  313. package/build/src/utils/self-signing.d.ts +4 -0
  314. package/build/src/utils/self-signing.js +38 -0
  315. package/build/src/utils/self-signing.js.map +1 -0
  316. package/build/src/utils/transaction-errors.d.ts +3 -0
  317. package/build/src/utils/transaction-errors.js +17 -0
  318. package/build/src/utils/transaction-errors.js.map +1 -0
  319. package/build/tests/catalog/domains/blockchain.d.ts +2 -0
  320. package/build/tests/catalog/domains/blockchain.js +127 -0
  321. package/build/tests/catalog/domains/blockchain.js.map +1 -0
  322. package/build/tests/catalog/domains/chain-ext.d.ts +5 -0
  323. package/build/tests/catalog/domains/chain-ext.js +207 -0
  324. package/build/tests/catalog/domains/chain-ext.js.map +1 -0
  325. package/build/tests/catalog/domains/defi.d.ts +6 -0
  326. package/build/tests/catalog/domains/defi.js +581 -0
  327. package/build/tests/catalog/domains/defi.js.map +1 -0
  328. package/build/tests/catalog/domains/self.d.ts +2 -0
  329. package/build/tests/catalog/domains/self.js +208 -0
  330. package/build/tests/catalog/domains/self.js.map +1 -0
  331. package/build/tests/catalog/domains/token.d.ts +2 -0
  332. package/build/tests/catalog/domains/token.js +70 -0
  333. package/build/tests/catalog/domains/token.js.map +1 -0
  334. package/build/tests/catalog/domains/transaction.d.ts +2 -0
  335. package/build/tests/catalog/domains/transaction.js +96 -0
  336. package/build/tests/catalog/domains/transaction.js.map +1 -0
  337. package/build/tests/catalog/index.d.ts +2 -0
  338. package/build/tests/catalog/index.js +2 -0
  339. package/build/tests/catalog/index.js.map +1 -0
  340. package/build/tests/catalog/operations.d.ts +12 -0
  341. package/build/tests/catalog/operations.js +29 -0
  342. package/build/tests/catalog/operations.js.map +1 -0
  343. package/build/tests/catalog/types.d.ts +24 -0
  344. package/build/tests/catalog/types.js +2 -0
  345. package/build/tests/catalog/types.js.map +1 -0
  346. package/build/tests/fixtures/mainnet.d.ts +54 -0
  347. package/build/tests/fixtures/mainnet.js +53 -0
  348. package/build/tests/fixtures/mainnet.js.map +1 -0
  349. package/build/tests/helpers/assert.d.ts +4 -0
  350. package/build/tests/helpers/assert.js +24 -0
  351. package/build/tests/helpers/assert.js.map +1 -0
  352. package/build/tests/helpers/env.d.ts +12 -0
  353. package/build/tests/helpers/env.js +29 -0
  354. package/build/tests/helpers/env.js.map +1 -0
  355. package/build/tests/helpers/gating.d.ts +3 -0
  356. package/build/tests/helpers/gating.js +23 -0
  357. package/build/tests/helpers/gating.js.map +1 -0
  358. package/build/tests/testing-entry.d.ts +6 -0
  359. package/build/tests/testing-entry.js +6 -0
  360. package/build/tests/testing-entry.js.map +1 -0
  361. package/package.json +1 -1
@@ -0,0 +1,65 @@
1
+ import { http } from "viem";
2
+ import { entryPoint07Address } from "viem/account-abstraction";
3
+ import { createPimlicoClient } from "permissionless/clients/pimlico";
4
+ import { CHAIN } from "../config/chains.js";
5
+ /**
6
+ * Provider-agnostic gas sponsorship wiring (bundler URL, paymaster, fees).
7
+ * v1 supports `provider: "pimlico"`; add branches for future providers without renaming this type.
8
+ */
9
+ export class GasSponsorshipService {
10
+ provider;
11
+ config;
12
+ chainId;
13
+ pimlicoClient = null;
14
+ constructor(config, chainId = CHAIN.id) {
15
+ this.config = config;
16
+ this.provider = config.provider;
17
+ this.chainId = chainId;
18
+ if (config.provider === "pimlico") {
19
+ const key = config.pimlico.apiKey?.trim();
20
+ if (!key) {
21
+ throw new Error("gasSponsorship.pimlico.apiKey is required when provider is \"pimlico\"");
22
+ }
23
+ }
24
+ }
25
+ /** Bundler / paymaster JSON-RPC URL for the configured provider and chain. */
26
+ getRpcUrl(chainId = this.chainId) {
27
+ if (this.config.provider === "pimlico") {
28
+ const apiKey = this.config.pimlico.apiKey.trim();
29
+ return `https://api.pimlico.io/v2/${chainId}/rpc?apikey=${apiKey}`;
30
+ }
31
+ const _exhaustive = this.config.provider;
32
+ throw new Error(`Unsupported gas sponsorship provider: ${String(_exhaustive)}`);
33
+ }
34
+ /** viem transport pointed at the sponsorship backend RPC. */
35
+ createBundlerTransport() {
36
+ return http(this.getRpcUrl());
37
+ }
38
+ /** Provider client used as paymaster (and fee oracle in v1). */
39
+ getPaymasterClient() {
40
+ if (this.config.provider !== "pimlico") {
41
+ const _exhaustive = this.config.provider;
42
+ throw new Error(`Unsupported gas sponsorship provider: ${String(_exhaustive)}`);
43
+ }
44
+ if (!this.pimlicoClient) {
45
+ this.pimlicoClient = createPimlicoClient({
46
+ transport: this.createBundlerTransport(),
47
+ entryPoint: {
48
+ address: entryPoint07Address,
49
+ version: "0.7",
50
+ },
51
+ });
52
+ }
53
+ return this.pimlicoClient;
54
+ }
55
+ /** Fee fields for UserOp construction. */
56
+ async estimateFeesPerGas() {
57
+ if (this.config.provider === "pimlico") {
58
+ const prices = await this.getPaymasterClient().getUserOperationGasPrice();
59
+ return prices.fast;
60
+ }
61
+ const _exhaustive = this.config.provider;
62
+ throw new Error(`Unsupported gas sponsorship provider: ${String(_exhaustive)}`);
63
+ }
64
+ }
65
+ //# sourceMappingURL=gas-sponsorship.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gas-sponsorship.js","sourceRoot":"","sources":["../../../src/aa/gas-sponsorship.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAK5C;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACvB,QAAQ,CAA2B;IAC3B,MAAM,CAAuB;IAC7B,OAAO,CAAS;IACzB,aAAa,GAAyB,IAAI,CAAC;IAEnD,YAAY,MAA4B,EAAE,UAAkB,KAAK,CAAC,EAAE;QAClE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,SAAS,CAAC,UAAkB,IAAI,CAAC,OAAO;QACtC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjD,OAAO,6BAA6B,OAAO,eAAe,MAAM,EAAE,CAAC;QACrE,CAAC;QACD,MAAM,WAAW,GAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,6DAA6D;IAC7D,sBAAsB;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,gEAAgE;IAChE,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,WAAW,GAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAClF,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC;gBACvC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE;gBACxC,UAAU,EAAE;oBACV,OAAO,EAAE,mBAAmB;oBAC5B,OAAO,EAAE,KAAK;iBACf;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,kBAAkB;QAItB,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,wBAAwB,EAAE,CAAC;YAC1E,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QACD,MAAM,WAAW,GAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { createAAClient, deriveSmartAccountAddress, type AAClient } from "./create-aa-client.js";
2
+ export { GasSponsorshipService } from "./gas-sponsorship.js";
3
+ export { preparedStepsToUserOpCalls } from "./prepared-calls.js";
4
+ export type { CreateAAClientOptions, GasSponsorshipConfig, GasSponsorshipProviderId, PimlicoGasSponsorshipConfig, SendPreparedFlowMode, SendPreparedFlowOptions, SendPreparedFlowResult, UserOpCall, } from "./types.js";
@@ -0,0 +1,4 @@
1
+ export { createAAClient, deriveSmartAccountAddress } from "./create-aa-client.js";
2
+ export { GasSponsorshipService } from "./gas-sponsorship.js";
3
+ export { preparedStepsToUserOpCalls } from "./prepared-calls.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/aa/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAiB,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { PreparedTx } from "../types/prepared.js";
2
+ import type { UserOpCall } from "./types.js";
3
+ /**
4
+ * Map Celina prepared steps to smart-account `calls`.
5
+ * When `attributionTags` is provided, each step's `data` is dual-tagged
6
+ * via {@link appendCelinaCalldataTag}; otherwise `data` is preserved as-is.
7
+ */
8
+ export declare function preparedStepsToUserOpCalls(steps: PreparedTx[], attributionTags?: string[]): UserOpCall[];
@@ -0,0 +1,27 @@
1
+ import { appendCelinaCalldataTag } from "../config/celina-tag.js";
2
+ /**
3
+ * Map Celina prepared steps to smart-account `calls`.
4
+ * When `attributionTags` is provided, each step's `data` is dual-tagged
5
+ * via {@link appendCelinaCalldataTag}; otherwise `data` is preserved as-is.
6
+ */
7
+ export function preparedStepsToUserOpCalls(steps, attributionTags) {
8
+ if (!steps.length) {
9
+ throw new Error("prepared flow has no steps");
10
+ }
11
+ const shouldTag = attributionTags !== undefined;
12
+ return steps.map((step) => {
13
+ const value = step.value !== undefined && step.value !== ""
14
+ ? BigInt(step.value)
15
+ : undefined;
16
+ let data = step.data;
17
+ if (shouldTag && data !== undefined) {
18
+ data = appendCelinaCalldataTag(data, attributionTags);
19
+ }
20
+ return {
21
+ to: step.to,
22
+ ...(data !== undefined ? { data } : {}),
23
+ ...(value !== undefined && value > 0n ? { value } : {}),
24
+ };
25
+ });
26
+ }
27
+ //# sourceMappingURL=prepared-calls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepared-calls.js","sourceRoot":"","sources":["../../../src/aa/prepared-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAmB,EACnB,eAA0B;IAE1B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IACD,MAAM,SAAS,GAAG,eAAe,KAAK,SAAS,CAAC;IAChD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GACT,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE;YAC3C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YACpB,CAAC,CAAC,SAAS,CAAC;QAChB,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,IAAI,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,GAAG,uBAAuB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACxD,CAAC;QACD,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,61 @@
1
+ import type { Hex, PrivateKeyAccount, PublicClient } from "viem";
2
+ /** Supported gas sponsorship backends. Extends with new union members over time. */
3
+ export type GasSponsorshipProviderId = "pimlico";
4
+ /** Pimlico-specific credentials (app-owned; never stored by Celina). */
5
+ export type PimlicoGasSponsorshipConfig = {
6
+ /** App-owned Pimlico API key. */
7
+ apiKey: string;
8
+ };
9
+ /**
10
+ * Explicit gas sponsorship config for {@link createAAClient}.
11
+ * Discriminant `provider` selects which nested object is required.
12
+ */
13
+ export type GasSponsorshipConfig = {
14
+ provider: "pimlico";
15
+ pimlico: PimlicoGasSponsorshipConfig;
16
+ };
17
+ /**
18
+ * Options for {@link createAAClient}.
19
+ *
20
+ * Set `attributionTags` here for hand-built prepared steps (tagged at `sendPreparedFlow`).
21
+ * For `prepare*` flows, you can set the same tags on `createCelinaClient` instead —
22
+ * use one consistent list per send path so suffixes do not stack with mismatched tags.
23
+ */
24
+ export type CreateAAClientOptions = {
25
+ /** EOA owner of the Simple Smart Account (account or private key hex). */
26
+ owner: PrivateKeyAccount | Hex;
27
+ /** Explicit sponsorship provider + credentials. */
28
+ gasSponsorship: GasSponsorshipConfig;
29
+ /** Optional Celo public client; defaults to Forno mainnet. */
30
+ publicClient?: PublicClient;
31
+ /**
32
+ * Optional custom tags applied via `appendCelinaCalldataTag` on each step's `data`
33
+ * in `sendPreparedFlow` (legacy `CELINA|…` + ERC-8021). When omitted, step data
34
+ * is passed through unchanged.
35
+ */
36
+ attributionTags?: string[];
37
+ };
38
+ /** How to map prepared transactions (`prepare*` output / ordered `steps`) into UserOperations. */
39
+ export type SendPreparedFlowMode = "batch" | "sequential";
40
+ export type SendPreparedFlowOptions = {
41
+ /**
42
+ * How to submit the prepared transactions (`steps`).
43
+ * `batch` (default): all steps in one UserOp.
44
+ * `sequential`: one UserOp per step.
45
+ */
46
+ mode?: SendPreparedFlowMode;
47
+ };
48
+ export type UserOpCall = {
49
+ to: `0x${string}`;
50
+ data?: `0x${string}`;
51
+ value?: bigint;
52
+ };
53
+ /** Result of submitting prepared transactions as sponsored UserOp(s). */
54
+ export type SendPreparedFlowResult = {
55
+ mode: SendPreparedFlowMode;
56
+ /** UserOperation hash(es) submitted to the bundler. */
57
+ userOpHashes: `0x${string}`[];
58
+ /** Transaction hash(es) from UserOp receipt(s). */
59
+ transactionHashes: `0x${string}`[];
60
+ success: boolean;
61
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/aa/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ export declare const aavePoolAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "supply";
4
+ readonly inputs: readonly [{
5
+ readonly name: "asset";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly name: "amount";
9
+ readonly type: "uint256";
10
+ }, {
11
+ readonly name: "onBehalfOf";
12
+ readonly type: "address";
13
+ }, {
14
+ readonly name: "referralCode";
15
+ readonly type: "uint16";
16
+ }];
17
+ readonly outputs: readonly [];
18
+ readonly stateMutability: "nonpayable";
19
+ }, {
20
+ readonly type: "function";
21
+ readonly name: "withdraw";
22
+ readonly inputs: readonly [{
23
+ readonly name: "asset";
24
+ readonly type: "address";
25
+ }, {
26
+ readonly name: "amount";
27
+ readonly type: "uint256";
28
+ }, {
29
+ readonly name: "to";
30
+ readonly type: "address";
31
+ }];
32
+ readonly outputs: readonly [{
33
+ readonly name: "";
34
+ readonly type: "uint256";
35
+ }];
36
+ readonly stateMutability: "nonpayable";
37
+ }];
@@ -0,0 +1,26 @@
1
+ export const aavePoolAbi = [
2
+ {
3
+ type: "function",
4
+ name: "supply",
5
+ inputs: [
6
+ { name: "asset", type: "address" },
7
+ { name: "amount", type: "uint256" },
8
+ { name: "onBehalfOf", type: "address" },
9
+ { name: "referralCode", type: "uint16" },
10
+ ],
11
+ outputs: [],
12
+ stateMutability: "nonpayable",
13
+ },
14
+ {
15
+ type: "function",
16
+ name: "withdraw",
17
+ inputs: [
18
+ { name: "asset", type: "address" },
19
+ { name: "amount", type: "uint256" },
20
+ { name: "to", type: "address" },
21
+ ],
22
+ outputs: [{ name: "", type: "uint256" }],
23
+ stateMutability: "nonpayable",
24
+ },
25
+ ];
26
+ //# sourceMappingURL=aave-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aave-pool.js","sourceRoot":"","sources":["../../../src/abis/aave-pool.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;SACzC;QACD,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;KAC9B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;SAChC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,eAAe,EAAE,YAAY;KAC9B;CACO,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const accountsAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "getName";
4
+ readonly inputs: readonly [{
5
+ readonly name: "account";
6
+ readonly type: "address";
7
+ }];
8
+ readonly outputs: readonly [{
9
+ readonly name: "";
10
+ readonly type: "string";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ }];
@@ -0,0 +1,10 @@
1
+ export const accountsAbi = [
2
+ {
3
+ type: "function",
4
+ name: "getName",
5
+ inputs: [{ name: "account", type: "address" }],
6
+ outputs: [{ name: "", type: "string" }],
7
+ stateMutability: "view",
8
+ },
9
+ ];
10
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/abis/accounts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACvC,eAAe,EAAE,MAAM;KACxB;CACO,CAAC"}
@@ -0,0 +1,124 @@
1
+ export declare const electionAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "getGroupsVotedForByAccount";
4
+ readonly inputs: readonly [{
5
+ readonly name: "account";
6
+ readonly type: "address";
7
+ }];
8
+ readonly outputs: readonly [{
9
+ readonly name: "";
10
+ readonly type: "address[]";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ }, {
14
+ readonly type: "function";
15
+ readonly name: "getPendingVotesForGroupByAccount";
16
+ readonly inputs: readonly [{
17
+ readonly name: "group";
18
+ readonly type: "address";
19
+ }, {
20
+ readonly name: "account";
21
+ readonly type: "address";
22
+ }];
23
+ readonly outputs: readonly [{
24
+ readonly name: "";
25
+ readonly type: "uint256";
26
+ }];
27
+ readonly stateMutability: "view";
28
+ }, {
29
+ readonly type: "function";
30
+ readonly name: "getActiveVotesForGroupByAccount";
31
+ readonly inputs: readonly [{
32
+ readonly name: "group";
33
+ readonly type: "address";
34
+ }, {
35
+ readonly name: "account";
36
+ readonly type: "address";
37
+ }];
38
+ readonly outputs: readonly [{
39
+ readonly name: "";
40
+ readonly type: "uint256";
41
+ }];
42
+ readonly stateMutability: "view";
43
+ }, {
44
+ readonly type: "function";
45
+ readonly name: "hasActivatablePendingVotes";
46
+ readonly inputs: readonly [{
47
+ readonly name: "account";
48
+ readonly type: "address";
49
+ }, {
50
+ readonly name: "group";
51
+ readonly type: "address";
52
+ }];
53
+ readonly outputs: readonly [{
54
+ readonly name: "";
55
+ readonly type: "bool";
56
+ }];
57
+ readonly stateMutability: "view";
58
+ }, {
59
+ readonly type: "function";
60
+ readonly name: "getEligibleValidatorGroups";
61
+ readonly inputs: readonly [];
62
+ readonly outputs: readonly [{
63
+ readonly name: "";
64
+ readonly type: "address[]";
65
+ }];
66
+ readonly stateMutability: "view";
67
+ }, {
68
+ readonly type: "function";
69
+ readonly name: "getActiveVotesForGroup";
70
+ readonly inputs: readonly [{
71
+ readonly name: "group";
72
+ readonly type: "address";
73
+ }];
74
+ readonly outputs: readonly [{
75
+ readonly name: "";
76
+ readonly type: "uint256";
77
+ }];
78
+ readonly stateMutability: "view";
79
+ }, {
80
+ readonly type: "function";
81
+ readonly name: "getTotalVotesForEligibleValidatorGroups";
82
+ readonly inputs: readonly [];
83
+ readonly outputs: readonly [{
84
+ readonly name: "groups";
85
+ readonly type: "address[]";
86
+ }, {
87
+ readonly name: "votes";
88
+ readonly type: "uint256[]";
89
+ }];
90
+ readonly stateMutability: "view";
91
+ }, {
92
+ readonly type: "function";
93
+ readonly name: "getTotalVotes";
94
+ readonly inputs: readonly [];
95
+ readonly outputs: readonly [{
96
+ readonly name: "";
97
+ readonly type: "uint256";
98
+ }];
99
+ readonly stateMutability: "view";
100
+ }, {
101
+ readonly type: "function";
102
+ readonly name: "getElectableValidators";
103
+ readonly inputs: readonly [];
104
+ readonly outputs: readonly [{
105
+ readonly name: "min";
106
+ readonly type: "uint256";
107
+ }, {
108
+ readonly name: "max";
109
+ readonly type: "uint256";
110
+ }];
111
+ readonly stateMutability: "view";
112
+ }, {
113
+ readonly type: "function";
114
+ readonly name: "canReceiveVotes";
115
+ readonly inputs: readonly [{
116
+ readonly name: "group";
117
+ readonly type: "address";
118
+ }];
119
+ readonly outputs: readonly [{
120
+ readonly name: "";
121
+ readonly type: "uint256";
122
+ }];
123
+ readonly stateMutability: "view";
124
+ }];
@@ -0,0 +1,88 @@
1
+ export const electionAbi = [
2
+ {
3
+ type: "function",
4
+ name: "getGroupsVotedForByAccount",
5
+ inputs: [{ name: "account", type: "address" }],
6
+ outputs: [{ name: "", type: "address[]" }],
7
+ stateMutability: "view",
8
+ },
9
+ {
10
+ type: "function",
11
+ name: "getPendingVotesForGroupByAccount",
12
+ inputs: [
13
+ { name: "group", type: "address" },
14
+ { name: "account", type: "address" },
15
+ ],
16
+ outputs: [{ name: "", type: "uint256" }],
17
+ stateMutability: "view",
18
+ },
19
+ {
20
+ type: "function",
21
+ name: "getActiveVotesForGroupByAccount",
22
+ inputs: [
23
+ { name: "group", type: "address" },
24
+ { name: "account", type: "address" },
25
+ ],
26
+ outputs: [{ name: "", type: "uint256" }],
27
+ stateMutability: "view",
28
+ },
29
+ {
30
+ type: "function",
31
+ name: "hasActivatablePendingVotes",
32
+ inputs: [
33
+ { name: "account", type: "address" },
34
+ { name: "group", type: "address" },
35
+ ],
36
+ outputs: [{ name: "", type: "bool" }],
37
+ stateMutability: "view",
38
+ },
39
+ {
40
+ type: "function",
41
+ name: "getEligibleValidatorGroups",
42
+ inputs: [],
43
+ outputs: [{ name: "", type: "address[]" }],
44
+ stateMutability: "view",
45
+ },
46
+ {
47
+ type: "function",
48
+ name: "getActiveVotesForGroup",
49
+ inputs: [{ name: "group", type: "address" }],
50
+ outputs: [{ name: "", type: "uint256" }],
51
+ stateMutability: "view",
52
+ },
53
+ {
54
+ type: "function",
55
+ name: "getTotalVotesForEligibleValidatorGroups",
56
+ inputs: [],
57
+ outputs: [
58
+ { name: "groups", type: "address[]" },
59
+ { name: "votes", type: "uint256[]" },
60
+ ],
61
+ stateMutability: "view",
62
+ },
63
+ {
64
+ type: "function",
65
+ name: "getTotalVotes",
66
+ inputs: [],
67
+ outputs: [{ name: "", type: "uint256" }],
68
+ stateMutability: "view",
69
+ },
70
+ {
71
+ type: "function",
72
+ name: "getElectableValidators",
73
+ inputs: [],
74
+ outputs: [
75
+ { name: "min", type: "uint256" },
76
+ { name: "max", type: "uint256" },
77
+ ],
78
+ stateMutability: "view",
79
+ },
80
+ {
81
+ type: "function",
82
+ name: "canReceiveVotes",
83
+ inputs: [{ name: "group", type: "address" }],
84
+ outputs: [{ name: "", type: "uint256" }],
85
+ stateMutability: "view",
86
+ },
87
+ ];
88
+ //# sourceMappingURL=election.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"election.js","sourceRoot":"","sources":["../../../src/abis/election.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,77 @@
1
+ /** GoodDollar MentoBroker on Celo — reserve swap quotes and execution. */
2
+ export declare const goodDollarBrokerAbi: readonly [{
3
+ readonly type: "function";
4
+ readonly name: "getAmountOut";
5
+ readonly inputs: readonly [{
6
+ readonly name: "exchangeProvider";
7
+ readonly type: "address";
8
+ }, {
9
+ readonly name: "exchangeId";
10
+ readonly type: "bytes32";
11
+ }, {
12
+ readonly name: "tokenIn";
13
+ readonly type: "address";
14
+ }, {
15
+ readonly name: "tokenOut";
16
+ readonly type: "address";
17
+ }, {
18
+ readonly name: "amountIn";
19
+ readonly type: "uint256";
20
+ }];
21
+ readonly outputs: readonly [{
22
+ readonly name: "";
23
+ readonly type: "uint256";
24
+ }];
25
+ readonly stateMutability: "view";
26
+ }, {
27
+ readonly type: "function";
28
+ readonly name: "getAmountIn";
29
+ readonly inputs: readonly [{
30
+ readonly name: "exchangeProvider";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "exchangeId";
34
+ readonly type: "bytes32";
35
+ }, {
36
+ readonly name: "tokenIn";
37
+ readonly type: "address";
38
+ }, {
39
+ readonly name: "tokenOut";
40
+ readonly type: "address";
41
+ }, {
42
+ readonly name: "amountOut";
43
+ readonly type: "uint256";
44
+ }];
45
+ readonly outputs: readonly [{
46
+ readonly name: "";
47
+ readonly type: "uint256";
48
+ }];
49
+ readonly stateMutability: "view";
50
+ }, {
51
+ readonly type: "function";
52
+ readonly name: "swapIn";
53
+ readonly inputs: readonly [{
54
+ readonly name: "exchangeProvider";
55
+ readonly type: "address";
56
+ }, {
57
+ readonly name: "exchangeId";
58
+ readonly type: "bytes32";
59
+ }, {
60
+ readonly name: "tokenIn";
61
+ readonly type: "address";
62
+ }, {
63
+ readonly name: "tokenOut";
64
+ readonly type: "address";
65
+ }, {
66
+ readonly name: "amountIn";
67
+ readonly type: "uint256";
68
+ }, {
69
+ readonly name: "amountOutMin";
70
+ readonly type: "uint256";
71
+ }];
72
+ readonly outputs: readonly [{
73
+ readonly name: "amountOut";
74
+ readonly type: "uint256";
75
+ }];
76
+ readonly stateMutability: "nonpayable";
77
+ }];
@@ -0,0 +1,44 @@
1
+ /** GoodDollar MentoBroker on Celo — reserve swap quotes and execution. */
2
+ export const goodDollarBrokerAbi = [
3
+ {
4
+ type: "function",
5
+ name: "getAmountOut",
6
+ inputs: [
7
+ { name: "exchangeProvider", type: "address" },
8
+ { name: "exchangeId", type: "bytes32" },
9
+ { name: "tokenIn", type: "address" },
10
+ { name: "tokenOut", type: "address" },
11
+ { name: "amountIn", type: "uint256" },
12
+ ],
13
+ outputs: [{ name: "", type: "uint256" }],
14
+ stateMutability: "view",
15
+ },
16
+ {
17
+ type: "function",
18
+ name: "getAmountIn",
19
+ inputs: [
20
+ { name: "exchangeProvider", type: "address" },
21
+ { name: "exchangeId", type: "bytes32" },
22
+ { name: "tokenIn", type: "address" },
23
+ { name: "tokenOut", type: "address" },
24
+ { name: "amountOut", type: "uint256" },
25
+ ],
26
+ outputs: [{ name: "", type: "uint256" }],
27
+ stateMutability: "view",
28
+ },
29
+ {
30
+ type: "function",
31
+ name: "swapIn",
32
+ inputs: [
33
+ { name: "exchangeProvider", type: "address" },
34
+ { name: "exchangeId", type: "bytes32" },
35
+ { name: "tokenIn", type: "address" },
36
+ { name: "tokenOut", type: "address" },
37
+ { name: "amountIn", type: "uint256" },
38
+ { name: "amountOutMin", type: "uint256" },
39
+ ],
40
+ outputs: [{ name: "amountOut", type: "uint256" }],
41
+ stateMutability: "nonpayable",
42
+ },
43
+ ];
44
+ //# sourceMappingURL=gooddollar-broker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gooddollar-broker.js","sourceRoot":"","sources":["../../../src/abis/gooddollar-broker.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;SACtC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;SACvC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE;SAC1C;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACjD,eAAe,EAAE,YAAY;KAC9B;CACO,CAAC"}