tapimo 0.14.0 → 0.15.1

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 (1160) hide show
  1. package/README.md +7 -4
  2. package/dist/ApiKey.js +1 -1
  3. package/dist/ApiKey.js.map +1 -1
  4. package/dist/ApiKeys.d.ts +95 -14
  5. package/dist/ApiKeys.d.ts.map +1 -1
  6. package/dist/ApiKeys.js +360 -49
  7. package/dist/ApiKeys.js.map +1 -1
  8. package/dist/App.d.ts +12466 -10374
  9. package/dist/App.d.ts.map +1 -1
  10. package/dist/App.js +300 -22
  11. package/dist/App.js.map +1 -1
  12. package/dist/Assets.d.ts.map +1 -1
  13. package/dist/Assets.js +2 -1
  14. package/dist/Assets.js.map +1 -1
  15. package/dist/Handler.d.ts +0 -1
  16. package/dist/Handler.d.ts.map +1 -1
  17. package/dist/Handler.js +0 -1
  18. package/dist/Handler.js.map +1 -1
  19. package/dist/Scope.d.ts +13 -5
  20. package/dist/Scope.d.ts.map +1 -1
  21. package/dist/Scope.js +16 -5
  22. package/dist/Scope.js.map +1 -1
  23. package/dist/Webhooks.js +1 -1
  24. package/dist/Webhooks.js.map +1 -1
  25. package/dist/admin/App.d.ts +3057 -546
  26. package/dist/admin/App.d.ts.map +1 -1
  27. package/dist/admin/App.js +26 -5
  28. package/dist/admin/App.js.map +1 -1
  29. package/dist/admin/apps/api-keys.d.ts +179 -27
  30. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  31. package/dist/admin/apps/api-keys.js +95 -43
  32. package/dist/admin/apps/api-keys.js.map +1 -1
  33. package/dist/admin/apps/earn-vaults.d.ts +1398 -0
  34. package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
  35. package/dist/admin/apps/earn-vaults.js +463 -7
  36. package/dist/admin/apps/earn-vaults.js.map +1 -1
  37. package/dist/admin/apps/organizations.d.ts +267 -15
  38. package/dist/admin/apps/organizations.d.ts.map +1 -1
  39. package/dist/admin/apps/organizations.js +241 -25
  40. package/dist/admin/apps/organizations.js.map +1 -1
  41. package/dist/admin/apps/routes-support.d.ts +95 -0
  42. package/dist/admin/apps/routes-support.d.ts.map +1 -0
  43. package/dist/admin/apps/routes-support.js +151 -0
  44. package/dist/admin/apps/routes-support.js.map +1 -0
  45. package/dist/admin/apps/routes.d.ts +2764 -0
  46. package/dist/admin/apps/routes.d.ts.map +1 -0
  47. package/dist/admin/apps/routes.js +728 -0
  48. package/dist/admin/apps/routes.js.map +1 -0
  49. package/dist/admin/apps/subsidies.d.ts +501 -0
  50. package/dist/admin/apps/subsidies.d.ts.map +1 -0
  51. package/dist/admin/apps/subsidies.js +384 -0
  52. package/dist/admin/apps/subsidies.js.map +1 -0
  53. package/dist/admin/apps/verified-tokens.d.ts +166 -160
  54. package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
  55. package/dist/admin/apps/verified-tokens.js +27 -7
  56. package/dist/admin/apps/verified-tokens.js.map +1 -1
  57. package/dist/admin/ui.generated.d.ts +1 -1
  58. package/dist/admin/ui.generated.d.ts.map +1 -1
  59. package/dist/admin/ui.generated.js +201 -149
  60. package/dist/admin/ui.generated.js.map +1 -1
  61. package/dist/analytics/Analytics.d.ts +5 -2
  62. package/dist/analytics/Analytics.d.ts.map +1 -1
  63. package/dist/analytics/Analytics.js +31 -1
  64. package/dist/analytics/Analytics.js.map +1 -1
  65. package/dist/analytics/tables/requestEvents.d.ts +2 -1
  66. package/dist/analytics/tables/requestEvents.d.ts.map +1 -1
  67. package/dist/analytics/tables/requestEvents.js +10 -1
  68. package/dist/analytics/tables/requestEvents.js.map +1 -1
  69. package/dist/analytics/tables/routesLifecycleIntervals.d.ts +72 -0
  70. package/dist/analytics/tables/routesLifecycleIntervals.d.ts.map +1 -0
  71. package/dist/analytics/tables/routesLifecycleIntervals.js +56 -0
  72. package/dist/analytics/tables/routesLifecycleIntervals.js.map +1 -0
  73. package/dist/apps/Zones.d.ts +21 -12526
  74. package/dist/apps/Zones.d.ts.map +1 -1
  75. package/dist/apps/Zones.js +37 -5
  76. package/dist/apps/Zones.js.map +1 -1
  77. package/dist/apps/data/App.d.ts +3971 -2595
  78. package/dist/apps/data/App.d.ts.map +1 -1
  79. package/dist/apps/data/App.js +76 -21
  80. package/dist/apps/data/App.js.map +1 -1
  81. package/dist/apps/data/routes/activities.d.ts +629 -299
  82. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  83. package/dist/apps/data/routes/activities.js +495 -190
  84. package/dist/apps/data/routes/activities.js.map +1 -1
  85. package/dist/apps/data/routes/addresses.d.ts +72 -0
  86. package/dist/apps/data/routes/addresses.d.ts.map +1 -1
  87. package/dist/apps/data/routes/blocks.d.ts +116 -116
  88. package/dist/apps/data/routes/coingecko.d.ts.map +1 -1
  89. package/dist/apps/data/routes/coingecko.js +47 -21
  90. package/dist/apps/data/routes/coingecko.js.map +1 -1
  91. package/dist/apps/data/routes/earn.d.ts +1450 -337
  92. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  93. package/dist/apps/data/routes/earn.js +1226 -144
  94. package/dist/apps/data/routes/earn.js.map +1 -1
  95. package/dist/apps/data/routes/fee-amm.d.ts +113 -108
  96. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
  97. package/dist/apps/data/routes/fee-amm.js +41 -21
  98. package/dist/apps/data/routes/fee-amm.js.map +1 -1
  99. package/dist/apps/data/routes/indexer.d.ts +142 -17
  100. package/dist/apps/data/routes/indexer.d.ts.map +1 -1
  101. package/dist/apps/data/routes/indexer.js +83 -27
  102. package/dist/apps/data/routes/indexer.js.map +1 -1
  103. package/dist/apps/data/routes/receipts.d.ts +235 -235
  104. package/dist/apps/data/routes/rpc.d.ts +507 -33
  105. package/dist/apps/data/routes/rpc.d.ts.map +1 -1
  106. package/dist/apps/data/routes/rpc.js +309 -165
  107. package/dist/apps/data/routes/rpc.js.map +1 -1
  108. package/dist/apps/data/routes/tokenlist.d.ts +47 -15
  109. package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
  110. package/dist/apps/data/routes/tokenlist.js +68 -11
  111. package/dist/apps/data/routes/tokenlist.js.map +1 -1
  112. package/dist/apps/data/routes/tokens.d.ts +2 -0
  113. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  114. package/dist/apps/data/routes/tokens.js +26 -14
  115. package/dist/apps/data/routes/tokens.js.map +1 -1
  116. package/dist/apps/data/routes/transfers.d.ts +93 -77
  117. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  118. package/dist/apps/data/routes/transfers.js +9 -7
  119. package/dist/apps/data/routes/transfers.js.map +1 -1
  120. package/dist/apps/data/routes/valuation.d.ts +32 -32
  121. package/dist/apps/data/routes/verified-tokens.d.ts +88 -88
  122. package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -1
  123. package/dist/apps/data/routes/verified-tokens.js +64 -20
  124. package/dist/apps/data/routes/verified-tokens.js.map +1 -1
  125. package/dist/apps/data/routes/webhooks.d.ts +614 -177
  126. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  127. package/dist/apps/data/routes/webhooks.js +308 -205
  128. package/dist/apps/data/routes/webhooks.js.map +1 -1
  129. package/dist/apps/data/routes/zones.d.ts +31 -31
  130. package/dist/apps/data/routes/zones.d.ts.map +1 -1
  131. package/dist/apps/data/routes/zones.js +20 -12
  132. package/dist/apps/data/routes/zones.js.map +1 -1
  133. package/dist/apps/docs/reference.js +2 -2
  134. package/dist/apps/docs/reference.js.map +1 -1
  135. package/dist/apps/index.d.ts +1 -1
  136. package/dist/apps/index.d.ts.map +1 -1
  137. package/dist/apps/index.js +1 -1
  138. package/dist/apps/index.js.map +1 -1
  139. package/dist/apps/management/App.d.ts +3780 -3402
  140. package/dist/apps/management/App.d.ts.map +1 -1
  141. package/dist/apps/management/App.js +5 -14
  142. package/dist/apps/management/App.js.map +1 -1
  143. package/dist/apps/management/Billing.d.ts +48 -7
  144. package/dist/apps/management/Billing.d.ts.map +1 -1
  145. package/dist/apps/management/Billing.js +204 -25
  146. package/dist/apps/management/Billing.js.map +1 -1
  147. package/dist/apps/management/routes/api-keys.d.ts +317 -215
  148. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  149. package/dist/apps/management/routes/api-keys.js +43 -15
  150. package/dist/apps/management/routes/api-keys.js.map +1 -1
  151. package/dist/apps/management/routes/billing.d.ts +290 -4
  152. package/dist/apps/management/routes/billing.d.ts.map +1 -1
  153. package/dist/apps/management/routes/billing.js +274 -49
  154. package/dist/apps/management/routes/billing.js.map +1 -1
  155. package/dist/apps/management/routes/faucet.d.ts +6 -6
  156. package/dist/apps/management/routes/faucet.js +1 -1
  157. package/dist/apps/management/routes/faucet.js.map +1 -1
  158. package/dist/apps/management/routes/invitations.d.ts +213 -138
  159. package/dist/apps/management/routes/invitations.d.ts.map +1 -1
  160. package/dist/apps/management/routes/invitations.js +117 -13
  161. package/dist/apps/management/routes/invitations.js.map +1 -1
  162. package/dist/apps/management/routes/invite-links.d.ts +166 -166
  163. package/dist/apps/management/routes/me.d.ts.map +1 -1
  164. package/dist/apps/management/routes/me.js +6 -2
  165. package/dist/apps/management/routes/me.js.map +1 -1
  166. package/dist/apps/management/routes/members.d.ts +30 -30
  167. package/dist/apps/management/routes/orgs.d.ts +103 -87
  168. package/dist/apps/management/routes/orgs.d.ts.map +1 -1
  169. package/dist/apps/management/routes/orgs.js +52 -12
  170. package/dist/apps/management/routes/orgs.js.map +1 -1
  171. package/dist/apps/management/routes/projects.d.ts +125 -125
  172. package/dist/apps/management/routes/projects.d.ts.map +1 -1
  173. package/dist/apps/management/routes/projects.js +6 -1
  174. package/dist/apps/management/routes/projects.js.map +1 -1
  175. package/dist/apps/management/routes/scopes.d.ts.map +1 -1
  176. package/dist/apps/management/routes/scopes.js +4 -1
  177. package/dist/apps/management/routes/scopes.js.map +1 -1
  178. package/dist/apps/management/routes/usage.d.ts +24 -24
  179. package/dist/apps/management/routes/usage.js +21 -4
  180. package/dist/apps/management/routes/usage.js.map +1 -1
  181. package/dist/apps/management/routes/verified-token-requests.d.ts +95 -95
  182. package/dist/apps/management/routes/verified-token-requests.d.ts.map +1 -1
  183. package/dist/apps/management/routes/verified-token-requests.js +7 -9
  184. package/dist/apps/management/routes/verified-token-requests.js.map +1 -1
  185. package/dist/apps/management/routes/webhooks.d.ts +682 -616
  186. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  187. package/dist/apps/management/routes/webhooks.js +58 -12
  188. package/dist/apps/management/routes/webhooks.js.map +1 -1
  189. package/dist/apps/mcp.d.ts +1 -1
  190. package/dist/apps/mcp.d.ts.map +1 -1
  191. package/dist/apps/mcp.js +23 -10
  192. package/dist/apps/mcp.js.map +1 -1
  193. package/dist/apps/mpp/App.d.ts +44 -44
  194. package/dist/apps/mpp/App.d.ts.map +1 -1
  195. package/dist/apps/mpp/App.js +35 -7
  196. package/dist/apps/mpp/App.js.map +1 -1
  197. package/dist/apps/mpp/internal/Adapter.d.ts +2 -0
  198. package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
  199. package/dist/apps/mpp/internal/Adapter.js +30 -1
  200. package/dist/apps/mpp/internal/Adapter.js.map +1 -1
  201. package/dist/apps/mpp/internal/Policy.d.ts +22 -4
  202. package/dist/apps/mpp/internal/Policy.d.ts.map +1 -1
  203. package/dist/apps/mpp/internal/Policy.js +24 -6
  204. package/dist/apps/mpp/internal/Policy.js.map +1 -1
  205. package/dist/apps/mpp/internal/Sponsorship.d.ts +3 -0
  206. package/dist/apps/mpp/internal/Sponsorship.d.ts.map +1 -1
  207. package/dist/apps/mpp/internal/Sponsorship.js +6 -3
  208. package/dist/apps/mpp/internal/Sponsorship.js.map +1 -1
  209. package/dist/apps/relay/App.d.ts +2 -0
  210. package/dist/apps/relay/App.d.ts.map +1 -1
  211. package/dist/apps/relay/App.js +134 -75
  212. package/dist/apps/relay/App.js.map +1 -1
  213. package/dist/apps/relay/Sponsorships.d.ts +5 -3
  214. package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
  215. package/dist/apps/relay/Sponsorships.js +209 -28
  216. package/dist/apps/relay/Sponsorships.js.map +1 -1
  217. package/dist/apps/{funding → routes}/Access.d.ts +4 -4
  218. package/dist/apps/routes/Access.d.ts.map +1 -0
  219. package/dist/apps/{funding → routes}/Access.js +4 -4
  220. package/dist/apps/routes/Access.js.map +1 -0
  221. package/dist/apps/{funding → routes}/App.d.ts +418 -124
  222. package/dist/apps/{funding → routes}/App.d.ts.map +1 -1
  223. package/dist/apps/{funding → routes}/App.js +16 -16
  224. package/dist/apps/routes/App.js.map +1 -0
  225. package/dist/apps/routes/Inventory.d.ts.map +1 -0
  226. package/dist/apps/{funding → routes}/Inventory.js +2 -2
  227. package/dist/apps/routes/Inventory.js.map +1 -0
  228. package/dist/apps/routes/index.d.ts +2 -0
  229. package/dist/apps/routes/index.d.ts.map +1 -0
  230. package/dist/apps/routes/index.js +2 -0
  231. package/dist/apps/routes/index.js.map +1 -0
  232. package/dist/apps/{funding → routes}/routes/chains.d.ts +32 -32
  233. package/dist/apps/routes/routes/chains.d.ts.map +1 -0
  234. package/dist/apps/{funding → routes}/routes/chains.js +25 -25
  235. package/dist/apps/routes/routes/chains.js.map +1 -0
  236. package/dist/apps/{funding → routes}/routes/deposit-addresses.d.ts +107 -43
  237. package/dist/apps/routes/routes/deposit-addresses.d.ts.map +1 -0
  238. package/dist/apps/{funding → routes}/routes/deposit-addresses.js +497 -222
  239. package/dist/apps/routes/routes/deposit-addresses.js.map +1 -0
  240. package/dist/apps/{funding → routes}/routes/providers.d.ts +8 -8
  241. package/dist/apps/routes/routes/providers.d.ts.map +1 -0
  242. package/dist/apps/routes/routes/providers.js +57 -0
  243. package/dist/apps/routes/routes/providers.js.map +1 -0
  244. package/dist/apps/{funding → routes}/routes/quotes.d.ts +106 -103
  245. package/dist/apps/routes/routes/quotes.d.ts.map +1 -0
  246. package/dist/apps/{funding → routes}/routes/quotes.js +55 -38
  247. package/dist/apps/routes/routes/quotes.js.map +1 -0
  248. package/dist/apps/{funding → routes}/routes/transfers.d.ts +733 -428
  249. package/dist/apps/routes/routes/transfers.d.ts.map +1 -0
  250. package/dist/apps/routes/routes/transfers.js +1140 -0
  251. package/dist/apps/routes/routes/transfers.js.map +1 -0
  252. package/dist/cli/Cli.d.ts +30 -0
  253. package/dist/cli/Cli.d.ts.map +1 -1
  254. package/dist/cli/commands/admin.d.ts +36 -0
  255. package/dist/cli/commands/admin.d.ts.map +1 -1
  256. package/dist/cli/commands/admin.js +273 -0
  257. package/dist/cli/commands/admin.js.map +1 -1
  258. package/dist/cloudflare.d.ts +16 -14
  259. package/dist/cloudflare.d.ts.map +1 -1
  260. package/dist/cloudflare.js +26 -21
  261. package/dist/cloudflare.js.map +1 -1
  262. package/dist/db/Db.d.ts +63 -21
  263. package/dist/db/Db.d.ts.map +1 -1
  264. package/dist/db/Db.js +1035 -15
  265. package/dist/db/Db.js.map +1 -1
  266. package/dist/db/Schema.d.ts +780 -133
  267. package/dist/db/Schema.d.ts.map +1 -1
  268. package/dist/db/Schema.js +575 -162
  269. package/dist/db/Schema.js.map +1 -1
  270. package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts +4 -0
  271. package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts.map +1 -0
  272. package/dist/db/tables/apiKeyAdmissionBootstraps.js +2 -0
  273. package/dist/db/tables/apiKeyAdmissionBootstraps.js.map +1 -0
  274. package/dist/db/tables/apiKeyAdmissions.d.ts +73 -0
  275. package/dist/db/tables/apiKeyAdmissions.d.ts.map +1 -0
  276. package/dist/db/tables/apiKeyAdmissions.js +142 -0
  277. package/dist/db/tables/apiKeyAdmissions.js.map +1 -0
  278. package/dist/db/tables/apiKeyOwnerAdmissions.d.ts +4 -0
  279. package/dist/db/tables/apiKeyOwnerAdmissions.d.ts.map +1 -0
  280. package/dist/db/tables/apiKeyOwnerAdmissions.js +2 -0
  281. package/dist/db/tables/apiKeyOwnerAdmissions.js.map +1 -0
  282. package/dist/db/tables/apiKeyOwnerTombstones.d.ts +20 -0
  283. package/dist/db/tables/apiKeyOwnerTombstones.d.ts.map +1 -0
  284. package/dist/db/tables/apiKeyOwnerTombstones.js +57 -0
  285. package/dist/db/tables/apiKeyOwnerTombstones.js.map +1 -0
  286. package/dist/db/tables/apiKeyRevocations.d.ts +21 -0
  287. package/dist/db/tables/apiKeyRevocations.d.ts.map +1 -0
  288. package/dist/db/tables/apiKeyRevocations.js +98 -0
  289. package/dist/db/tables/apiKeyRevocations.js.map +1 -0
  290. package/dist/db/tables/authAccounts.d.ts +47 -0
  291. package/dist/db/tables/authAccounts.d.ts.map +1 -0
  292. package/dist/db/tables/authAccounts.js +72 -0
  293. package/dist/db/tables/authAccounts.js.map +1 -0
  294. package/dist/db/tables/authSessions.d.ts +12 -0
  295. package/dist/db/tables/authSessions.d.ts.map +1 -0
  296. package/dist/db/tables/authSessions.js +2 -0
  297. package/dist/db/tables/authSessions.js.map +1 -0
  298. package/dist/db/tables/authVerifications.d.ts +12 -0
  299. package/dist/db/tables/authVerifications.d.ts.map +1 -0
  300. package/dist/db/tables/authVerifications.js +2 -0
  301. package/dist/db/tables/authVerifications.js.map +1 -0
  302. package/dist/db/tables/invitations.d.ts +17 -1
  303. package/dist/db/tables/invitations.d.ts.map +1 -1
  304. package/dist/db/tables/invitations.js +123 -43
  305. package/dist/db/tables/invitations.js.map +1 -1
  306. package/dist/db/tables/memberships.d.ts +8 -0
  307. package/dist/db/tables/memberships.d.ts.map +1 -1
  308. package/dist/db/tables/memberships.js +51 -2
  309. package/dist/db/tables/memberships.js.map +1 -1
  310. package/dist/db/tables/organizations.d.ts +32 -10
  311. package/dist/db/tables/organizations.d.ts.map +1 -1
  312. package/dist/db/tables/organizations.js +110 -49
  313. package/dist/db/tables/organizations.js.map +1 -1
  314. package/dist/db/tables/projects.d.ts +2 -0
  315. package/dist/db/tables/projects.d.ts.map +1 -1
  316. package/dist/db/tables/projects.js +12 -3
  317. package/dist/db/tables/projects.js.map +1 -1
  318. package/dist/db/tables/requestUsage.d.ts.map +1 -1
  319. package/dist/db/tables/requestUsage.js.map +1 -1
  320. package/dist/db/tables/rewardAccounts.d.ts +86 -0
  321. package/dist/db/tables/rewardAccounts.d.ts.map +1 -0
  322. package/dist/db/tables/rewardAccounts.js +88 -0
  323. package/dist/db/tables/rewardAccounts.js.map +1 -0
  324. package/dist/db/tables/rewardCampaignDistributors.d.ts +36 -0
  325. package/dist/db/tables/rewardCampaignDistributors.d.ts.map +1 -0
  326. package/dist/db/tables/rewardCampaignDistributors.js +30 -0
  327. package/dist/db/tables/rewardCampaignDistributors.js.map +1 -0
  328. package/dist/db/tables/rewardCampaigns.d.ts +171 -0
  329. package/dist/db/tables/rewardCampaigns.d.ts.map +1 -0
  330. package/dist/db/tables/rewardCampaigns.js +392 -0
  331. package/dist/db/tables/rewardCampaigns.js.map +1 -0
  332. package/dist/db/tables/rewardCredits.d.ts +53 -0
  333. package/dist/db/tables/rewardCredits.d.ts.map +1 -0
  334. package/dist/db/tables/rewardCredits.js +63 -0
  335. package/dist/db/tables/rewardCredits.js.map +1 -0
  336. package/dist/db/tables/rewardEligibilityAssociations.d.ts +61 -0
  337. package/dist/db/tables/rewardEligibilityAssociations.d.ts.map +1 -0
  338. package/dist/db/tables/rewardEligibilityAssociations.js +103 -0
  339. package/dist/db/tables/rewardEligibilityAssociations.js.map +1 -0
  340. package/dist/db/tables/rewardRuns.d.ts +188 -0
  341. package/dist/db/tables/rewardRuns.d.ts.map +1 -0
  342. package/dist/db/tables/rewardRuns.js +278 -0
  343. package/dist/db/tables/rewardRuns.js.map +1 -0
  344. package/dist/db/tables/rewardTransactionAttempts.d.ts +100 -0
  345. package/dist/db/tables/rewardTransactionAttempts.d.ts.map +1 -0
  346. package/dist/db/tables/rewardTransactionAttempts.js +163 -0
  347. package/dist/db/tables/rewardTransactionAttempts.js.map +1 -0
  348. package/dist/db/tables/routesCatalog.d.ts +58 -0
  349. package/dist/db/tables/routesCatalog.d.ts.map +1 -0
  350. package/dist/db/tables/{fundingCatalog.js → routesCatalog.js} +19 -19
  351. package/dist/db/tables/routesCatalog.js.map +1 -0
  352. package/dist/db/tables/routesDepositAddresses.d.ts +476 -0
  353. package/dist/db/tables/routesDepositAddresses.d.ts.map +1 -0
  354. package/dist/db/tables/routesDepositAddresses.js +587 -0
  355. package/dist/db/tables/routesDepositAddresses.js.map +1 -0
  356. package/dist/db/tables/{fundingDepositRequestObservations.d.ts → routesDepositRequestObservations.d.ts} +6 -6
  357. package/dist/db/tables/routesDepositRequestObservations.d.ts.map +1 -0
  358. package/dist/db/tables/{fundingDepositRequestObservations.js → routesDepositRequestObservations.js} +6 -6
  359. package/dist/db/tables/routesDepositRequestObservations.js.map +1 -0
  360. package/dist/db/tables/{fundingDeposits.d.ts → routesDeposits.d.ts} +210 -22
  361. package/dist/db/tables/routesDeposits.d.ts.map +1 -0
  362. package/dist/db/tables/routesDeposits.js +576 -0
  363. package/dist/db/tables/routesDeposits.js.map +1 -0
  364. package/dist/db/tables/routesIdempotency.d.ts +166 -0
  365. package/dist/db/tables/routesIdempotency.d.ts.map +1 -0
  366. package/dist/db/tables/routesIdempotency.js +330 -0
  367. package/dist/db/tables/routesIdempotency.js.map +1 -0
  368. package/dist/db/tables/routesSubsidies.d.ts +27 -0
  369. package/dist/db/tables/routesSubsidies.d.ts.map +1 -0
  370. package/dist/db/tables/routesSubsidies.js +45 -0
  371. package/dist/db/tables/routesSubsidies.js.map +1 -0
  372. package/dist/db/tables/{fundingTransferEvents.d.ts → routesTransferEvents.d.ts} +3 -3
  373. package/dist/db/tables/routesTransferEvents.d.ts.map +1 -0
  374. package/dist/db/tables/{fundingTransferEvents.js → routesTransferEvents.js} +3 -3
  375. package/dist/db/tables/routesTransferEvents.js.map +1 -0
  376. package/dist/db/tables/routesTransferSubsidies.d.ts +19 -0
  377. package/dist/db/tables/routesTransferSubsidies.d.ts.map +1 -0
  378. package/dist/db/tables/routesTransferSubsidies.js +17 -0
  379. package/dist/db/tables/routesTransferSubsidies.js.map +1 -0
  380. package/dist/db/tables/routesTransferSubsidyNonces.d.ts +51 -0
  381. package/dist/db/tables/routesTransferSubsidyNonces.d.ts.map +1 -0
  382. package/dist/db/tables/routesTransferSubsidyNonces.js +82 -0
  383. package/dist/db/tables/routesTransferSubsidyNonces.js.map +1 -0
  384. package/dist/db/tables/routesTransferTransactions.d.ts +77 -0
  385. package/dist/db/tables/routesTransferTransactions.d.ts.map +1 -0
  386. package/dist/db/tables/{fundingTransferTransactions.js → routesTransferTransactions.js} +31 -13
  387. package/dist/db/tables/routesTransferTransactions.js.map +1 -0
  388. package/dist/db/tables/routesTransfers.d.ts +319 -0
  389. package/dist/db/tables/routesTransfers.d.ts.map +1 -0
  390. package/dist/db/tables/routesTransfers.js +372 -0
  391. package/dist/db/tables/routesTransfers.js.map +1 -0
  392. package/dist/db/tables/sponsoredTransactions.d.ts +75 -20
  393. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
  394. package/dist/db/tables/sponsoredTransactions.js +124 -54
  395. package/dist/db/tables/sponsoredTransactions.js.map +1 -1
  396. package/dist/db/tables/sponsorshipAttributions.d.ts +69 -0
  397. package/dist/db/tables/sponsorshipAttributions.d.ts.map +1 -0
  398. package/dist/db/tables/sponsorshipAttributions.js +77 -0
  399. package/dist/db/tables/sponsorshipAttributions.js.map +1 -0
  400. package/dist/db/tables/sponsorshipReconciliationCursors.d.ts +22 -0
  401. package/dist/db/tables/sponsorshipReconciliationCursors.d.ts.map +1 -0
  402. package/dist/db/tables/sponsorshipReconciliationCursors.js +45 -0
  403. package/dist/db/tables/sponsorshipReconciliationCursors.js.map +1 -0
  404. package/dist/db/tables/stripeCustomers.d.ts +11 -0
  405. package/dist/db/tables/stripeCustomers.d.ts.map +1 -1
  406. package/dist/db/tables/stripeCustomers.js +13 -0
  407. package/dist/db/tables/stripeCustomers.js.map +1 -1
  408. package/dist/db/tables/users.d.ts +17 -1
  409. package/dist/db/tables/users.d.ts.map +1 -1
  410. package/dist/db/tables/users.js +47 -2
  411. package/dist/db/tables/users.js.map +1 -1
  412. package/dist/db/tables/verifiedTokenRequests.d.ts +21 -4
  413. package/dist/db/tables/verifiedTokenRequests.d.ts.map +1 -1
  414. package/dist/db/tables/verifiedTokenRequests.js +65 -44
  415. package/dist/db/tables/verifiedTokenRequests.js.map +1 -1
  416. package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
  417. package/dist/db/tables/webhookQueueEvents.js +5 -1
  418. package/dist/db/tables/webhookQueueEvents.js.map +1 -1
  419. package/dist/db/tables/webhookSubscriptions.d.ts +19 -11
  420. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  421. package/dist/db/tables/webhookSubscriptions.js +45 -13
  422. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  423. package/dist/handlers/internal/executionError.d.ts +2 -2
  424. package/dist/handlers/internal/executionError.d.ts.map +1 -1
  425. package/dist/handlers/internal/executionError.js +1 -2
  426. package/dist/handlers/internal/executionError.js.map +1 -1
  427. package/dist/handlers/internal/multisig.d.ts +4 -232
  428. package/dist/handlers/internal/multisig.d.ts.map +1 -1
  429. package/dist/handlers/internal/multisig.js +11 -537
  430. package/dist/handlers/internal/multisig.js.map +1 -1
  431. package/dist/handlers/internal/sponsorship.d.ts +19 -8
  432. package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
  433. package/dist/handlers/internal/sponsorship.js +13 -9
  434. package/dist/handlers/internal/sponsorship.js.map +1 -1
  435. package/dist/handlers/relay.d.ts +9 -12
  436. package/dist/handlers/relay.d.ts.map +1 -1
  437. package/dist/handlers/relay.js +81 -85
  438. package/dist/handlers/relay.js.map +1 -1
  439. package/dist/index.d.ts +0 -17
  440. package/dist/index.d.ts.map +1 -1
  441. package/dist/index.js +0 -17
  442. package/dist/index.js.map +1 -1
  443. package/dist/internal/AssetResponse.d.ts +12 -0
  444. package/dist/internal/AssetResponse.d.ts.map +1 -0
  445. package/dist/internal/AssetResponse.js +21 -0
  446. package/dist/internal/AssetResponse.js.map +1 -0
  447. package/dist/internal/Auth.d.ts +64 -12
  448. package/dist/internal/Auth.d.ts.map +1 -1
  449. package/dist/internal/Auth.js +631 -180
  450. package/dist/internal/Auth.js.map +1 -1
  451. package/dist/internal/BetterAuth.d.ts +1488 -0
  452. package/dist/internal/BetterAuth.d.ts.map +1 -0
  453. package/dist/internal/BetterAuth.js +253 -0
  454. package/dist/internal/BetterAuth.js.map +1 -0
  455. package/dist/internal/Cache.d.ts +2 -0
  456. package/dist/internal/Cache.d.ts.map +1 -1
  457. package/dist/internal/Cache.js +2 -0
  458. package/dist/internal/Cache.js.map +1 -1
  459. package/dist/internal/EarnRates.d.ts +26 -3
  460. package/dist/internal/EarnRates.d.ts.map +1 -1
  461. package/dist/internal/EarnRates.js +84 -19
  462. package/dist/internal/EarnRates.js.map +1 -1
  463. package/dist/internal/EarnSharePrices.d.ts +120 -0
  464. package/dist/internal/EarnSharePrices.d.ts.map +1 -0
  465. package/dist/internal/EarnSharePrices.js +179 -0
  466. package/dist/internal/EarnSharePrices.js.map +1 -0
  467. package/dist/internal/EarnVaults.d.ts +4 -0
  468. package/dist/internal/EarnVaults.d.ts.map +1 -1
  469. package/dist/internal/EarnVaults.js +27 -10
  470. package/dist/internal/EarnVaults.js.map +1 -1
  471. package/dist/internal/Email.d.ts +37 -0
  472. package/dist/internal/Email.d.ts.map +1 -0
  473. package/dist/internal/Email.js +16 -0
  474. package/dist/internal/Email.js.map +1 -0
  475. package/dist/internal/Log.d.ts +32 -28
  476. package/dist/internal/Log.d.ts.map +1 -1
  477. package/dist/internal/Log.js +18 -11
  478. package/dist/internal/Log.js.map +1 -1
  479. package/dist/internal/MetricSink.d.ts +3 -0
  480. package/dist/internal/MetricSink.d.ts.map +1 -1
  481. package/dist/internal/MetricSink.js +67 -8
  482. package/dist/internal/MetricSink.js.map +1 -1
  483. package/dist/internal/Mpp.d.ts.map +1 -1
  484. package/dist/internal/Mpp.js +20 -25
  485. package/dist/internal/Mpp.js.map +1 -1
  486. package/dist/internal/OpenApi.d.ts +26 -3
  487. package/dist/internal/OpenApi.d.ts.map +1 -1
  488. package/dist/internal/OpenApi.js +25 -10
  489. package/dist/internal/OpenApi.js.map +1 -1
  490. package/dist/internal/Provider.d.ts +1 -1
  491. package/dist/internal/Provider.d.ts.map +1 -1
  492. package/dist/internal/RateLimit.d.ts.map +1 -1
  493. package/dist/internal/RateLimit.js +13 -1
  494. package/dist/internal/RateLimit.js.map +1 -1
  495. package/dist/internal/Store.d.ts +16 -0
  496. package/dist/internal/Store.d.ts.map +1 -1
  497. package/dist/internal/Store.js +59 -8
  498. package/dist/internal/Store.js.map +1 -1
  499. package/dist/internal/Tidx.d.ts +9 -2
  500. package/dist/internal/Tidx.d.ts.map +1 -1
  501. package/dist/internal/Tidx.js +78 -11
  502. package/dist/internal/Tidx.js.map +1 -1
  503. package/dist/internal/Timing.d.ts +26 -0
  504. package/dist/internal/Timing.d.ts.map +1 -1
  505. package/dist/internal/Timing.js +63 -5
  506. package/dist/internal/Timing.js.map +1 -1
  507. package/dist/internal/VercelOidc.d.ts +94 -0
  508. package/dist/internal/VercelOidc.d.ts.map +1 -0
  509. package/dist/internal/VercelOidc.js +128 -0
  510. package/dist/internal/VercelOidc.js.map +1 -0
  511. package/dist/internal/VerifiedTokens.d.ts +2 -8
  512. package/dist/internal/VerifiedTokens.d.ts.map +1 -1
  513. package/dist/internal/VerifiedTokens.js +24 -24
  514. package/dist/internal/VerifiedTokens.js.map +1 -1
  515. package/dist/internal/Viem.d.ts +30 -2067
  516. package/dist/internal/Viem.d.ts.map +1 -1
  517. package/dist/internal/Viem.js +167 -17
  518. package/dist/internal/Viem.js.map +1 -1
  519. package/dist/internal/Webhooks.d.ts +12 -4
  520. package/dist/internal/Webhooks.d.ts.map +1 -1
  521. package/dist/internal/Webhooks.js +9 -3
  522. package/dist/internal/Webhooks.js.map +1 -1
  523. package/dist/internal/ZoneRpc.d.ts +7 -0
  524. package/dist/internal/ZoneRpc.d.ts.map +1 -0
  525. package/dist/internal/ZoneRpc.js +49 -0
  526. package/dist/internal/ZoneRpc.js.map +1 -0
  527. package/dist/internal/index.d.ts +3 -1
  528. package/dist/internal/index.d.ts.map +1 -1
  529. package/dist/internal/index.js +3 -1
  530. package/dist/internal/index.js.map +1 -1
  531. package/dist/internal/rewards/Audit.d.ts +88 -0
  532. package/dist/internal/rewards/Audit.d.ts.map +1 -0
  533. package/dist/internal/rewards/Audit.js +134 -0
  534. package/dist/internal/rewards/Audit.js.map +1 -0
  535. package/dist/internal/rewards/Campaigns.d.ts +572 -0
  536. package/dist/internal/rewards/Campaigns.d.ts.map +1 -0
  537. package/dist/internal/rewards/Campaigns.js +531 -0
  538. package/dist/internal/rewards/Campaigns.js.map +1 -0
  539. package/dist/internal/rewards/Credits.d.ts +76 -0
  540. package/dist/internal/rewards/Credits.d.ts.map +1 -0
  541. package/dist/internal/rewards/Credits.js +95 -0
  542. package/dist/internal/rewards/Credits.js.map +1 -0
  543. package/dist/internal/rewards/Events.d.ts +100 -0
  544. package/dist/internal/rewards/Events.d.ts.map +1 -0
  545. package/dist/internal/rewards/Events.js +340 -0
  546. package/dist/internal/rewards/Events.js.map +1 -0
  547. package/dist/internal/rewards/Projection.d.ts +237 -0
  548. package/dist/internal/rewards/Projection.d.ts.map +1 -0
  549. package/dist/internal/rewards/Projection.js +616 -0
  550. package/dist/internal/rewards/Projection.js.map +1 -0
  551. package/dist/internal/rewards/Rates.d.ts +44 -0
  552. package/dist/internal/rewards/Rates.d.ts.map +1 -0
  553. package/dist/internal/rewards/Rates.js +60 -0
  554. package/dist/internal/rewards/Rates.js.map +1 -0
  555. package/dist/internal/rewards/Read.d.ts +158 -0
  556. package/dist/internal/rewards/Read.d.ts.map +1 -0
  557. package/dist/internal/rewards/Read.js +292 -0
  558. package/dist/internal/rewards/Read.js.map +1 -0
  559. package/dist/internal/rewards/Runner.d.ts +164 -0
  560. package/dist/internal/rewards/Runner.d.ts.map +1 -0
  561. package/dist/internal/rewards/Runner.js +1778 -0
  562. package/dist/internal/rewards/Runner.js.map +1 -0
  563. package/dist/internal/rewards/Signer.d.ts +224 -0
  564. package/dist/internal/rewards/Signer.d.ts.map +1 -0
  565. package/dist/internal/rewards/Signer.js +135 -0
  566. package/dist/internal/rewards/Signer.js.map +1 -0
  567. package/dist/internal/rewards/index.d.ts +15 -0
  568. package/dist/internal/rewards/index.d.ts.map +1 -0
  569. package/dist/internal/rewards/index.js +15 -0
  570. package/dist/internal/rewards/index.js.map +1 -0
  571. package/dist/internal/{funding → routes}/Action.d.ts +12 -1
  572. package/dist/internal/routes/Action.d.ts.map +1 -0
  573. package/dist/internal/{funding → routes}/Action.js +17 -9
  574. package/dist/internal/routes/Action.js.map +1 -0
  575. package/dist/internal/{funding → routes}/Catalog.d.ts +20 -20
  576. package/dist/internal/routes/Catalog.d.ts.map +1 -0
  577. package/dist/internal/{funding → routes}/Catalog.js +29 -29
  578. package/dist/internal/routes/Catalog.js.map +1 -0
  579. package/dist/internal/{funding → routes}/Chain.d.ts +10 -10
  580. package/dist/internal/routes/Chain.d.ts.map +1 -0
  581. package/dist/internal/{funding → routes}/Chain.js +3 -3
  582. package/dist/internal/routes/Chain.js.map +1 -0
  583. package/dist/internal/{funding → routes}/Deposit.d.ts +45 -23
  584. package/dist/internal/routes/Deposit.d.ts.map +1 -0
  585. package/dist/internal/{funding → routes}/Deposit.js +60 -27
  586. package/dist/internal/routes/Deposit.js.map +1 -0
  587. package/dist/internal/{funding → routes}/DepositAddress.d.ts +56 -27
  588. package/dist/internal/routes/DepositAddress.d.ts.map +1 -0
  589. package/dist/internal/{funding → routes}/DepositAddress.js +95 -33
  590. package/dist/internal/routes/DepositAddress.js.map +1 -0
  591. package/dist/internal/{funding → routes}/DepositWebhook.d.ts +4 -4
  592. package/dist/internal/routes/DepositWebhook.d.ts.map +1 -0
  593. package/dist/internal/{funding → routes}/DepositWebhook.js +4 -4
  594. package/dist/internal/routes/DepositWebhook.js.map +1 -0
  595. package/dist/internal/routes/Economics.d.ts +25 -0
  596. package/dist/internal/routes/Economics.d.ts.map +1 -0
  597. package/dist/internal/routes/Economics.js +28 -0
  598. package/dist/internal/routes/Economics.js.map +1 -0
  599. package/dist/internal/{funding → routes}/Evidence.d.ts +3 -3
  600. package/dist/internal/routes/Evidence.d.ts.map +1 -0
  601. package/dist/internal/{funding → routes}/Evidence.js +7 -7
  602. package/dist/internal/routes/Evidence.js.map +1 -0
  603. package/dist/internal/routes/Observability.d.ts +154 -0
  604. package/dist/internal/routes/Observability.d.ts.map +1 -0
  605. package/dist/internal/routes/Observability.js +389 -0
  606. package/dist/internal/routes/Observability.js.map +1 -0
  607. package/dist/internal/{funding → routes}/Provider.d.ts +311 -105
  608. package/dist/internal/routes/Provider.d.ts.map +1 -0
  609. package/dist/internal/{funding → routes}/Provider.js +229 -98
  610. package/dist/internal/routes/Provider.js.map +1 -0
  611. package/dist/internal/{funding → routes}/Reconciliation.d.ts +11 -6
  612. package/dist/internal/routes/Reconciliation.d.ts.map +1 -0
  613. package/dist/internal/{funding → routes}/Reconciliation.js +408 -158
  614. package/dist/internal/routes/Reconciliation.js.map +1 -0
  615. package/dist/internal/routes/Route.d.ts +21 -0
  616. package/dist/internal/routes/Route.d.ts.map +1 -0
  617. package/dist/internal/{funding → routes}/Route.js +1 -1
  618. package/dist/internal/routes/Route.js.map +1 -0
  619. package/dist/internal/{funding → routes}/SourceObservation.d.ts +6 -6
  620. package/dist/internal/routes/SourceObservation.d.ts.map +1 -0
  621. package/dist/internal/{funding → routes}/SourceObservation.js +8 -8
  622. package/dist/internal/routes/SourceObservation.js.map +1 -0
  623. package/dist/internal/{funding → routes}/Subsidy.d.ts +48 -3
  624. package/dist/internal/routes/Subsidy.d.ts.map +1 -0
  625. package/dist/internal/{funding → routes}/Subsidy.js +43 -3
  626. package/dist/internal/routes/Subsidy.js.map +1 -0
  627. package/dist/internal/{funding → routes}/Token.d.ts +4 -4
  628. package/dist/internal/routes/Token.d.ts.map +1 -0
  629. package/dist/internal/{funding → routes}/Token.js +3 -3
  630. package/dist/internal/routes/Token.js.map +1 -0
  631. package/dist/internal/{funding → routes}/Transfer.d.ts +241 -46
  632. package/dist/internal/routes/Transfer.d.ts.map +1 -0
  633. package/dist/internal/routes/Transfer.js +728 -0
  634. package/dist/internal/routes/Transfer.js.map +1 -0
  635. package/dist/internal/{funding → routes}/TransferReconciliation.d.ts +13 -10
  636. package/dist/internal/routes/TransferReconciliation.d.ts.map +1 -0
  637. package/dist/internal/routes/TransferReconciliation.js +422 -0
  638. package/dist/internal/routes/TransferReconciliation.js.map +1 -0
  639. package/dist/internal/routes/TransferSubsidy.d.ts +201 -0
  640. package/dist/internal/routes/TransferSubsidy.d.ts.map +1 -0
  641. package/dist/internal/routes/TransferSubsidy.js +256 -0
  642. package/dist/internal/routes/TransferSubsidy.js.map +1 -0
  643. package/dist/internal/{funding → routes}/TransferWebhook.d.ts +5 -5
  644. package/dist/internal/routes/TransferWebhook.d.ts.map +1 -0
  645. package/dist/internal/{funding → routes}/TransferWebhook.js +3 -3
  646. package/dist/internal/routes/TransferWebhook.js.map +1 -0
  647. package/dist/internal/{funding → routes}/index.d.ts +2 -0
  648. package/dist/internal/routes/index.d.ts.map +1 -0
  649. package/dist/internal/{funding → routes}/index.js +2 -0
  650. package/dist/internal/routes/index.js.map +1 -0
  651. package/dist/internal/{funding → routes}/providers/across.d.ts +4 -4
  652. package/dist/internal/routes/providers/across.d.ts.map +1 -0
  653. package/dist/internal/{funding → routes}/providers/across.js +13 -13
  654. package/dist/internal/routes/providers/across.js.map +1 -0
  655. package/dist/internal/{funding → routes}/providers/relay.d.ts +21 -12
  656. package/dist/internal/routes/providers/relay.d.ts.map +1 -0
  657. package/dist/internal/{funding → routes}/providers/relay.js +194 -110
  658. package/dist/internal/routes/providers/relay.js.map +1 -0
  659. package/dist/internal/{funding → routes}/providers/rhino.d.ts +4 -4
  660. package/dist/internal/routes/providers/rhino.d.ts.map +1 -0
  661. package/dist/internal/{funding → routes}/providers/rhino.js +10 -10
  662. package/dist/internal/routes/providers/rhino.js.map +1 -0
  663. package/dist/internal/{funding → routes}/providers/squid.d.ts +4 -4
  664. package/dist/internal/routes/providers/squid.d.ts.map +1 -0
  665. package/dist/internal/{funding → routes}/providers/squid.js +14 -14
  666. package/dist/internal/routes/providers/squid.js.map +1 -0
  667. package/dist/internal/{funding → routes}/providers/stargate.d.ts +46 -18
  668. package/dist/internal/routes/providers/stargate.d.ts.map +1 -0
  669. package/dist/internal/routes/providers/stargate.js +898 -0
  670. package/dist/internal/routes/providers/stargate.js.map +1 -0
  671. package/dist/internal/{funding → routes}/providers/symbiosis.d.ts +4 -4
  672. package/dist/internal/routes/providers/symbiosis.d.ts.map +1 -0
  673. package/dist/internal/{funding → routes}/providers/symbiosis.js +30 -20
  674. package/dist/internal/routes/providers/symbiosis.js.map +1 -0
  675. package/dist/internal/webhookDestinations/slack.js +12 -12
  676. package/dist/internal/webhookDestinations/slack.js.map +1 -1
  677. package/dist/providers/index.d.ts +12 -12
  678. package/dist/providers/index.d.ts.map +1 -1
  679. package/dist/providers/index.js +12 -12
  680. package/dist/providers/index.js.map +1 -1
  681. package/dist/server.d.ts +19 -0
  682. package/dist/server.d.ts.map +1 -0
  683. package/dist/server.js +19 -0
  684. package/dist/server.js.map +1 -0
  685. package/package.json +15 -4
  686. package/src/ApiKey.ts +1 -1
  687. package/src/ApiKeys.test.ts +1033 -3
  688. package/src/ApiKeys.ts +489 -48
  689. package/src/App.test-d.ts +1 -1
  690. package/src/App.test.ts +216 -25
  691. package/src/App.ts +334 -31
  692. package/src/Assets.test.ts +2 -2
  693. package/src/Assets.ts +3 -1
  694. package/src/Auth.test-d.ts +1 -1
  695. package/src/Client.test-d.ts +539 -110
  696. package/src/Handler.ts +0 -1
  697. package/src/OpenApi.contract.test.ts +195 -0
  698. package/src/Scope.ts +17 -5
  699. package/src/Webhooks.ts +1 -1
  700. package/src/admin/App.test.ts +30 -2
  701. package/src/admin/App.ts +42 -6
  702. package/src/admin/apps/api-keys.test.ts +267 -5
  703. package/src/admin/apps/api-keys.ts +100 -50
  704. package/src/admin/apps/earn-vaults.test.ts +158 -0
  705. package/src/admin/apps/earn-vaults.ts +679 -6
  706. package/src/admin/apps/organizations.test.ts +306 -17
  707. package/src/admin/apps/organizations.ts +299 -24
  708. package/src/admin/apps/routes-support.test.ts +200 -0
  709. package/src/admin/apps/routes-support.ts +201 -0
  710. package/src/admin/apps/routes.test.ts +450 -0
  711. package/src/admin/apps/routes.ts +896 -0
  712. package/src/admin/apps/scopes.test.ts +15 -5
  713. package/src/admin/apps/subsidies.test.ts +306 -0
  714. package/src/admin/apps/subsidies.ts +457 -0
  715. package/src/admin/apps/verified-tokens.test.ts +40 -3
  716. package/src/admin/apps/verified-tokens.ts +33 -7
  717. package/src/admin/ui/plugin.ts +1 -2
  718. package/src/admin/ui/src/components/RewardCampaignForm.tsx +1009 -0
  719. package/src/admin/ui/src/lib/config.ts +11 -2
  720. package/src/admin/ui/src/lib/earn-vaults.ts +2 -2
  721. package/src/admin/ui/src/lib/organizations.test.ts +83 -50
  722. package/src/admin/ui/src/lib/organizations.ts +106 -25
  723. package/src/admin/ui/src/lib/query-client.ts +1 -1
  724. package/src/admin/ui/src/lib/reward-campaigns.ts +136 -0
  725. package/src/admin/ui/src/lib/routes.test.ts +88 -0
  726. package/src/admin/ui/src/lib/routes.ts +304 -0
  727. package/src/admin/ui/src/lib/subsidies.ts +75 -0
  728. package/src/admin/ui/src/lib/verified-tokens.ts +24 -9
  729. package/src/admin/ui/src/routeTree.gen.ts +63 -0
  730. package/src/admin/ui/src/routes/__root.tsx +13 -2
  731. package/src/admin/ui/src/routes/api-keys.tsx +196 -84
  732. package/src/admin/ui/src/routes/earn.vaults_.$vaultId.edit.tsx +105 -70
  733. package/src/admin/ui/src/routes/organizations.tsx +34 -4
  734. package/src/admin/ui/src/routes/organizations_.$orgId.tsx +239 -23
  735. package/src/admin/ui/src/routes/routes.tsx +1615 -0
  736. package/src/admin/ui/src/routes/routes_.support.tsx +248 -0
  737. package/src/admin/ui/src/routes/subsidies.tsx +799 -0
  738. package/src/admin/ui/src/routes/verified-tokens.tsx +64 -20
  739. package/src/admin/ui.generated.ts +202 -188
  740. package/src/analytics/Analytics.test.ts +108 -18
  741. package/src/analytics/Analytics.ts +38 -6
  742. package/src/analytics/tables/requestEvents.test.ts +100 -0
  743. package/src/analytics/tables/requestEvents.ts +10 -1
  744. package/src/analytics/tables/routesLifecycleIntervals.ts +140 -0
  745. package/src/apps/Zones.test.ts +15 -0
  746. package/src/apps/Zones.ts +52 -5
  747. package/src/apps/composition.test.ts +68 -60
  748. package/src/apps/data/App.test.ts +180 -2
  749. package/src/apps/data/App.ts +88 -28
  750. package/src/apps/data/routes/activities.test.ts +419 -7
  751. package/src/apps/data/routes/activities.ts +683 -216
  752. package/src/apps/data/routes/balances.test.ts +2 -2
  753. package/src/apps/data/routes/blocks.test.ts +46 -1
  754. package/src/apps/data/routes/coingecko.test.ts +419 -1
  755. package/src/apps/data/routes/coingecko.ts +309 -253
  756. package/src/apps/data/routes/earn.discovery.test.ts +274 -0
  757. package/src/apps/data/routes/earn.test.ts +1294 -17
  758. package/src/apps/data/routes/earn.ts +1838 -321
  759. package/src/apps/data/routes/exchanges.test.ts +12 -15
  760. package/src/apps/data/routes/fee-amm.test.ts +243 -0
  761. package/src/apps/data/routes/fee-amm.ts +201 -162
  762. package/src/apps/data/routes/indexer.test.ts +389 -0
  763. package/src/apps/data/routes/indexer.ts +165 -69
  764. package/src/apps/data/routes/receipts.test.ts +1 -1
  765. package/src/apps/data/routes/rpc.test.ts +384 -8
  766. package/src/apps/data/routes/rpc.ts +452 -227
  767. package/src/apps/data/routes/rpc.zone.test.ts +340 -0
  768. package/src/apps/data/routes/tokenlist.test.ts +285 -0
  769. package/src/apps/data/routes/tokenlist.ts +173 -88
  770. package/src/apps/data/routes/tokens.test.ts +93 -3
  771. package/src/apps/data/routes/tokens.ts +39 -23
  772. package/src/apps/data/routes/transactions.test.ts +1 -1
  773. package/src/apps/data/routes/transfers.test.ts +56 -24
  774. package/src/apps/data/routes/transfers.ts +19 -8
  775. package/src/apps/data/routes/valuation.test.ts +1 -1
  776. package/src/apps/data/routes/verified-tokens.test.ts +345 -0
  777. package/src/apps/data/routes/verified-tokens.ts +99 -29
  778. package/src/apps/data/routes/webhooks.scan.test.ts +29 -0
  779. package/src/apps/data/routes/webhooks.test.ts +651 -83
  780. package/src/apps/data/routes/webhooks.ts +1113 -868
  781. package/src/apps/data/routes/zones.test.ts +148 -71
  782. package/src/apps/data/routes/zones.ts +71 -55
  783. package/src/apps/docs/reference.ts +2 -2
  784. package/src/apps/index.ts +1 -1
  785. package/src/apps/management/App.ts +9 -51
  786. package/src/apps/management/Billing.test.ts +375 -14
  787. package/src/apps/management/Billing.ts +265 -29
  788. package/src/apps/management/routes/api-keys.test.ts +269 -7
  789. package/src/apps/management/routes/api-keys.ts +61 -20
  790. package/src/apps/management/routes/billing.test.ts +477 -15
  791. package/src/apps/management/routes/billing.ts +377 -50
  792. package/src/apps/management/routes/faucet.test.ts +1 -1
  793. package/src/apps/management/routes/faucet.ts +1 -1
  794. package/src/apps/management/routes/invitations.test.ts +270 -3
  795. package/src/apps/management/routes/invitations.ts +185 -15
  796. package/src/apps/management/routes/invoicePreview.test.ts +549 -0
  797. package/src/apps/management/routes/me.test.ts +246 -5
  798. package/src/apps/management/routes/me.ts +7 -2
  799. package/src/apps/management/routes/members.test.ts +108 -0
  800. package/src/apps/management/routes/orgs.test.ts +191 -3
  801. package/src/apps/management/routes/orgs.ts +58 -11
  802. package/src/apps/management/routes/projects.test.ts +33 -3
  803. package/src/apps/management/routes/projects.ts +6 -1
  804. package/src/apps/management/routes/scopes.test.ts +30 -2
  805. package/src/apps/management/routes/scopes.ts +4 -1
  806. package/src/apps/management/routes/usage.test.ts +32 -0
  807. package/src/apps/management/routes/usage.ts +22 -4
  808. package/src/apps/management/routes/verified-token-requests.test.ts +16 -2
  809. package/src/apps/management/routes/verified-token-requests.ts +7 -10
  810. package/src/apps/management/routes/webhooks.test.ts +49 -26
  811. package/src/apps/management/routes/webhooks.ts +78 -22
  812. package/src/apps/mcp.test.ts +113 -30
  813. package/src/apps/mcp.ts +22 -10
  814. package/src/apps/mpp/App.ts +37 -7
  815. package/src/apps/mpp/Mpp.test.ts +49 -8
  816. package/src/apps/mpp/Mpp.zone.test.ts +219 -0
  817. package/src/apps/mpp/internal/Adapter.ts +34 -0
  818. package/src/apps/mpp/internal/Policy.test.ts +86 -31
  819. package/src/apps/mpp/internal/Policy.ts +49 -7
  820. package/src/apps/mpp/internal/Sponsorship.test.ts +207 -0
  821. package/src/apps/mpp/internal/Sponsorship.ts +9 -3
  822. package/src/apps/relay/App.test.ts +839 -64
  823. package/src/apps/relay/App.ts +148 -81
  824. package/src/apps/relay/App.zone-billing.test.ts +257 -0
  825. package/src/apps/relay/Sponsorships.test.ts +67 -4
  826. package/src/apps/relay/Sponsorships.ts +233 -32
  827. package/src/apps/relay/Sponsorships.zone.test.ts +102 -0
  828. package/src/apps/{funding → routes}/Access.ts +6 -6
  829. package/src/apps/routes/App.test.ts +165 -0
  830. package/src/apps/routes/App.ts +96 -0
  831. package/src/apps/{funding → routes}/Inventory.ts +2 -2
  832. package/src/apps/routes/index.ts +1 -0
  833. package/src/apps/{funding → routes}/routes/chains.test.ts +66 -66
  834. package/src/apps/{funding → routes}/routes/chains.ts +23 -23
  835. package/src/apps/{funding → routes}/routes/deposit-addresses.test.ts +1358 -458
  836. package/src/apps/{funding → routes}/routes/deposit-addresses.ts +566 -246
  837. package/src/apps/{funding → routes}/routes/providers.test.ts +27 -33
  838. package/src/apps/{funding → routes}/routes/providers.ts +23 -23
  839. package/src/apps/{funding → routes}/routes/quotes.test.ts +298 -41
  840. package/src/apps/{funding → routes}/routes/quotes.ts +57 -40
  841. package/src/apps/{funding → routes}/routes/transfers.test.ts +1100 -353
  842. package/src/apps/routes/routes/transfers.ts +1332 -0
  843. package/src/cli/Cli.test.ts +1 -1
  844. package/src/cli/commands/admin.test.ts +748 -1
  845. package/src/cli/commands/admin.ts +278 -0
  846. package/src/cloudflare.ts +52 -47
  847. package/src/db/Db.test.ts +245 -2
  848. package/src/db/Db.ts +1485 -34
  849. package/src/db/Schema.ts +729 -228
  850. package/src/db/tables/apiKeyAdmissionBootstraps.ts +4 -0
  851. package/src/db/tables/apiKeyAdmissions.ts +218 -0
  852. package/src/db/tables/apiKeyOwnerAdmissions.ts +4 -0
  853. package/src/db/tables/apiKeyOwnerTombstones.ts +81 -0
  854. package/src/db/tables/apiKeyRevocations.test.ts +74 -0
  855. package/src/db/tables/apiKeyRevocations.ts +121 -0
  856. package/src/db/tables/authAccounts.ts +105 -0
  857. package/src/db/tables/authSessions.ts +13 -0
  858. package/src/db/tables/authVerifications.ts +13 -0
  859. package/src/db/tables/invitations.ts +142 -45
  860. package/src/db/tables/memberships.ts +79 -3
  861. package/src/db/tables/organizations.test.ts +690 -13
  862. package/src/db/tables/organizations.ts +139 -55
  863. package/src/db/tables/projects.test.ts +16 -0
  864. package/src/db/tables/projects.ts +13 -3
  865. package/src/db/tables/requestUsage.ts +4 -1
  866. package/src/db/tables/rewardAccounts.ts +178 -0
  867. package/src/db/tables/rewardCampaignDistributors.ts +68 -0
  868. package/src/db/tables/rewardCampaigns.test.ts +1388 -0
  869. package/src/db/tables/rewardCampaigns.ts +647 -0
  870. package/src/db/tables/rewardCredits.ts +110 -0
  871. package/src/db/tables/rewardEligibilityAssociations.test.ts +271 -0
  872. package/src/db/tables/rewardEligibilityAssociations.ts +184 -0
  873. package/src/db/tables/rewardRuns.ts +514 -0
  874. package/src/db/tables/rewardTransactionAttempts.ts +272 -0
  875. package/src/db/tables/routesCatalog.test.ts +185 -0
  876. package/src/db/tables/routesCatalog.ts +163 -0
  877. package/src/db/tables/routesDepositAddresses.test.ts +1048 -0
  878. package/src/db/tables/routesDepositAddresses.ts +1008 -0
  879. package/src/db/tables/{fundingDepositRequestObservations.test.ts → routesDepositRequestObservations.test.ts} +13 -14
  880. package/src/db/tables/{fundingDepositRequestObservations.ts → routesDepositRequestObservations.ts} +10 -10
  881. package/src/db/tables/{fundingDeposits.test.ts → routesDeposits.test.ts} +388 -46
  882. package/src/db/tables/routesDeposits.ts +1062 -0
  883. package/src/db/tables/routesIdempotency.test.ts +796 -0
  884. package/src/db/tables/routesIdempotency.ts +496 -0
  885. package/src/db/tables/routesSubsidies.test.ts +120 -0
  886. package/src/db/tables/routesSubsidies.ts +71 -0
  887. package/src/db/tables/{fundingTransferEvents.ts → routesTransferEvents.ts} +4 -4
  888. package/src/db/tables/routesTransferSubsidies.ts +38 -0
  889. package/src/db/tables/routesTransferSubsidyNonces.ts +124 -0
  890. package/src/db/tables/routesTransferTransactions.test.ts +195 -0
  891. package/src/db/tables/{fundingTransferTransactions.ts → routesTransferTransactions.ts} +63 -18
  892. package/src/db/tables/routesTransfers.test.ts +338 -0
  893. package/src/db/tables/routesTransfers.ts +662 -0
  894. package/src/db/tables/sponsoredTransactions.test.ts +269 -45
  895. package/src/db/tables/sponsoredTransactions.ts +225 -65
  896. package/src/db/tables/sponsorshipAttributions.test.ts +160 -0
  897. package/src/db/tables/sponsorshipAttributions.ts +168 -0
  898. package/src/db/tables/sponsorshipReconciliationCursors.test.ts +115 -0
  899. package/src/db/tables/sponsorshipReconciliationCursors.ts +67 -0
  900. package/src/db/tables/stripeCustomers.test.ts +85 -0
  901. package/src/db/tables/stripeCustomers.ts +24 -0
  902. package/src/db/tables/users.test.ts +129 -0
  903. package/src/db/tables/users.ts +49 -3
  904. package/src/db/tables/verifiedTokenRequests.test.ts +39 -20
  905. package/src/db/tables/verifiedTokenRequests.ts +80 -44
  906. package/src/db/tables/webhookQueueEvents.ts +8 -1
  907. package/src/db/tables/webhookSubscriptions.ts +95 -20
  908. package/src/handlers/internal/executionError.ts +3 -4
  909. package/src/handlers/internal/multisig.ts +13 -816
  910. package/src/handlers/internal/sponsorship.ts +26 -10
  911. package/src/handlers/relay.test-d.ts +9 -1
  912. package/src/handlers/relay.test.ts +823 -3
  913. package/src/handlers/relay.ts +127 -107
  914. package/src/index.test-d.ts +7 -0
  915. package/src/index.ts +0 -17
  916. package/src/internal/AssetResponse.ts +26 -0
  917. package/src/internal/Auth.test.ts +1656 -9
  918. package/src/internal/Auth.ts +880 -244
  919. package/src/internal/BetterAuth.test.ts +242 -0
  920. package/src/internal/BetterAuth.ts +349 -0
  921. package/src/internal/Cache.ts +2 -0
  922. package/src/internal/EarnRates.test.ts +17 -0
  923. package/src/internal/EarnRates.ts +124 -31
  924. package/src/internal/EarnSharePrices.test.ts +182 -0
  925. package/src/internal/EarnSharePrices.ts +313 -0
  926. package/src/internal/EarnVaults.test.ts +21 -0
  927. package/src/internal/EarnVaults.ts +33 -11
  928. package/src/internal/Email.ts +54 -0
  929. package/src/internal/Idempotency.test.ts +2 -2
  930. package/src/internal/Log.test-d.ts +8 -7
  931. package/src/internal/Log.test.ts +114 -16
  932. package/src/internal/Log.ts +53 -40
  933. package/src/internal/MetricSink.test.ts +313 -26
  934. package/src/internal/MetricSink.ts +73 -8
  935. package/src/internal/Mpp.test.ts +31 -0
  936. package/src/internal/Mpp.ts +21 -24
  937. package/src/internal/OpenApi.ts +45 -12
  938. package/src/internal/Provider.test.ts +1 -1
  939. package/src/internal/Provider.ts +1 -1
  940. package/src/internal/RateLimit.test.ts +21 -3
  941. package/src/internal/RateLimit.ts +12 -1
  942. package/src/internal/Store.test-d.ts +1 -1
  943. package/src/internal/Store.test.ts +151 -8
  944. package/src/internal/Store.ts +76 -9
  945. package/src/internal/Tidx.test.ts +59 -8
  946. package/src/internal/Tidx.ts +86 -14
  947. package/src/internal/Timing.test.ts +77 -0
  948. package/src/internal/Timing.ts +83 -6
  949. package/src/internal/VercelOidc.test.ts +188 -0
  950. package/src/internal/VercelOidc.ts +193 -0
  951. package/src/internal/VerifiedTokens.test.ts +60 -6
  952. package/src/internal/VerifiedTokens.ts +21 -24
  953. package/src/internal/Viem.batch.test.ts +80 -0
  954. package/src/internal/Viem.test.ts +201 -2
  955. package/src/internal/Viem.ts +221 -25
  956. package/src/internal/Webhooks.test.ts +85 -6
  957. package/src/internal/Webhooks.ts +22 -4
  958. package/src/internal/ZoneRpc.ts +50 -0
  959. package/src/internal/exchange/Provider.test.ts +2 -2
  960. package/src/internal/index.test.ts +3 -1
  961. package/src/internal/index.ts +3 -1
  962. package/src/internal/rewards/Audit.ts +231 -0
  963. package/src/internal/rewards/Campaigns.test.ts +1234 -0
  964. package/src/internal/rewards/Campaigns.ts +1205 -0
  965. package/src/internal/rewards/Credits.ts +165 -0
  966. package/src/internal/rewards/Events.local.test.ts +113 -0
  967. package/src/internal/rewards/Events.test.ts +152 -0
  968. package/src/internal/rewards/Events.ts +468 -0
  969. package/src/internal/rewards/Projection.test.ts +681 -0
  970. package/src/internal/rewards/Projection.ts +987 -0
  971. package/src/internal/rewards/Rates.test.ts +171 -0
  972. package/src/internal/rewards/Rates.ts +110 -0
  973. package/src/internal/rewards/Read.test.ts +501 -0
  974. package/src/internal/rewards/Read.ts +476 -0
  975. package/src/internal/rewards/Runner.checkpoint.test.ts +80 -0
  976. package/src/internal/rewards/Runner.states.test.ts +188 -0
  977. package/src/internal/rewards/Runner.test.ts +90 -0
  978. package/src/internal/rewards/Runner.ts +2229 -0
  979. package/src/internal/rewards/Signer.test.ts +79 -0
  980. package/src/internal/rewards/Signer.ts +180 -0
  981. package/src/internal/rewards/index.ts +14 -0
  982. package/src/internal/{funding → routes}/Action.test.ts +63 -14
  983. package/src/internal/{funding → routes}/Action.ts +35 -8
  984. package/src/internal/{funding → routes}/Catalog.test.ts +3 -3
  985. package/src/internal/{funding → routes}/Catalog.ts +39 -39
  986. package/src/internal/{funding → routes}/Chain.test.ts +1 -1
  987. package/src/internal/{funding → routes}/Chain.ts +11 -11
  988. package/src/internal/{funding → routes}/Deposit.test.ts +1 -1
  989. package/src/internal/{funding → routes}/Deposit.ts +93 -45
  990. package/src/internal/{funding → routes}/DepositAddress.test.ts +11 -3
  991. package/src/internal/{funding → routes}/DepositAddress.ts +132 -53
  992. package/src/internal/{funding → routes}/DepositWebhook.test.ts +61 -18
  993. package/src/internal/{funding → routes}/DepositWebhook.ts +9 -9
  994. package/src/internal/routes/Economics.test.ts +42 -0
  995. package/src/internal/routes/Economics.ts +47 -0
  996. package/src/internal/{funding → routes}/Evidence.test.ts +6 -6
  997. package/src/internal/{funding → routes}/Evidence.ts +9 -9
  998. package/src/internal/routes/Observability.test.ts +636 -0
  999. package/src/internal/routes/Observability.ts +668 -0
  1000. package/src/internal/{funding → routes}/Provider.test.ts +489 -153
  1001. package/src/internal/{funding → routes}/Provider.ts +489 -186
  1002. package/src/internal/{funding → routes}/Reconciliation.local.test.ts +84 -12
  1003. package/src/internal/{funding → routes}/Reconciliation.test.ts +1213 -279
  1004. package/src/internal/{funding → routes}/Reconciliation.ts +501 -203
  1005. package/src/internal/routes/Reconciliation.unattributed.test.ts +250 -0
  1006. package/src/internal/{funding → routes}/Route.ts +7 -7
  1007. package/src/internal/{funding → routes}/SourceObservation.test.ts +13 -14
  1008. package/src/internal/{funding → routes}/SourceObservation.ts +13 -13
  1009. package/src/internal/{funding → routes}/Subsidy.local.test.ts +7 -7
  1010. package/src/internal/routes/Subsidy.test.ts +169 -0
  1011. package/src/internal/{funding → routes}/Subsidy.ts +86 -6
  1012. package/src/internal/{funding → routes}/Token.test.ts +1 -1
  1013. package/src/internal/{funding → routes}/Token.ts +5 -5
  1014. package/src/internal/routes/Transfer.test.ts +1199 -0
  1015. package/src/internal/routes/Transfer.ts +1206 -0
  1016. package/src/internal/routes/TransferReconciliation.test.ts +731 -0
  1017. package/src/internal/routes/TransferReconciliation.ts +527 -0
  1018. package/src/internal/routes/TransferSubsidy.test.ts +172 -0
  1019. package/src/internal/routes/TransferSubsidy.ts +447 -0
  1020. package/src/internal/{funding → routes}/TransferWebhook.test.ts +13 -13
  1021. package/src/internal/{funding → routes}/TransferWebhook.ts +7 -7
  1022. package/src/internal/{funding → routes}/index.test.ts +5 -3
  1023. package/src/internal/{funding → routes}/index.ts +2 -0
  1024. package/src/internal/{funding → routes}/providers/across.ts +16 -16
  1025. package/src/internal/{funding → routes}/providers/index.test.ts +157 -44
  1026. package/src/internal/{funding → routes}/providers/relay.test.ts +224 -32
  1027. package/src/internal/{funding → routes}/providers/relay.ts +228 -121
  1028. package/src/internal/{funding → routes}/providers/rhino.ts +16 -16
  1029. package/src/internal/{funding → routes}/providers/squid.ts +17 -17
  1030. package/src/internal/routes/providers/stargate.test.ts +728 -0
  1031. package/src/internal/routes/providers/stargate.ts +1276 -0
  1032. package/src/internal/{funding → routes}/providers/symbiosis.ts +64 -24
  1033. package/src/internal/webhookDestinations/slack.ts +10 -10
  1034. package/src/providers/index.ts +13 -13
  1035. package/src/server.ts +18 -0
  1036. package/dist/apps/funding/Access.d.ts.map +0 -1
  1037. package/dist/apps/funding/Access.js.map +0 -1
  1038. package/dist/apps/funding/App.js.map +0 -1
  1039. package/dist/apps/funding/Inventory.d.ts.map +0 -1
  1040. package/dist/apps/funding/Inventory.js.map +0 -1
  1041. package/dist/apps/funding/ProviderAttempts.d.ts +0 -5
  1042. package/dist/apps/funding/ProviderAttempts.d.ts.map +0 -1
  1043. package/dist/apps/funding/ProviderAttempts.js +0 -24
  1044. package/dist/apps/funding/ProviderAttempts.js.map +0 -1
  1045. package/dist/apps/funding/index.d.ts +0 -2
  1046. package/dist/apps/funding/index.d.ts.map +0 -1
  1047. package/dist/apps/funding/index.js +0 -2
  1048. package/dist/apps/funding/index.js.map +0 -1
  1049. package/dist/apps/funding/routes/chains.d.ts.map +0 -1
  1050. package/dist/apps/funding/routes/chains.js.map +0 -1
  1051. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +0 -1
  1052. package/dist/apps/funding/routes/deposit-addresses.js.map +0 -1
  1053. package/dist/apps/funding/routes/providers.d.ts.map +0 -1
  1054. package/dist/apps/funding/routes/providers.js +0 -57
  1055. package/dist/apps/funding/routes/providers.js.map +0 -1
  1056. package/dist/apps/funding/routes/quotes.d.ts.map +0 -1
  1057. package/dist/apps/funding/routes/quotes.js.map +0 -1
  1058. package/dist/apps/funding/routes/transfers.d.ts.map +0 -1
  1059. package/dist/apps/funding/routes/transfers.js +0 -828
  1060. package/dist/apps/funding/routes/transfers.js.map +0 -1
  1061. package/dist/db/tables/fundingCatalog.d.ts +0 -58
  1062. package/dist/db/tables/fundingCatalog.d.ts.map +0 -1
  1063. package/dist/db/tables/fundingCatalog.js.map +0 -1
  1064. package/dist/db/tables/fundingDepositAddresses.d.ts +0 -192
  1065. package/dist/db/tables/fundingDepositAddresses.d.ts.map +0 -1
  1066. package/dist/db/tables/fundingDepositAddresses.js +0 -235
  1067. package/dist/db/tables/fundingDepositAddresses.js.map +0 -1
  1068. package/dist/db/tables/fundingDepositRequestObservations.d.ts.map +0 -1
  1069. package/dist/db/tables/fundingDepositRequestObservations.js.map +0 -1
  1070. package/dist/db/tables/fundingDeposits.d.ts.map +0 -1
  1071. package/dist/db/tables/fundingDeposits.js +0 -295
  1072. package/dist/db/tables/fundingDeposits.js.map +0 -1
  1073. package/dist/db/tables/fundingIdempotency.d.ts +0 -91
  1074. package/dist/db/tables/fundingIdempotency.d.ts.map +0 -1
  1075. package/dist/db/tables/fundingIdempotency.js +0 -103
  1076. package/dist/db/tables/fundingIdempotency.js.map +0 -1
  1077. package/dist/db/tables/fundingTransferEvents.d.ts.map +0 -1
  1078. package/dist/db/tables/fundingTransferEvents.js.map +0 -1
  1079. package/dist/db/tables/fundingTransferTransactions.d.ts +0 -53
  1080. package/dist/db/tables/fundingTransferTransactions.d.ts.map +0 -1
  1081. package/dist/db/tables/fundingTransferTransactions.js.map +0 -1
  1082. package/dist/db/tables/fundingTransfers.d.ts +0 -99
  1083. package/dist/db/tables/fundingTransfers.d.ts.map +0 -1
  1084. package/dist/db/tables/fundingTransfers.js +0 -110
  1085. package/dist/db/tables/fundingTransfers.js.map +0 -1
  1086. package/dist/internal/funding/Action.d.ts.map +0 -1
  1087. package/dist/internal/funding/Action.js.map +0 -1
  1088. package/dist/internal/funding/Catalog.d.ts.map +0 -1
  1089. package/dist/internal/funding/Catalog.js.map +0 -1
  1090. package/dist/internal/funding/Chain.d.ts.map +0 -1
  1091. package/dist/internal/funding/Chain.js.map +0 -1
  1092. package/dist/internal/funding/Deposit.d.ts.map +0 -1
  1093. package/dist/internal/funding/Deposit.js.map +0 -1
  1094. package/dist/internal/funding/DepositAddress.d.ts.map +0 -1
  1095. package/dist/internal/funding/DepositAddress.js.map +0 -1
  1096. package/dist/internal/funding/DepositWebhook.d.ts.map +0 -1
  1097. package/dist/internal/funding/DepositWebhook.js.map +0 -1
  1098. package/dist/internal/funding/Evidence.d.ts.map +0 -1
  1099. package/dist/internal/funding/Evidence.js.map +0 -1
  1100. package/dist/internal/funding/Provider.d.ts.map +0 -1
  1101. package/dist/internal/funding/Provider.js.map +0 -1
  1102. package/dist/internal/funding/Reconciliation.d.ts.map +0 -1
  1103. package/dist/internal/funding/Reconciliation.js.map +0 -1
  1104. package/dist/internal/funding/Route.d.ts +0 -21
  1105. package/dist/internal/funding/Route.d.ts.map +0 -1
  1106. package/dist/internal/funding/Route.js.map +0 -1
  1107. package/dist/internal/funding/SourceObservation.d.ts.map +0 -1
  1108. package/dist/internal/funding/SourceObservation.js.map +0 -1
  1109. package/dist/internal/funding/Subsidy.d.ts.map +0 -1
  1110. package/dist/internal/funding/Subsidy.js.map +0 -1
  1111. package/dist/internal/funding/Token.d.ts.map +0 -1
  1112. package/dist/internal/funding/Token.js.map +0 -1
  1113. package/dist/internal/funding/Transfer.d.ts.map +0 -1
  1114. package/dist/internal/funding/Transfer.js +0 -462
  1115. package/dist/internal/funding/Transfer.js.map +0 -1
  1116. package/dist/internal/funding/TransferReconciliation.d.ts.map +0 -1
  1117. package/dist/internal/funding/TransferReconciliation.js +0 -192
  1118. package/dist/internal/funding/TransferReconciliation.js.map +0 -1
  1119. package/dist/internal/funding/TransferWebhook.d.ts.map +0 -1
  1120. package/dist/internal/funding/TransferWebhook.js.map +0 -1
  1121. package/dist/internal/funding/index.d.ts.map +0 -1
  1122. package/dist/internal/funding/index.js.map +0 -1
  1123. package/dist/internal/funding/providers/across.d.ts.map +0 -1
  1124. package/dist/internal/funding/providers/across.js.map +0 -1
  1125. package/dist/internal/funding/providers/relay.d.ts.map +0 -1
  1126. package/dist/internal/funding/providers/relay.js.map +0 -1
  1127. package/dist/internal/funding/providers/rhino.d.ts.map +0 -1
  1128. package/dist/internal/funding/providers/rhino.js.map +0 -1
  1129. package/dist/internal/funding/providers/squid.d.ts.map +0 -1
  1130. package/dist/internal/funding/providers/squid.js.map +0 -1
  1131. package/dist/internal/funding/providers/stargate.d.ts.map +0 -1
  1132. package/dist/internal/funding/providers/stargate.js +0 -579
  1133. package/dist/internal/funding/providers/stargate.js.map +0 -1
  1134. package/dist/internal/funding/providers/symbiosis.d.ts.map +0 -1
  1135. package/dist/internal/funding/providers/symbiosis.js.map +0 -1
  1136. package/src/apps/funding/App.test.ts +0 -78
  1137. package/src/apps/funding/App.ts +0 -88
  1138. package/src/apps/funding/ProviderAttempts.ts +0 -26
  1139. package/src/apps/funding/index.ts +0 -1
  1140. package/src/apps/funding/routes/transfers.ts +0 -987
  1141. package/src/db/tables/fundingCatalog.test.ts +0 -122
  1142. package/src/db/tables/fundingCatalog.ts +0 -163
  1143. package/src/db/tables/fundingDepositAddresses.test.ts +0 -608
  1144. package/src/db/tables/fundingDepositAddresses.ts +0 -443
  1145. package/src/db/tables/fundingDeposits.ts +0 -572
  1146. package/src/db/tables/fundingIdempotency.test.ts +0 -182
  1147. package/src/db/tables/fundingIdempotency.ts +0 -180
  1148. package/src/db/tables/fundingTransferTransactions.test.ts +0 -112
  1149. package/src/db/tables/fundingTransfers.test.ts +0 -115
  1150. package/src/db/tables/fundingTransfers.ts +0 -189
  1151. package/src/handlers/internal/multisig.test.ts +0 -818
  1152. package/src/internal/funding/Subsidy.test.ts +0 -75
  1153. package/src/internal/funding/Transfer.test.ts +0 -524
  1154. package/src/internal/funding/Transfer.ts +0 -762
  1155. package/src/internal/funding/TransferReconciliation.test.ts +0 -147
  1156. package/src/internal/funding/TransferReconciliation.ts +0 -264
  1157. package/src/internal/funding/providers/stargate.test.ts +0 -328
  1158. package/src/internal/funding/providers/stargate.ts +0 -856
  1159. /package/dist/apps/{funding → routes}/Inventory.d.ts +0 -0
  1160. /package/src/internal/{funding → routes}/Route.test.ts +0 -0
@@ -17,8 +17,8 @@ import type * as Viem from '../../../internal/Viem.js'
17
17
  import * as WebhookDestination from '../../../internal/WebhookDestination.js'
18
18
  import * as WebhookTransfer from '../../../internal/WebhookTransfer.js'
19
19
  import * as Webhooks from '../../../internal/Webhooks.js'
20
- import * as FundingDeposit from '../../../internal/funding/Deposit.js'
21
- import * as FundingTransfer from '../../../internal/funding/Transfer.js'
20
+ import * as RoutesDeposit from '../../../internal/routes/Deposit.js'
21
+ import * as RoutesTransfer from '../../../internal/routes/Transfer.js'
22
22
  import * as Transactions from './transactions.js'
23
23
  import * as Transfers from './transfers.js'
24
24
 
@@ -42,8 +42,8 @@ const redactedSlackUrl = 'https://hooks.slack.com/…'
42
42
  */
43
43
  export const eventTypes = [
44
44
  'block:created',
45
- 'funding:deposit.updated',
46
- 'funding:transfer.updated',
45
+ 'routes:deposit.updated',
46
+ 'routes:transfer.updated',
47
47
  'log:emitted',
48
48
  'token:transfer',
49
49
  'transaction:included',
@@ -52,18 +52,18 @@ export const eventTypes = [
52
52
  /** Event types a subscription can listen to. Derived from {@link eventTypes}. */
53
53
  export type EventType = (typeof eventTypes)[number]
54
54
 
55
- /** Funding resource events produced by the API instead of chain scans. */
56
- export const fundingEventTypes = [
57
- 'funding:deposit.updated',
58
- 'funding:transfer.updated',
55
+ /** Route resource events produced by the API instead of chain scans. */
56
+ export const routesEventTypes = [
57
+ 'routes:deposit.updated',
58
+ 'routes:transfer.updated',
59
59
  ] as const satisfies readonly EventType[]
60
60
 
61
- /** Event type carrying an owner-scoped funding resource. */
62
- export type FundingEventType = (typeof fundingEventTypes)[number]
61
+ /** Event type carrying an owner-scoped route resource. */
62
+ export type RoutesEventType = (typeof routesEventTypes)[number]
63
63
 
64
- /** Returns whether an event type carries an owner-scoped funding resource. */
65
- export function isFundingEventType(eventType: EventType): eventType is FundingEventType {
66
- return (fundingEventTypes as readonly EventType[]).includes(eventType)
64
+ /** Returns whether an event type carries an owner-scoped route resource. */
65
+ export function isRoutesEventType(eventType: EventType): eventType is RoutesEventType {
66
+ return (routesEventTypes as readonly EventType[]).includes(eventType)
67
67
  }
68
68
 
69
69
  /** Subscribable event types surfaced by `GET /webhooks/event-types`. */
@@ -75,13 +75,13 @@ const eventTypeDescriptions = [
75
75
  },
76
76
  {
77
77
  description:
78
- 'A funding deposit materially changed after verified reconciliation, filterable by deposit address, recipient, or status.',
79
- type: 'funding:deposit.updated',
78
+ 'A route deposit materially changed after verified reconciliation, filterable by deposit address, recipient, or status.',
79
+ type: 'routes:deposit.updated',
80
80
  },
81
81
  {
82
82
  description:
83
- 'A funding transfer materially changed, filterable by transfer ID or lifecycle status.',
84
- type: 'funding:transfer.updated',
83
+ 'A route transfer materially changed, filterable by transfer ID or lifecycle status.',
84
+ type: 'routes:transfer.updated',
85
85
  },
86
86
  {
87
87
  description:
@@ -102,7 +102,10 @@ const eventTypeDescriptions = [
102
102
  /** Zod schemas owned by the webhooks resource. */
103
103
  export namespace schema {
104
104
  /** Subscribable event type. */
105
- export const EventType = z.enum(eventTypes).check(z.describe('Event type you can subscribe to.'))
105
+ export const EventType = OpenApi.component(
106
+ z.enum(eventTypes).check(z.describe('Event type you can subscribe to.')),
107
+ 'WebhookSubscriptionEventType',
108
+ )
106
109
 
107
110
  /** Subscription lifecycle status. */
108
111
  export const Status = z
@@ -158,19 +161,19 @@ export namespace schema {
158
161
  * your Slack incoming-webhook URL), or a `betterstack` destination (a structured
159
162
  * log event POSTed to a Better Stack source with a bearer source token).
160
163
  */
161
- const Destination = z
164
+ const DestinationSchema = z
162
165
  .discriminatedUnion('type', [
163
166
  z.object({
164
- type: z.literal('url'),
167
+ type: z.literal('url').check(z.meta({ examples: ['url'] })),
165
168
  url: Url,
166
169
  }),
167
170
  z.object({
168
- type: z.literal('slack'),
171
+ type: z.literal('slack').check(z.meta({ examples: ['slack'] })),
169
172
  url: SlackUrl,
170
173
  }),
171
174
  z.object({
172
175
  token: BetterstackToken,
173
- type: z.literal('betterstack'),
176
+ type: z.literal('betterstack').check(z.meta({ examples: ['betterstack'] })),
174
177
  url: BetterstackUrl,
175
178
  }),
176
179
  ])
@@ -178,27 +181,41 @@ export namespace schema {
178
181
  z.describe(
179
182
  'Delivery destination: an HTTPS URL, a Slack incoming-webhook URL, or a Better Stack source.',
180
183
  ),
184
+ z.meta({ examples: [{ type: 'url', url: 'https://example.com/webhooks' }] }),
181
185
  )
186
+ const Destination = OpenApi.component(DestinationSchema, 'WebhookDestination')
182
187
 
183
- const PublicDestination = z
188
+ const PublicDestinationSchema = z
184
189
  .discriminatedUnion('type', [
185
190
  z.object({
186
- type: z.literal('url'),
191
+ type: z.literal('url').check(z.meta({ examples: ['url'] })),
187
192
  url: Url,
188
193
  }),
189
194
  z.object({
190
- type: z.literal('slack'),
191
- url: z.literal(redactedSlackUrl).check(z.describe('Redacted Slack webhook URL.')),
195
+ type: z.literal('slack').check(z.meta({ examples: ['slack'] })),
196
+ url: z
197
+ .literal(redactedSlackUrl)
198
+ .check(
199
+ z.describe('Redacted Slack webhook URL.'),
200
+ z.meta({ examples: [redactedSlackUrl] }),
201
+ ),
192
202
  }),
193
203
  z.object({
194
204
  token: z
195
205
  .literal(redactedBetterstackToken)
196
- .check(z.describe('Redacted Better Stack source token.')),
197
- type: z.literal('betterstack'),
206
+ .check(
207
+ z.describe('Redacted Better Stack source token.'),
208
+ z.meta({ examples: [redactedBetterstackToken] }),
209
+ ),
210
+ type: z.literal('betterstack').check(z.meta({ examples: ['betterstack'] })),
198
211
  url: BetterstackUrl,
199
212
  }),
200
213
  ])
201
- .check(z.describe('Delivery destination with bearer credentials redacted.'))
214
+ .check(
215
+ z.describe('Delivery destination with bearer credentials redacted.'),
216
+ z.meta({ examples: [{ type: 'url', url: 'https://example.com/webhooks' }] }),
217
+ )
218
+ const PublicDestination = OpenApi.component(PublicDestinationSchema, 'WebhookPublicDestination')
202
219
 
203
220
  /**
204
221
  * Equality / membership operator for a filterable field. A consumer can pass a
@@ -233,7 +250,10 @@ export namespace schema {
233
250
  lt: z.optional(Schema.Quantity),
234
251
  lte: z.optional(Schema.Quantity),
235
252
  })
236
- .check(z.refine((c) => Object.keys(c).length > 0, { error: 'Comparison cannot be empty.' })),
253
+ .check(
254
+ z.refine((c) => Object.keys(c).length > 0, { error: 'Comparison cannot be empty.' }),
255
+ z.meta({ examples: [{ gte: '0x1' }] }),
256
+ ),
237
257
  ])
238
258
 
239
259
  /**
@@ -253,9 +273,11 @@ export namespace schema {
253
273
  * drift. All are optional and AND-combined; omit every field to subscribe to
254
274
  * the full stream.
255
275
  */
256
- export const TransferFilters = Transfers.schema.Predicates.check(
257
- z.describe('Filters that narrow which TIP-20 transfer events trigger this webhook.'),
258
- z.meta({ title: 'Transfer filters' }),
276
+ export const TransferFilters = OpenApi.component(
277
+ Transfers.schema.Predicates.check(
278
+ z.describe('Filters that narrow which TIP-20 transfer events trigger this webhook.'),
279
+ ),
280
+ 'WebhookTransferFilters',
259
281
  )
260
282
 
261
283
  /**
@@ -267,80 +289,88 @@ export namespace schema {
267
289
  * `address` matches either side (`from` OR `to`); when `includeCalls` is set
268
290
  * (default), `to`/`address` also match an inner call target (`calls[].to`).
269
291
  */
270
- export const TxFilters = z
271
- .strictObject({
272
- hash: z.optional(
273
- eq(Schema.Hash).check(z.describe('Match this exact transaction hash (or any of several).')),
274
- ),
275
- address: z.optional(
276
- eq(Schema.Address).check(
277
- z.describe('Match transactions where this address is the sender or recipient.'),
292
+ export const TxFilters = OpenApi.component(
293
+ z
294
+ .strictObject({
295
+ hash: z.optional(
296
+ eq(Schema.Hash).check(
297
+ z.describe('Match this exact transaction hash (or any of several).'),
298
+ ),
278
299
  ),
279
- ),
280
- from: z.optional(
281
- eq(Schema.Address).check(z.describe('Match transactions whose sender (`from`) is this.')),
282
- ),
283
- to: z.optional(
284
- eq(Schema.Address).check(
285
- z.describe('Match transactions sent to this address (root `to`; see `includeCalls`).'),
300
+ address: z.optional(
301
+ eq(Schema.Address).check(
302
+ z.describe('Match transactions where this address is the sender or recipient.'),
303
+ ),
286
304
  ),
287
- ),
288
- includeCalls: z.optional(
289
- z
290
- .boolean()
291
- .check(
305
+ from: z.optional(
306
+ eq(Schema.Address).check(z.describe('Match transactions whose sender (`from`) is this.')),
307
+ ),
308
+ to: z.optional(
309
+ eq(Schema.Address).check(
310
+ z.describe('Match transactions sent to this address (root `to`; see `includeCalls`).'),
311
+ ),
312
+ ),
313
+ includeCalls: z.optional(
314
+ z
315
+ .boolean()
316
+ .check(
317
+ z.describe(
318
+ 'When true (default), `to`/`address` also match an inner account-abstraction call target (`calls[].to`).',
319
+ ),
320
+ z.meta({ examples: [true] }),
321
+ ),
322
+ ),
323
+ value: z.optional(compare.check(z.describe('Match the transaction value (wei) bounds.'))),
324
+ input: z.optional(
325
+ bytes.check(
292
326
  z.describe(
293
- 'When true (default), `to`/`address` also match an inner account-abstraction call target (`calls[].to`).',
327
+ 'Match top-level calldata by 4-byte `selector`, hex `startsWith`, or exact.',
294
328
  ),
295
- z.meta({ examples: [true] }),
296
329
  ),
297
- ),
298
- value: z.optional(compare.check(z.describe('Match the transaction value (wei) bounds.'))),
299
- input: z.optional(
300
- bytes.check(
301
- z.describe('Match top-level calldata by 4-byte `selector`, hex `startsWith`, or exact.'),
302
330
  ),
303
- ),
304
- calls: z.optional(
305
- z
306
- .strictObject({
307
- to: eq(Schema.Address),
308
- })
309
- .check(
310
- z.describe(
311
- 'Match if ANY inner account-abstraction call targets this address (`calls[].to`).',
331
+ calls: z.optional(
332
+ z
333
+ .strictObject({
334
+ to: eq(Schema.Address),
335
+ })
336
+ .check(
337
+ z.describe(
338
+ 'Match if ANY inner account-abstraction call targets this address (`calls[].to`).',
339
+ ),
312
340
  ),
341
+ ),
342
+ callCount: z.optional(
343
+ compare.check(z.describe('Match the number of inner calls (`call_count`).')),
344
+ ),
345
+ txType: z.optional(
346
+ eq(Schema.Hex).check(
347
+ z.describe('Match the transaction type (e.g. `0x76` for Tempo AA).'),
313
348
  ),
314
- ),
315
- callCount: z.optional(
316
- compare.check(z.describe('Match the number of inner calls (`call_count`).')),
317
- ),
318
- txType: z.optional(
319
- eq(Schema.Hex).check(z.describe('Match the transaction type (e.g. `0x76` for Tempo AA).')),
320
- ),
321
- feeToken: z.optional(
322
- eq(Schema.TokenAddress).check(z.describe('Match the fee token address.')),
323
- ),
324
- gasLimit: z.optional(compare.check(z.describe('Match the gas limit bounds.'))),
325
- maxFeePerGas: z.optional(compare.check(z.describe('Match the max fee per gas bounds.'))),
326
- maxPriorityFeePerGas: z.optional(
327
- compare.check(z.describe('Match the max priority fee per gas bounds.')),
328
- ),
329
- nonce: z.optional(compare.check(z.describe('Match the nonce bounds.'))),
330
- nonceKey: z.optional(eq(Schema.Hex).check(z.describe('Match the nonce key (Tempo AA).'))),
331
- validBefore: z.optional(
332
- compare.check(z.describe('Match the `validBefore` bounds (unix s).')),
333
- ),
334
- validAfter: z.optional(compare.check(z.describe('Match the `validAfter` bounds (unix s).'))),
335
- blockNumber: z.optional(compare.check(z.describe('Match the block-number bounds.'))),
336
- timestamp: z.optional(
337
- compare.check(z.describe('Match the block timestamp bounds (unix s).')),
338
- ),
339
- })
340
- .check(
341
- z.describe('Filters that narrow which included transactions trigger this webhook.'),
342
- z.meta({ title: 'Included-transaction filters' }),
343
- )
349
+ ),
350
+ feeToken: z.optional(
351
+ eq(Schema.TokenAddress).check(z.describe('Match the fee token address.')),
352
+ ),
353
+ gasLimit: z.optional(compare.check(z.describe('Match the gas limit bounds.'))),
354
+ maxFeePerGas: z.optional(compare.check(z.describe('Match the max fee per gas bounds.'))),
355
+ maxPriorityFeePerGas: z.optional(
356
+ compare.check(z.describe('Match the max priority fee per gas bounds.')),
357
+ ),
358
+ nonce: z.optional(compare.check(z.describe('Match the nonce bounds.'))),
359
+ nonceKey: z.optional(eq(Schema.Hex).check(z.describe('Match the nonce key (Tempo AA).'))),
360
+ validBefore: z.optional(
361
+ compare.check(z.describe('Match the `validBefore` bounds (unix s).')),
362
+ ),
363
+ validAfter: z.optional(
364
+ compare.check(z.describe('Match the `validAfter` bounds (unix s).')),
365
+ ),
366
+ blockNumber: z.optional(compare.check(z.describe('Match the block-number bounds.'))),
367
+ timestamp: z.optional(
368
+ compare.check(z.describe('Match the block timestamp bounds (unix s).')),
369
+ ),
370
+ })
371
+ .check(z.describe('Filters that narrow which included transactions trigger this webhook.')),
372
+ 'WebhookTransactionFilters',
373
+ )
344
374
 
345
375
  /** A 32-byte log topic (lowercased hex). */
346
376
  const topic = Schema.Hash
@@ -353,87 +383,92 @@ export namespace schema {
353
383
  * firehose), and an addressless filter must still be selective — an event
354
384
  * anchor (`signature`/`topic0`) plus at least one indexed topic or argument.
355
385
  */
356
- export const LogFilters = z
357
- .strictObject({
358
- address: z.optional(
359
- eq(Schema.Address).check(
360
- z.describe('Only match logs emitted by this contract address (or any of several).'),
361
- z.meta({ examples: ['0x20c0000000000000000000008f5425160ebe5525'] }),
386
+ export const LogFilters = OpenApi.component(
387
+ z
388
+ .strictObject({
389
+ address: z.optional(
390
+ eq(Schema.Address).check(
391
+ z.describe('Only match logs emitted by this contract address (or any of several).'),
392
+ z.meta({ examples: ['0x20c0000000000000000000008f5425160ebe5525'] }),
393
+ ),
362
394
  ),
363
- ),
364
- signature: z.optional(
365
- z.string().check(
366
- z.describe(
367
- 'Human-readable ABI event signature used to derive `topic0` and decode `args`, e.g. `event Transfer(address indexed from, address indexed to, uint256 value)`.',
395
+ signature: z.optional(
396
+ z.string().check(
397
+ z.describe(
398
+ 'Human-readable ABI event signature used to derive `topic0` and decode `args`, e.g. `event Transfer(address indexed from, address indexed to, uint256 value)`.',
399
+ ),
400
+ z.meta({
401
+ examples: ['event Transfer(address indexed from, address indexed to, uint256 value)'],
402
+ }),
368
403
  ),
369
- z.meta({
370
- examples: ['event Transfer(address indexed from, address indexed to, uint256 value)'],
371
- }),
372
404
  ),
373
- ),
374
- topic0: z.optional(
375
- eq(topic).check(
376
- z.describe('Event signature hash (topic 0). Mutually exclusive with `signature`.'),
377
- z.meta({
378
- examples: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'],
379
- }),
405
+ topic0: z.optional(
406
+ eq(topic).check(
407
+ z.describe('Event signature hash (topic 0). Mutually exclusive with `signature`.'),
408
+ z.meta({
409
+ examples: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'],
410
+ }),
411
+ ),
380
412
  ),
381
- ),
382
- topic1: z.optional(
383
- eq(topic).check(
384
- z.describe('Raw indexed argument 1 (topic 1).'),
385
- z.meta({
386
- examples: ['0x000000000000000000000000e7687128b0a808c2831ff94d4f7b2fb35c65af38'],
387
- }),
413
+ topic1: z.optional(
414
+ eq(topic).check(
415
+ z.describe('Raw indexed argument 1 (topic 1).'),
416
+ z.meta({
417
+ examples: ['0x000000000000000000000000e7687128b0a808c2831ff94d4f7b2fb35c65af38'],
418
+ }),
419
+ ),
388
420
  ),
389
- ),
390
- topic2: z.optional(
391
- eq(topic).check(
392
- z.describe('Raw indexed argument 2 (topic 2).'),
393
- z.meta({
394
- examples: ['0x0000000000000000000000009e39034aae71fb89f66061a2602eb6efec271754'],
395
- }),
421
+ topic2: z.optional(
422
+ eq(topic).check(
423
+ z.describe('Raw indexed argument 2 (topic 2).'),
424
+ z.meta({
425
+ examples: ['0x0000000000000000000000009e39034aae71fb89f66061a2602eb6efec271754'],
426
+ }),
427
+ ),
396
428
  ),
397
- ),
398
- topic3: z.optional(
399
- eq(topic).check(
400
- z.describe('Raw indexed argument 3 (topic 3).'),
401
- z.meta({
402
- examples: ['0x0000000000000000000000000000000000000000000000000000000000000000'],
403
- }),
429
+ topic3: z.optional(
430
+ eq(topic).check(
431
+ z.describe('Raw indexed argument 3 (topic 3).'),
432
+ z.meta({
433
+ examples: ['0x0000000000000000000000000000000000000000000000000000000000000000'],
434
+ }),
435
+ ),
404
436
  ),
405
- ),
406
- args: z.optional(
407
- z
408
- .record(z.string(), z.unknown())
409
- .check(
410
- z.describe(
411
- 'Match decoded event arguments by name (indexed or non-indexed). Requires `signature`. Each value is an exact value or a super admin object.',
437
+ args: z.optional(
438
+ z
439
+ .record(z.string(), z.unknown())
440
+ .check(
441
+ z.describe(
442
+ 'Match decoded event arguments by name (indexed or non-indexed). Requires `signature`. Each value is an exact value or a super admin object.',
443
+ ),
444
+ z.meta({ examples: [{ to: '0x9e39034aae71fb89f66061a2602eb6efec271754' }] }),
412
445
  ),
413
- z.meta({ examples: [{ to: '0x9e39034aae71fb89f66061a2602eb6efec271754' }] }),
414
- ),
415
- ),
416
- blockNumber: z.optional(
417
- compare.check(z.describe('Only match logs within these block-number bounds.')),
446
+ ),
447
+ blockNumber: z.optional(
448
+ compare.check(z.describe('Only match logs within these block-number bounds.')),
449
+ ),
450
+ })
451
+ .check(
452
+ z.describe('Filters that narrow which contract event logs trigger this webhook.'),
453
+ z.meta({
454
+ examples: [{ address: '0x20c0000000000000000000008f5425160ebe5525' }],
455
+ }),
456
+ z.refine((f) => Object.keys(f).length > 0, {
457
+ error: 'At least one log filter is required.',
458
+ }),
459
+ z.refine((f) => !(f.signature && f.topic0), {
460
+ error: 'Pass `signature` or `topic0`, not both.',
461
+ }),
462
+ z.refine((f) => !f.args || f.signature, {
463
+ error: '`args` requires `signature` to decode the event.',
464
+ }),
465
+ z.refine((f) => hasLogPushdown(f), {
466
+ error:
467
+ 'Log filters must include a pushdown-capable address or an event/topic0 anchor plus an indexed topic or argument.',
468
+ }),
418
469
  ),
419
- })
420
- .check(
421
- z.describe('Filters that narrow which contract event logs trigger this webhook.'),
422
- z.meta({ title: 'Log filters' }),
423
- z.refine((f) => Object.keys(f).length > 0, {
424
- error: 'At least one log filter is required.',
425
- }),
426
- z.refine((f) => !(f.signature && f.topic0), {
427
- error: 'Pass `signature` or `topic0`, not both.',
428
- }),
429
- z.refine((f) => !f.args || f.signature, {
430
- error: '`args` requires `signature` to decode the event.',
431
- }),
432
- z.refine((f) => hasLogPushdown(f), {
433
- error:
434
- 'Log filters must include a pushdown-capable address or an event/topic0 anchor plus an indexed topic or argument.',
435
- }),
436
- )
470
+ 'WebhookLogFilters',
471
+ )
437
472
 
438
473
  /**
439
474
  * `block:created` subscription filters. All optional and AND-combined; unlike
@@ -441,177 +476,187 @@ export namespace schema {
441
476
  * non-abusive heartbeat feed. Block-level metadata only (no transaction
442
477
  * predicates; use `transaction:included` for those).
443
478
  */
444
- export const BlockFilters = z
445
- .strictObject({
446
- number: z.optional(
447
- compare.check(z.describe('Only match blocks within these block-number bounds.')),
448
- ),
449
- miner: z.optional(
450
- eq(Schema.Address).check(
451
- z.describe('Only match blocks produced by this address (the miner/producer).'),
452
- z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
479
+ export const BlockFilters = OpenApi.component(
480
+ z
481
+ .strictObject({
482
+ number: z.optional(
483
+ compare.check(z.describe('Only match blocks within these block-number bounds.')),
453
484
  ),
454
- ),
455
- proposer: z.optional(
456
- eq(Schema.Address).check(
457
- z.describe('Only match blocks proposed by this consensus proposer (when available).'),
485
+ miner: z.optional(
486
+ eq(Schema.Address).check(
487
+ z.describe('Only match blocks produced by this address (the miner/producer).'),
488
+ z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
489
+ ),
458
490
  ),
459
- ),
460
- gasUsed: z.optional(
461
- compare.check(z.describe('Only match blocks whose total gas used is within these bounds.')),
462
- ),
463
- gasLimit: z.optional(
464
- compare.check(z.describe('Only match blocks whose gas limit is within these bounds.')),
465
- ),
466
- timestamp: z.optional(
467
- compare.check(
468
- z.describe('Only match blocks whose unix timestamp (seconds) is within these bounds.'),
491
+ proposer: z.optional(
492
+ eq(Schema.Address).check(
493
+ z.describe('Only match blocks proposed by this consensus proposer (when available).'),
494
+ ),
469
495
  ),
470
- ),
471
- })
472
- .check(
473
- z.describe('Filters that narrow which new blocks trigger this webhook.'),
474
- z.meta({ title: 'Block filters' }),
475
- )
496
+ gasUsed: z.optional(
497
+ compare.check(
498
+ z.describe('Only match blocks whose total gas used is within these bounds.'),
499
+ ),
500
+ ),
501
+ gasLimit: z.optional(
502
+ compare.check(z.describe('Only match blocks whose gas limit is within these bounds.')),
503
+ ),
504
+ timestamp: z.optional(
505
+ compare.check(
506
+ z.describe('Only match blocks whose unix timestamp (seconds) is within these bounds.'),
507
+ ),
508
+ ),
509
+ })
510
+ .check(z.describe('Filters that narrow which new blocks trigger this webhook.')),
511
+ 'WebhookBlockFilters',
512
+ )
476
513
 
477
- /** `funding:deposit.updated` subscription filters. All are optional and AND-combined. */
478
- export const FundingDepositFilters = z
479
- .strictObject({
480
- depositAddressId: z.optional(FundingDeposit.schema.Snapshot.shape.depositAddressId),
481
- recipient: z.optional(Schema.Address),
482
- status: z.optional(FundingDeposit.schema.Status),
483
- })
484
- .check(
485
- z.describe('Filters that narrow which funding deposit changes trigger this webhook.'),
486
- z.meta({ title: 'Funding deposit filters' }),
487
- )
514
+ /** `routes:deposit.updated` subscription filters. All are optional and AND-combined. */
515
+ export const RoutesDepositFilters = OpenApi.component(
516
+ z
517
+ .strictObject({
518
+ depositAddressId: z.optional(RoutesDeposit.schema.Snapshot.shape.depositAddressId),
519
+ recipient: z.optional(Schema.Address),
520
+ status: z.optional(RoutesDeposit.schema.Status),
521
+ })
522
+ .check(z.describe('Filters that narrow which route deposit changes trigger this webhook.')),
523
+ 'WebhookRoutesDepositFilters',
524
+ )
488
525
 
489
- /** `funding:transfer.updated` subscription filters. All are optional and AND-combined. */
490
- export const FundingTransferFilters = z
491
- .strictObject({
492
- id: z.optional(FundingTransfer.schema.FundingTransfer.shape.id),
493
- status: z.optional(FundingTransfer.schema.Status),
494
- })
495
- .check(
496
- z.describe('Filters that narrow which funding transfer changes trigger this webhook.'),
497
- z.meta({ title: 'Funding transfer filters' }),
498
- )
526
+ /** `routes:transfer.updated` subscription filters. All are optional and AND-combined. */
527
+ export const RoutesTransferFilters = OpenApi.component(
528
+ z
529
+ .strictObject({
530
+ id: z.optional(RoutesTransfer.schema.RoutesTransfer.shape.id),
531
+ status: z.optional(RoutesTransfer.schema.Status),
532
+ })
533
+ .check(z.describe('Filters that narrow which route transfer changes trigger this webhook.')),
534
+ 'WebhookRoutesTransferFilters',
535
+ )
499
536
 
500
537
  /**
501
538
  * Optional human context describing what a subscription is for. Surfaced by
502
539
  * destinations (Slack header + description, Better Stack log fields) and echoed
503
540
  * on every delivered event envelope.
504
541
  */
505
- export const Context = z
506
- .object({
507
- description: z.optional(
508
- z
509
- .string()
542
+ export const Context = OpenApi.component(
543
+ z
544
+ .object({
545
+ description: z.optional(
546
+ z
547
+ .string()
548
+ .check(
549
+ z.maxLength(500),
550
+ z.describe('Longer description of what this subscription is for.'),
551
+ z.meta({ examples: ['Notify #ops when a large USDC transfer settles on mainnet.'] }),
552
+ ),
553
+ ),
554
+ metadata: z.optional(
555
+ z
556
+ .record(
557
+ z.string().check(z.minLength(1), z.maxLength(64)),
558
+ z.string().check(z.maxLength(500)),
559
+ )
560
+ .check(
561
+ z.refine((m) => Object.keys(m).length <= 20, {
562
+ error: 'At most 20 metadata entries are allowed.',
563
+ }),
564
+ z.describe(
565
+ 'Arbitrary key/value labels echoed on every delivered event and rendered by destinations (Slack fields, Better Stack log fields). Keys are 1–64 chars, values ≤500 chars, ≤20 entries.',
566
+ ),
567
+ z.meta({ examples: [{ env: 'prod', team: 'payments' }] }),
568
+ ),
569
+ ),
570
+ title: z.optional(
571
+ z
572
+ .string()
573
+ .check(
574
+ z.maxLength(120),
575
+ z.describe('Short label for this subscription.'),
576
+ z.meta({ examples: ['Prod USDC large transfers'] }),
577
+ ),
578
+ ),
579
+ })
580
+ .check(z.describe('Human context describing what this webhook subscription is for.')),
581
+ 'WebhookContext',
582
+ )
583
+
584
+ /**
585
+ * Public subscription representation. Never includes the signing `secret`
586
+ * (returned once by `POST /webhooks`) or the internal owner.
587
+ */
588
+ export const Subscription = OpenApi.component(
589
+ z
590
+ .object({
591
+ chainId: chainIdResponse,
592
+ context: z
593
+ .optional(Context)
594
+ .check(z.meta({ examples: [{ title: 'Prod USDC large transfers' }] })),
595
+ createdAt: z.iso
596
+ .datetime()
510
597
  .check(
511
- z.maxLength(500),
512
- z.describe('Longer description of what this subscription is for.'),
513
- z.meta({ examples: ['Notify #ops when a large USDC transfer settles on mainnet.'] }),
598
+ z.describe('When the subscription was created, as an ISO 8601 timestamp.'),
599
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
514
600
  ),
515
- ),
516
- metadata: z.optional(
517
- z
518
- .record(
519
- z.string().check(z.minLength(1), z.maxLength(64)),
520
- z.string().check(z.maxLength(500)),
521
- )
601
+ destination: PublicDestination,
602
+ environment: z
603
+ .optional(z.enum(['production', 'sandbox']))
604
+ .check(
605
+ z.describe('API-key environment for private resource events, when applicable.'),
606
+ z.meta({ examples: ['production'] }),
607
+ ),
608
+ eventType: EventType.check(z.meta({ examples: ['token:transfer'] })),
609
+ expiresAt: z
610
+ .optional(z.iso.datetime())
522
611
  .check(
523
- z.refine((m) => Object.keys(m).length <= 20, {
524
- error: 'At most 20 metadata entries are allowed.',
525
- }),
526
612
  z.describe(
527
- 'Arbitrary key/value labels echoed on every delivered event and rendered by destinations (Slack fields, Better Stack log fields). Keys are 1–64 chars, values ≤500 chars, ≤20 entries.',
613
+ 'When the subscription expires, as an ISO 8601 timestamp. Only MPP-paid subscriptions expire.',
528
614
  ),
529
- z.meta({ examples: [{ env: 'prod', team: 'payments' }] }),
615
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
530
616
  ),
531
- ),
532
- title: z.optional(
533
- z
534
- .string()
617
+ failureCount: z
618
+ .number()
535
619
  .check(
536
- z.maxLength(120),
537
- z.describe('Short label for this subscription.'),
538
- z.meta({ examples: ['Prod USDC large transfers'] }),
620
+ z.int(),
621
+ z.nonnegative(),
622
+ z.describe(
623
+ 'Number of delivery failures in a row for this subscription, capped at the auto-disable threshold.',
624
+ ),
625
+ z.meta({ examples: [0] }),
539
626
  ),
540
- ),
541
- })
542
- .check(z.describe('Human context describing what this webhook subscription is for.'))
543
-
544
- /**
545
- * Public subscription representation. Never includes the signing `secret`
546
- * (returned once by `POST /webhooks`) or the internal owner.
547
- */
548
- export const Subscription = z
549
- .object({
550
- chainId: chainIdResponse,
551
- context: z.optional(Context),
552
- createdAt: z.iso
553
- .datetime()
554
- .check(
555
- z.describe('When the subscription was created, as an ISO 8601 timestamp.'),
556
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
627
+ filters: Filters.check(
628
+ z.describe('Filters applied to this event type.'),
629
+ z.meta({ examples: [{ address: '0x20c0000000000000000000008f5425160ebe5525' }] }),
557
630
  ),
558
- destination: PublicDestination,
559
- environment: z
560
- .optional(z.enum(['production', 'sandbox']))
561
- .check(
562
- z.describe('API-key environment for private resource events, when applicable.'),
563
- z.meta({ examples: ['production'] }),
564
- ),
565
- eventType: EventType.check(z.meta({ examples: ['token:transfer'] })),
566
- expiresAt: z
567
- .optional(z.iso.datetime())
568
- .check(
569
- z.describe(
570
- 'When the subscription expires, as an ISO 8601 timestamp. Only MPP-paid subscriptions expire.',
631
+ id: z
632
+ .string()
633
+ .check(
634
+ z.describe('Webhook subscription ID (`wh_…`).'),
635
+ z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
571
636
  ),
572
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
573
- ),
574
- failureCount: z
575
- .number()
576
- .check(
577
- z.int(),
578
- z.nonnegative(),
579
- z.describe(
580
- 'Number of delivery failures in a row for this subscription, capped at the auto-disable threshold.',
637
+ lastDeliveryAt: z
638
+ .optional(z.iso.datetime())
639
+ .check(
640
+ z.describe(
641
+ 'When Tempo last delivered an event successfully, as an ISO 8601 timestamp. Refreshed at most once per minute during sustained delivery.',
642
+ ),
643
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
581
644
  ),
582
- z.meta({ examples: [0] }),
583
- ),
584
- filters: Filters.check(
585
- z.describe('Filters applied to this event type.'),
586
- z.meta({ examples: [{ address: '0x20c0000000000000000000008f5425160ebe5525' }] }),
587
- ),
588
- id: z
589
- .string()
590
- .check(
591
- z.describe('Webhook subscription ID (`wh_…`).'),
592
- z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
593
- ),
594
- lastDeliveryAt: z
595
- .optional(z.iso.datetime())
596
- .check(
597
- z.describe(
598
- 'When Tempo last delivered an event successfully, as an ISO 8601 timestamp. Refreshed at most once per minute during sustained delivery.',
645
+ status: Status.check(z.meta({ examples: ['active'] })),
646
+ updatedAt: z.iso
647
+ .datetime()
648
+ .check(
649
+ z.describe('When the subscription was last changed, as an ISO 8601 timestamp.'),
650
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
599
651
  ),
600
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
601
- ),
602
- status: Status.check(z.meta({ examples: ['active'] })),
603
- updatedAt: z.iso
604
- .datetime()
605
- .check(
606
- z.describe('When the subscription was last changed, as an ISO 8601 timestamp.'),
607
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
652
+ })
653
+ .check(
654
+ z.describe(
655
+ 'A webhook subscription that tells Tempo which onchain events to send to its destination.',
608
656
  ),
609
- })
610
- .check(
611
- z.describe(
612
- 'A webhook subscription that tells Tempo which onchain events to send to your destination.',
613
657
  ),
614
- )
658
+ 'Webhook',
659
+ )
615
660
 
616
661
  /** Outcome of a single delivery attempt. */
617
662
  export const DeliveryStatus = z
@@ -622,69 +667,72 @@ export namespace schema {
622
667
  )
623
668
 
624
669
  /** A logged delivery attempt for a subscription. */
625
- export const Delivery = z
626
- .object({
627
- attempt: z
628
- .number()
629
- .check(
630
- z.int(),
631
- z.positive(),
632
- z.describe('Retry attempt number for this delivery, starting at 1.'),
633
- z.meta({ examples: [1] }),
634
- ),
635
- createdAt: z.iso
636
- .datetime()
637
- .check(
638
- z.describe('When this delivery attempt was created, as an ISO 8601 timestamp.'),
639
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
640
- ),
641
- error: z
642
- .optional(z.string())
643
- .check(
644
- z.describe('Why delivery failed, present when `status` is `failed`.'),
645
- z.meta({ examples: ['Connection timed out'] }),
646
- ),
647
- eventId: z
648
- .string()
649
- .check(
650
- z.describe('Stable event ID (`evt_…`) you can use to dedupe webhook deliveries.'),
651
- z.meta({ examples: ['evt_abc123'] }),
652
- ),
653
- id: z
654
- .string()
655
- .check(
656
- z.describe('Webhook delivery ID (`whd_…`).'),
657
- z.meta({ examples: ['whd_001718668800000_C1yJkk7CuML98HFthEDk9PsY'] }),
658
- ),
659
- requestUrl: z
660
- .string()
661
- .check(
662
- z.describe('Your callback URL that Tempo attempted to deliver to.'),
663
- z.meta({ examples: ['https://example.com/webhooks'] }),
664
- ),
665
- responseMs: z
666
- .optional(z.number().check(z.int(), z.nonnegative()))
667
- .check(
668
- z.describe(
669
- 'How long the delivery attempt took in milliseconds, when Tempo made a request.',
670
+ export const Delivery = OpenApi.component(
671
+ z
672
+ .object({
673
+ attempt: z
674
+ .number()
675
+ .check(
676
+ z.int(),
677
+ z.positive(),
678
+ z.describe('Retry attempt number for this delivery, starting at 1.'),
679
+ z.meta({ examples: [1] }),
670
680
  ),
671
- z.meta({ examples: [12] }),
672
- ),
673
- responseStatus: z
674
- .optional(z.number().check(z.int()))
675
- .check(
676
- z.describe('HTTP status your endpoint returned, when Tempo received a response.'),
677
- z.meta({ examples: [200] }),
678
- ),
679
- status: DeliveryStatus.check(z.meta({ examples: ['succeeded'] })),
680
- subscriptionId: z
681
- .string()
682
- .check(
683
- z.describe('Subscription ID (`wh_…`) this delivery belongs to.'),
684
- z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
685
- ),
686
- })
687
- .check(z.describe('One attempt by Tempo to deliver an event to your webhook URL.'))
681
+ createdAt: z.iso
682
+ .datetime()
683
+ .check(
684
+ z.describe('When this delivery attempt was created, as an ISO 8601 timestamp.'),
685
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
686
+ ),
687
+ error: z
688
+ .optional(z.string())
689
+ .check(
690
+ z.describe('Why delivery failed, present when `status` is `failed`.'),
691
+ z.meta({ examples: ['Connection timed out'] }),
692
+ ),
693
+ eventId: z
694
+ .string()
695
+ .check(
696
+ z.describe('Stable event ID (`evt_…`) you can use to dedupe webhook deliveries.'),
697
+ z.meta({ examples: ['evt_abc123'] }),
698
+ ),
699
+ id: z
700
+ .string()
701
+ .check(
702
+ z.describe('Webhook delivery ID (`whd_…`).'),
703
+ z.meta({ examples: ['whd_001718668800000_C1yJkk7CuML98HFthEDk9PsY'] }),
704
+ ),
705
+ requestUrl: z
706
+ .url()
707
+ .check(
708
+ z.describe('Your callback URL that Tempo attempted to deliver to.'),
709
+ z.meta({ examples: ['https://example.com/webhooks'] }),
710
+ ),
711
+ responseMs: z
712
+ .optional(z.number().check(z.int(), z.nonnegative()))
713
+ .check(
714
+ z.describe(
715
+ 'How long the delivery attempt took in milliseconds, when Tempo made a request.',
716
+ ),
717
+ z.meta({ examples: [12] }),
718
+ ),
719
+ responseStatus: z
720
+ .optional(z.number().check(z.int()))
721
+ .check(
722
+ z.describe('HTTP status your endpoint returned, when Tempo received a response.'),
723
+ z.meta({ examples: [200] }),
724
+ ),
725
+ status: DeliveryStatus.check(z.meta({ examples: ['succeeded'] })),
726
+ subscriptionId: z
727
+ .string()
728
+ .check(
729
+ z.describe('Subscription ID (`wh_…`) this delivery belongs to.'),
730
+ z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
731
+ ),
732
+ })
733
+ .check(z.describe('One attempt by Tempo to deliver an event to a webhook destination.')),
734
+ 'WebhookDelivery',
735
+ )
688
736
 
689
737
  /**
690
738
  * A `transfer` event payload: the decoded TIP-20 `Transfer` row. Mirrors a
@@ -692,88 +740,94 @@ export namespace schema {
692
740
  * read endpoint adds (webhook delivery does not perform per-event token
693
741
  * lookups).
694
742
  */
695
- export const TransferEvent = z
696
- .object({
697
- address: Schema.TokenAddress.check(
698
- z.describe('TIP-20 token contract address.'),
699
- z.meta({ examples: ['0x20c0000000000000000000008f5425160ebe5525'] }),
700
- ),
701
- amount: z
702
- .string()
703
- .check(
704
- z.describe('Amount transferred, as a decimal integer string in the token base unit.'),
705
- z.meta({ examples: ['10000'] }),
743
+ export const TransferEvent = OpenApi.component(
744
+ z
745
+ .object({
746
+ address: Schema.TokenAddress.check(
747
+ z.describe('TIP-20 token contract address.'),
748
+ z.meta({ examples: ['0x20c0000000000000000000008f5425160ebe5525'] }),
706
749
  ),
707
- blockNumber: z
708
- .number()
709
- .check(
710
- z.int(),
711
- z.nonnegative(),
712
- z.describe('Block number where this transfer was included.'),
713
- z.meta({ examples: [1000002] }),
750
+ amount: z
751
+ .string()
752
+ .check(
753
+ z.describe('Amount transferred, as a decimal integer string in the token base unit.'),
754
+ z.meta({ examples: ['10000'] }),
755
+ ),
756
+ blockNumber: z
757
+ .number()
758
+ .check(
759
+ z.int(),
760
+ z.nonnegative(),
761
+ z.describe('Block number where this transfer was included.'),
762
+ z.meta({ examples: [1000002] }),
763
+ ),
764
+ recipient: Schema.Address.check(
765
+ z.describe('Address that received the transfer.'),
766
+ z.meta({ examples: ['0x9e39034aae71fb89f66061a2602eb6efec271754'] }),
714
767
  ),
715
- recipient: Schema.Address.check(
716
- z.describe('Address that received the transfer.'),
717
- z.meta({ examples: ['0x9e39034aae71fb89f66061a2602eb6efec271754'] }),
718
- ),
719
- sender: Schema.Address.check(
720
- z.describe('Address that sent the transfer.'),
721
- z.meta({ examples: ['0xe7687128b0a808c2831ff94d4f7b2fb35c65af38'] }),
722
- ),
723
- timestamp: z.iso
724
- .datetime()
725
- .check(
726
- z.describe('Block timestamp as an ISO 8601 string.'),
727
- z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
768
+ sender: Schema.Address.check(
769
+ z.describe('Address that sent the transfer.'),
770
+ z.meta({ examples: ['0xe7687128b0a808c2831ff94d4f7b2fb35c65af38'] }),
728
771
  ),
729
- token: z.optional(
730
- z
731
- .object({
732
- decimals: z
733
- .number()
734
- .check(
735
- z.int(),
736
- z.nonnegative(),
737
- z.describe('Number of decimals the token uses.'),
738
- z.meta({ examples: [6] }),
739
- ),
740
- symbol: z
741
- .string()
742
- .check(z.describe('Token symbol (e.g. `USDC`).'), z.meta({ examples: ['USDC'] })),
743
- })
772
+ timestamp: z.iso
773
+ .datetime()
744
774
  .check(
745
- z.describe(
746
- 'Best-effort token metadata (symbol/decimals) resolved before delivery so `amount` can render as a human amount. Omitted when the lookup is unavailable.',
747
- ),
775
+ z.describe('Block timestamp as an ISO 8601 string.'),
776
+ z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
748
777
  ),
778
+ token: z.optional(
779
+ z
780
+ .object({
781
+ decimals: z
782
+ .number()
783
+ .check(
784
+ z.int(),
785
+ z.nonnegative(),
786
+ z.describe('Number of decimals the token uses.'),
787
+ z.meta({ examples: [6] }),
788
+ ),
789
+ symbol: z
790
+ .string()
791
+ .check(z.describe('Token symbol (e.g. `USDC`).'), z.meta({ examples: ['USDC'] })),
792
+ })
793
+ .check(
794
+ z.describe(
795
+ 'Best-effort token metadata (symbol/decimals) resolved before delivery so `amount` can render as a human amount. Omitted when the lookup is unavailable.',
796
+ ),
797
+ ),
798
+ ),
799
+ transactionHash: Schema.Hash.check(
800
+ z.describe('Transaction hash that contains this transfer.'),
801
+ z.meta({
802
+ examples: ['0x3d24a706cc2f6f4c96620bef1f61ddb23040ff77c22c8db42918c7c424bbf9d3'],
803
+ }),
804
+ ),
805
+ })
806
+ .check(
807
+ z.describe('Payload for a `token:transfer` event, decoded from a TIP-20 `Transfer` log.'),
749
808
  ),
750
- transactionHash: Schema.Hash.check(
751
- z.describe('Transaction hash that contains this transfer.'),
752
- z.meta({
753
- examples: ['0x3d24a706cc2f6f4c96620bef1f61ddb23040ff77c22c8db42918c7c424bbf9d3'],
754
- }),
755
- ),
756
- })
757
- .check(
758
- z.describe('Payload for a `token:transfer` event, decoded from a TIP-20 `Transfer` log.'),
759
- )
809
+ 'WebhookTransferEvent',
810
+ )
760
811
 
761
812
  /**
762
813
  * A `transaction` event payload using the humanized transaction shape without
763
814
  * opt-in read resources such as receipts.
764
815
  */
765
- export const TransactionEvent = z
766
- .object({
767
- ...Transactions.schema.Transaction.shape,
768
- meta: z
769
- .object({
770
- rpc: Transactions.schema.Rpc.Transaction.check(
771
- z.describe('The original JSON-RPC transaction payload.'),
772
- ),
773
- })
774
- .check(z.describe('Metadata for this transaction webhook event.')),
775
- })
776
- .check(z.describe('A transaction included in a block.'))
816
+ export const TransactionEvent = OpenApi.component(
817
+ z
818
+ .object({
819
+ ...Transactions.schema.Transaction.shape,
820
+ meta: z
821
+ .object({
822
+ rpc: Transactions.schema.Rpc.Transaction.check(
823
+ z.describe('The original JSON-RPC transaction payload.'),
824
+ ),
825
+ })
826
+ .check(z.describe('Metadata for this transaction webhook event.')),
827
+ })
828
+ .check(z.describe('A transaction included in a block.')),
829
+ 'WebhookTransactionEvent',
830
+ )
777
831
 
778
832
  /**
779
833
  * A `log:emitted` event payload: the raw contract event log. When a
@@ -781,188 +835,207 @@ export namespace schema {
781
835
  * `event`/`args` fields carry the decoded event name and arguments (large
782
836
  * integers as decimal strings).
783
837
  */
784
- export const LogEvent = z
785
- .object({
786
- address: Schema.Address.check(
787
- z.describe('Contract that emitted the log.'),
788
- z.meta({ examples: ['0x20c00000000000000000000071de0cd31ab0d105'] }),
789
- ),
790
- args: z.optional(
791
- z
792
- .record(z.string(), z.unknown())
793
- .check(
794
- z.describe(
795
- 'Decoded event arguments, present only when a `signature` filter was supplied and decoding succeeded.',
796
- ),
797
- z.meta({ examples: [{ from: '0xe768…', to: '0x9e39…', value: '10000' }] }),
798
- ),
799
- ),
800
- blockNumber: z
801
- .number()
802
- .check(
803
- z.int(),
804
- z.nonnegative(),
805
- z.describe('Block number the log was included in.'),
806
- z.meta({ examples: [1000002] }),
838
+ export const LogEvent = OpenApi.component(
839
+ z
840
+ .object({
841
+ address: Schema.Address.check(
842
+ z.describe('Contract that emitted the log.'),
843
+ z.meta({ examples: ['0x20c00000000000000000000071de0cd31ab0d105'] }),
807
844
  ),
808
- data: Schema.Hex.check(
809
- z.describe('Unindexed log data (ABI-encoded).'),
810
- z.meta({
811
- examples: ['0x0000000000000000000000000000000000000000000000000000000000002710'],
812
- }),
813
- ),
814
- event: z.optional(
815
- z
816
- .object({
817
- name: z
818
- .string()
819
- .check(z.describe('Decoded event name.'), z.meta({ examples: ['Transfer'] })),
820
- signature: z.string().check(
821
- z.describe('Human-readable event signature used to decode the log.'),
822
- z.meta({
823
- examples: [
824
- 'event Transfer(address indexed from, address indexed to, uint256 value)',
825
- ],
826
- }),
827
- ),
828
- topic0: Schema.Hash.check(
829
- z.describe('Event signature hash (topic 0).'),
830
- z.meta({
831
- examples: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'],
832
- }),
845
+ args: z.optional(
846
+ z
847
+ .record(z.string(), z.unknown())
848
+ .check(
849
+ z.describe(
850
+ 'Decoded event arguments, present only when a `signature` filter was supplied and decoding succeeded.',
851
+ ),
852
+ z.meta({ examples: [{ from: '0xe768…', to: '0x9e39…', value: '10000' }] }),
833
853
  ),
834
- })
854
+ ),
855
+ blockNumber: z
856
+ .number()
835
857
  .check(
836
- z.describe(
837
- 'Decoded event identity, present only when a `signature` filter was supplied.',
838
- ),
858
+ z.int(),
859
+ z.nonnegative(),
860
+ z.describe('Block number the log was included in.'),
861
+ z.meta({ examples: [1000002] }),
839
862
  ),
840
- ),
841
- logIndex: z
842
- .number()
843
- .check(
844
- z.int(),
845
- z.nonnegative(),
846
- z.describe('Index of the log within its block.'),
847
- z.meta({ examples: [0] }),
863
+ data: Schema.Hex.check(
864
+ z.describe('Unindexed log data (ABI-encoded).'),
865
+ z.meta({
866
+ examples: ['0x0000000000000000000000000000000000000000000000000000000000002710'],
867
+ }),
848
868
  ),
849
- timestamp: z.iso
850
- .datetime()
851
- .check(
852
- z.describe('When the block was produced, as an ISO 8601 timestamp.'),
853
- z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
869
+ event: z.optional(
870
+ z
871
+ .object({
872
+ name: z
873
+ .string()
874
+ .check(z.describe('Decoded event name.'), z.meta({ examples: ['Transfer'] })),
875
+ signature: z.string().check(
876
+ z.describe('Human-readable event signature used to decode the log.'),
877
+ z.meta({
878
+ examples: [
879
+ 'event Transfer(address indexed from, address indexed to, uint256 value)',
880
+ ],
881
+ }),
882
+ ),
883
+ topic0: Schema.Hash.check(
884
+ z.describe('Event signature hash (topic 0).'),
885
+ z.meta({
886
+ examples: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'],
887
+ }),
888
+ ),
889
+ })
890
+ .check(
891
+ z.describe(
892
+ 'Decoded event identity, present only when a `signature` filter was supplied.',
893
+ ),
894
+ ),
854
895
  ),
855
- topics: z.array(Schema.Hash).check(
856
- z.describe('Log topics, starting with the event signature hash (topic 0).'),
857
- z.meta({
858
- examples: [
859
- [
860
- '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
861
- '0x000000000000000000000000e7687128b0a808c2831ff94d4f7b2fb35c65af38',
896
+ logIndex: z
897
+ .number()
898
+ .check(
899
+ z.int(),
900
+ z.nonnegative(),
901
+ z.describe('Index of the log within its block.'),
902
+ z.meta({ examples: [0] }),
903
+ ),
904
+ timestamp: z.iso
905
+ .datetime()
906
+ .check(
907
+ z.describe('When the block was produced, as an ISO 8601 timestamp.'),
908
+ z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
909
+ ),
910
+ topics: z.array(Schema.Hash).check(
911
+ z.describe(
912
+ 'Zero to four log topics; non-anonymous events start with the event signature hash.',
913
+ ),
914
+ z.meta({
915
+ examples: [
916
+ [],
917
+ [
918
+ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
919
+ '0x000000000000000000000000e7687128b0a808c2831ff94d4f7b2fb35c65af38',
920
+ ],
862
921
  ],
863
- ],
864
- }),
865
- ),
866
- transactionHash: Schema.Hash.check(
867
- z.describe('Hash of the transaction that emitted the log.'),
868
- z.meta({
869
- examples: ['0x3d24a706cc2f6f4c96620bef1f61ddb23040ff77c22c8db42918c7c424bbf9d3'],
870
- }),
871
- ),
872
- transactionIndex: z
873
- .number()
874
- .check(
875
- z.int(),
876
- z.nonnegative(),
877
- z.describe('Index of the transaction within its block.'),
878
- z.meta({ examples: [0] }),
879
- ),
880
- })
881
- .check(z.describe('Payload for a `log:emitted` event (a raw contract event log).'))
882
-
883
- /** Payload for a `block:created` event (an RPC-derived block header). */
884
- export const BlockEvent = z
885
- .object({
886
- number: z
887
- .number()
888
- .check(
889
- z.int(),
890
- z.nonnegative(),
891
- z.describe('Block height, starting from genesis block 0.'),
892
- z.meta({ examples: [1000002] }),
922
+ }),
893
923
  ),
894
- hash: Schema.Hash.check(
895
- z.describe('Hash that identifies this block.'),
896
- z.meta({
897
- examples: ['0x3fe7d9e595f3d8215ec840c6ef55ac0bead58933e96fc2ead0f2aaf79715f45d'],
898
- }),
899
- ),
900
- parentHash: Schema.Hash.check(
901
- z.describe('Hash of the previous block in the chain.'),
902
- z.meta({
903
- examples: ['0xa406dff9c51cc2abbef3a811f0499e99a568bf781019f129ab45dca1df0e43e5'],
904
- }),
905
- ),
906
- miner: Schema.Address.check(
907
- z.describe('Address of the block producer (miner/proposer).'),
908
- z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
909
- ),
910
- proposer: z.optional(
911
- Schema.Address.check(
912
- z.describe('Consensus proposer of the block, when the chain records one.'),
913
- z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
924
+ transactionHash: Schema.Hash.check(
925
+ z.describe('Hash of the transaction that emitted the log.'),
926
+ z.meta({
927
+ examples: ['0x3d24a706cc2f6f4c96620bef1f61ddb23040ff77c22c8db42918c7c424bbf9d3'],
928
+ }),
914
929
  ),
915
- ),
916
- gasUsed: z
917
- .number()
918
- .check(
919
- z.int(),
920
- z.nonnegative(),
921
- z.describe('Total gas used by every transaction in this block.'),
922
- z.meta({ examples: [4340281] }),
930
+ transactionIndex: z
931
+ .number()
932
+ .check(
933
+ z.int(),
934
+ z.nonnegative(),
935
+ z.describe('Index of the transaction within its block.'),
936
+ z.meta({ examples: [0] }),
937
+ ),
938
+ })
939
+ .check(z.describe('Payload for a `log:emitted` event (a raw contract event log).')),
940
+ 'WebhookLogEvent',
941
+ )
942
+
943
+ /** Payload for a `block:created` event (an RPC-derived block header). */
944
+ export const BlockEvent = OpenApi.component(
945
+ z
946
+ .object({
947
+ number: z
948
+ .number()
949
+ .check(
950
+ z.int(),
951
+ z.nonnegative(),
952
+ z.describe('Block height, starting from genesis block 0.'),
953
+ z.meta({ examples: [1000002] }),
954
+ ),
955
+ hash: Schema.Hash.check(
956
+ z.describe('Hash that identifies this block.'),
957
+ z.meta({
958
+ examples: ['0x3fe7d9e595f3d8215ec840c6ef55ac0bead58933e96fc2ead0f2aaf79715f45d'],
959
+ }),
923
960
  ),
924
- gasLimit: z
925
- .number()
926
- .check(
927
- z.int(),
928
- z.nonnegative(),
929
- z.describe('Maximum gas available for all transactions in this block.'),
930
- z.meta({ examples: [500000000] }),
961
+ parentHash: Schema.Hash.check(
962
+ z.describe('Hash of the previous block in the chain.'),
963
+ z.meta({
964
+ examples: ['0xa406dff9c51cc2abbef3a811f0499e99a568bf781019f129ab45dca1df0e43e5'],
965
+ }),
931
966
  ),
932
- transactionCount: z
933
- .number()
934
- .check(
935
- z.int(),
936
- z.nonnegative(),
937
- z.describe('Number of transactions included in this block.'),
938
- z.meta({ examples: [3] }),
967
+ miner: Schema.Address.check(
968
+ z.describe('Address of the block producer (miner/proposer).'),
969
+ z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
939
970
  ),
940
- timestamp: z.iso
941
- .datetime()
942
- .check(
943
- z.describe('When the block was produced, as an ISO 8601 timestamp.'),
944
- z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
971
+ proposer: z.optional(
972
+ Schema.Address.check(
973
+ z.describe('Consensus proposer of the block, when the chain records one.'),
974
+ z.meta({ examples: ['0x0000000000000000000000000000000000000000'] }),
975
+ ),
945
976
  ),
946
- })
947
- .check(z.describe('Payload for a `block:created` event (a new block header).'))
977
+ gasUsed: z
978
+ .number()
979
+ .check(
980
+ z.int(),
981
+ z.nonnegative(),
982
+ z.describe('Total gas used by every transaction in this block.'),
983
+ z.meta({ examples: [4340281] }),
984
+ ),
985
+ gasLimit: z
986
+ .number()
987
+ .check(
988
+ z.int(),
989
+ z.nonnegative(),
990
+ z.describe('Maximum gas available for all transactions in this block.'),
991
+ z.meta({ examples: [500000000] }),
992
+ ),
993
+ transactionCount: z
994
+ .number()
995
+ .check(
996
+ z.int(),
997
+ z.nonnegative(),
998
+ z.describe('Number of transactions included in this block.'),
999
+ z.meta({ examples: [3] }),
1000
+ ),
1001
+ timestamp: z.iso
1002
+ .datetime()
1003
+ .check(
1004
+ z.describe('When the block was produced, as an ISO 8601 timestamp.'),
1005
+ z.meta({ examples: ['2026-01-14T18:38:03.685Z'] }),
1006
+ ),
1007
+ })
1008
+ .check(z.describe('Payload for a `block:created` event (a new block header).')),
1009
+ 'WebhookBlockEvent',
1010
+ )
948
1011
 
949
- /** Public funding deposit after a committed material change. */
950
- export const FundingDepositEvent = FundingDeposit.schema.FundingDeposit
1012
+ /** Public route deposit after a committed material change. */
1013
+ export const RoutesDepositEvent = RoutesDeposit.schema.RoutesDeposit
951
1014
 
952
- /** Public funding transfer after a committed material change. */
953
- export const FundingTransferEvent = FundingTransfer.schema.FundingTransfer
1015
+ /** Public route transfer after a committed material change. */
1016
+ export const RoutesTransferEvent = RoutesTransfer.schema.RoutesTransfer
954
1017
 
955
1018
  /** A `ping` (synthetic test-delivery) payload, sent by `POST /webhooks/:id/ping`. */
956
- export const PingEvent = z
957
- .object({
958
- ping: z.literal(true).check(z.describe('Marks this payload as a synthetic ping test.')),
959
- })
960
- .check(z.describe('Payload for a webhook ping test delivery.'))
1019
+ export const PingEvent = OpenApi.component(
1020
+ z
1021
+ .object({
1022
+ ping: z
1023
+ .literal(true)
1024
+ .check(
1025
+ z.describe('Marks this payload as a synthetic ping test.'),
1026
+ z.meta({ examples: [true] }),
1027
+ ),
1028
+ })
1029
+ .check(z.describe('Payload for a webhook ping test delivery.')),
1030
+ 'WebhookPingEvent',
1031
+ )
961
1032
 
962
1033
  /** Fields common to every delivery envelope. */
963
1034
  const envelopeBase = {
964
1035
  chainId: Schema.ChainId,
965
- context: z.optional(Context),
1036
+ context: z
1037
+ .optional(Context)
1038
+ .check(z.meta({ examples: [{ title: 'Prod USDC large transfers' }] })),
966
1039
  createdAt: z.iso
967
1040
  .datetime()
968
1041
  .check(
@@ -992,176 +1065,254 @@ export namespace schema {
992
1065
  * variant selector — without per-variant titles, inline `oneOf` members render
993
1066
  * as a single (first) collapsed schema.
994
1067
  */
995
- export const Envelope = z
996
- .discriminatedUnion('type', [
997
- z
998
- .object({ ...envelopeBase, data: TransferEvent, type: z.literal('token:transfer') })
999
- .check(z.meta({ title: 'Transfer event' })),
1000
- z
1001
- .object({
1002
- ...envelopeBase,
1003
- data: TransactionEvent,
1004
- type: z.literal('transaction:included'),
1005
- })
1006
- .check(z.meta({ title: 'Included transaction event' })),
1007
- z
1008
- .object({ ...envelopeBase, data: LogEvent, type: z.literal('log:emitted') })
1009
- .check(z.meta({ title: 'Log event' })),
1010
- z
1011
- .object({ ...envelopeBase, data: BlockEvent, type: z.literal('block:created') })
1012
- .check(z.meta({ title: 'Block event' })),
1013
- z
1014
- .object({
1015
- ...envelopeBase,
1016
- data: FundingDepositEvent,
1017
- type: z.literal('funding:deposit.updated'),
1018
- })
1019
- .check(z.meta({ title: 'Funding deposit updated event' })),
1020
- z
1021
- .object({
1022
- ...envelopeBase,
1023
- data: FundingTransferEvent,
1024
- type: z.literal('funding:transfer.updated'),
1025
- })
1026
- .check(z.meta({ title: 'Funding transfer updated event' })),
1027
- z
1028
- .object({ ...envelopeBase, data: PingEvent, type: z.literal('ping') })
1029
- .check(z.meta({ title: 'Ping (test delivery)' })),
1030
- ])
1031
- .check(z.describe('The signed JSON payload Tempo POSTs to your webhook URL.'))
1032
-
1033
- /** Schemas for the getWebhookEventTypes operation. */
1034
- export namespace getWebhookEventTypes {
1035
- export const Response = z
1036
- .object({
1037
- data: z
1038
- .array(
1039
- z.object({
1040
- description: z
1041
- .string()
1042
- .check(
1043
- z.describe('Plain-English description of the event type.'),
1044
- z.meta({ examples: ['TIP-20 token transfer event.'] }),
1045
- ),
1046
- type: EventType.check(z.meta({ examples: ['token:transfer'] })),
1047
- }),
1048
- )
1049
- .check(z.describe('Webhook event types available for subscription.')),
1050
- })
1051
- .check(z.describe('List of webhook event types Tempo can send.'))
1052
- }
1053
-
1054
- /** Schemas for the createWebhook operation. */
1055
- export namespace createWebhook {
1056
- /**
1057
- * Discriminated on `eventType` so each variant carries its own typed
1058
- * `filters` object — this is what lets the docs render the valid filter
1059
- * fields per event type instead of an opaque map. Variant `title`s drive the
1060
- * doc renderer's selector (see {@link schema.Envelope}).
1061
- */
1062
- export const Body = z
1063
- .discriminatedUnion('eventType', [
1068
+ export const Envelope = OpenApi.component(
1069
+ z
1070
+ .discriminatedUnion('type', [
1064
1071
  z
1065
1072
  .object({
1066
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1067
- context: z.optional(Context),
1068
- destination: Destination,
1069
- eventType: z
1070
- .literal('token:transfer')
1071
- .check(
1072
- z.describe('Event type you want Tempo to send to your webhook URL.'),
1073
- z.meta({ examples: ['token:transfer'] }),
1074
- ),
1075
- filters: z.optional(TransferFilters),
1073
+ ...envelopeBase,
1074
+ data: TransferEvent,
1075
+ type: z.literal('token:transfer').check(z.meta({ examples: ['token:transfer'] })),
1076
1076
  })
1077
- .check(z.meta({ title: 'Transfer subscription' })),
1077
+ .check(z.meta({ title: 'Transfer event' })),
1078
1078
  z
1079
1079
  .object({
1080
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1081
- context: z.optional(Context),
1082
- destination: Destination,
1083
- eventType: z
1080
+ ...envelopeBase,
1081
+ data: TransactionEvent,
1082
+ type: z
1084
1083
  .literal('transaction:included')
1085
- .check(
1086
- z.describe('Event type you want Tempo to send to your webhook URL.'),
1087
- z.meta({ examples: ['transaction:included'] }),
1088
- ),
1089
- filters: z.optional(TxFilters),
1084
+ .check(z.meta({ examples: ['transaction:included'] })),
1090
1085
  })
1091
- .check(z.meta({ title: 'Included-transaction subscription' })),
1086
+ .check(z.meta({ title: 'Included transaction event' })),
1092
1087
  z
1093
1088
  .object({
1094
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1095
- context: z.optional(Context),
1096
- destination: Destination,
1097
- eventType: z
1098
- .literal('log:emitted')
1099
- .check(
1100
- z.describe('Event type you want Tempo to send to your webhook URL.'),
1101
- z.meta({ examples: ['log:emitted'] }),
1102
- ),
1103
- filters: LogFilters,
1089
+ ...envelopeBase,
1090
+ data: LogEvent,
1091
+ type: z.literal('log:emitted').check(z.meta({ examples: ['log:emitted'] })),
1104
1092
  })
1105
- .check(z.meta({ title: 'Log subscription' })),
1093
+ .check(z.meta({ title: 'Log event' })),
1106
1094
  z
1107
1095
  .object({
1108
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1109
- context: z.optional(Context),
1110
- destination: Destination,
1111
- eventType: z
1112
- .literal('block:created')
1113
- .check(
1114
- z.describe('Event type you want Tempo to send to your webhook URL.'),
1115
- z.meta({ examples: ['block:created'] }),
1116
- ),
1117
- filters: z.optional(BlockFilters),
1096
+ ...envelopeBase,
1097
+ data: BlockEvent,
1098
+ type: z.literal('block:created').check(z.meta({ examples: ['block:created'] })),
1118
1099
  })
1119
- .check(z.meta({ title: 'Block subscription' })),
1100
+ .check(z.meta({ title: 'Block event' })),
1120
1101
  z
1121
1102
  .object({
1122
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1123
- context: z.optional(Context),
1124
- destination: Destination,
1125
- eventType: z
1126
- .literal('funding:deposit.updated')
1127
- .check(
1128
- z.describe('Event type for committed funding deposit changes.'),
1129
- z.meta({ examples: ['funding:deposit.updated'] }),
1130
- ),
1131
- filters: z.optional(FundingDepositFilters),
1103
+ ...envelopeBase,
1104
+ data: RoutesDepositEvent,
1105
+ type: z
1106
+ .literal('routes:deposit.updated')
1107
+ .check(z.meta({ examples: ['routes:deposit.updated'] })),
1132
1108
  })
1133
- .check(z.meta({ title: 'Funding deposit subscription' })),
1109
+ .check(z.meta({ title: 'Route deposit updated event' })),
1134
1110
  z
1135
1111
  .object({
1136
- chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1137
- context: z.optional(Context),
1138
- destination: Destination,
1139
- eventType: z
1140
- .literal('funding:transfer.updated')
1141
- .check(
1142
- z.describe('Event type for committed funding transfer changes.'),
1143
- z.meta({ examples: ['funding:transfer.updated'] }),
1144
- ),
1145
- filters: z.optional(FundingTransferFilters),
1112
+ ...envelopeBase,
1113
+ data: RoutesTransferEvent,
1114
+ type: z
1115
+ .literal('routes:transfer.updated')
1116
+ .check(z.meta({ examples: ['routes:transfer.updated'] })),
1117
+ })
1118
+ .check(z.meta({ title: 'Route transfer updated event' })),
1119
+ z
1120
+ .object({
1121
+ ...envelopeBase,
1122
+ data: PingEvent,
1123
+ type: z.literal('ping').check(z.meta({ examples: ['ping'] })),
1146
1124
  })
1147
- .check(z.meta({ title: 'Funding transfer subscription' })),
1125
+ .check(z.meta({ title: 'Ping (test delivery)' })),
1148
1126
  ])
1149
- .check(z.describe('Details for creating a webhook subscription.'))
1127
+ .check(z.describe('The signed JSON payload Tempo POSTs to a webhook destination.')),
1128
+ 'WebhookEventEnvelope',
1129
+ )
1150
1130
 
1151
- export const Response = z
1152
- .object({
1153
- ...Subscription.shape,
1154
- destination: Destination,
1155
- secret: z
1156
- .string()
1157
- .check(
1158
- z.describe(
1159
- 'HMAC signing secret (`whsec_…`) used to verify Tempo webhook signatures. It is shown once when you create the webhook, so store it now.',
1131
+ /** Schemas for the getWebhookEventTypes operation. */
1132
+ export namespace getWebhookEventTypes {
1133
+ const EventTypeEntry = OpenApi.component(
1134
+ z
1135
+ .object({
1136
+ description: z
1137
+ .string()
1138
+ .check(
1139
+ z.describe('Plain-English description of the event type.'),
1140
+ z.meta({ examples: ['TIP-20 token transfer event.'] }),
1160
1141
  ),
1161
- z.meta({ examples: ['whsec_abc123'] }),
1142
+ type: EventType.check(z.meta({ examples: ['token:transfer'] })),
1143
+ })
1144
+ .check(z.describe('One webhook event type available for subscription.')),
1145
+ 'WebhookEventType',
1146
+ )
1147
+
1148
+ export const Response = OpenApi.component(
1149
+ z
1150
+ .object({
1151
+ data: z.array(EventTypeEntry).check(
1152
+ z.describe('Webhook event types available for subscription.'),
1153
+ z.meta({
1154
+ examples: [[{ description: 'TIP-20 token transfer event.', type: 'token:transfer' }]],
1155
+ }),
1162
1156
  ),
1163
- })
1164
- .check(z.describe('The new webhook subscription, including the one-time signing secret.'))
1157
+ })
1158
+ .check(z.describe('List of webhook event types Tempo can send.')),
1159
+ 'WebhookEventTypeList',
1160
+ )
1161
+ }
1162
+
1163
+ /** Schemas for the createWebhook operation. */
1164
+ export namespace createWebhook {
1165
+ /** Request variant for TIP-20 transfer subscriptions. */
1166
+ export const TransferBody = OpenApi.component(
1167
+ z
1168
+ .object({
1169
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1170
+ context: z.optional(Context),
1171
+ destination: Destination,
1172
+ eventType: z
1173
+ .literal('token:transfer')
1174
+ .check(
1175
+ z.describe('Event type you want Tempo to send to your webhook URL.'),
1176
+ z.meta({ examples: ['token:transfer'] }),
1177
+ ),
1178
+ filters: z.optional(TransferFilters),
1179
+ })
1180
+ .check(z.meta({ title: 'Transfer subscription' })),
1181
+ 'CreateWebhookTransferRequest',
1182
+ )
1183
+
1184
+ /** Request variant for included transaction subscriptions. */
1185
+ export const TransactionBody = OpenApi.component(
1186
+ z
1187
+ .object({
1188
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1189
+ context: z.optional(Context),
1190
+ destination: Destination,
1191
+ eventType: z
1192
+ .literal('transaction:included')
1193
+ .check(
1194
+ z.describe('Event type you want Tempo to send to your webhook URL.'),
1195
+ z.meta({ examples: ['transaction:included'] }),
1196
+ ),
1197
+ filters: z.optional(TxFilters),
1198
+ })
1199
+ .check(z.meta({ title: 'Included-transaction subscription' })),
1200
+ 'CreateWebhookTransactionRequest',
1201
+ )
1202
+
1203
+ /** Request variant for emitted log subscriptions. */
1204
+ export const LogBody = OpenApi.component(
1205
+ z
1206
+ .object({
1207
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1208
+ context: z.optional(Context),
1209
+ destination: Destination,
1210
+ eventType: z
1211
+ .literal('log:emitted')
1212
+ .check(
1213
+ z.describe('Event type you want Tempo to send to your webhook URL.'),
1214
+ z.meta({ examples: ['log:emitted'] }),
1215
+ ),
1216
+ filters: LogFilters,
1217
+ })
1218
+ .check(z.meta({ title: 'Log subscription' })),
1219
+ 'CreateWebhookLogRequest',
1220
+ )
1221
+
1222
+ /** Request variant for created block subscriptions. */
1223
+ export const BlockBody = OpenApi.component(
1224
+ z
1225
+ .object({
1226
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1227
+ context: z.optional(Context),
1228
+ destination: Destination,
1229
+ eventType: z
1230
+ .literal('block:created')
1231
+ .check(
1232
+ z.describe('Event type you want Tempo to send to your webhook URL.'),
1233
+ z.meta({ examples: ['block:created'] }),
1234
+ ),
1235
+ filters: z.optional(BlockFilters),
1236
+ })
1237
+ .check(z.meta({ title: 'Block subscription' })),
1238
+ 'CreateWebhookBlockRequest',
1239
+ )
1240
+
1241
+ /** Request variant for route deposit subscriptions. */
1242
+ export const RoutesDepositBody = OpenApi.component(
1243
+ z
1244
+ .object({
1245
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1246
+ context: z.optional(Context),
1247
+ destination: Destination,
1248
+ eventType: z
1249
+ .literal('routes:deposit.updated')
1250
+ .check(
1251
+ z.describe('Event type for committed route deposit changes.'),
1252
+ z.meta({ examples: ['routes:deposit.updated'] }),
1253
+ ),
1254
+ filters: z.optional(RoutesDepositFilters),
1255
+ })
1256
+ .check(z.meta({ title: 'Route deposit subscription' })),
1257
+ 'CreateWebhookRoutesDepositRequest',
1258
+ )
1259
+
1260
+ /** Request variant for route transfer subscriptions. */
1261
+ export const RoutesTransferBody = OpenApi.component(
1262
+ z
1263
+ .object({
1264
+ chainId: z.optional(Schema.ChainId).check(z.meta({ examples: [4217] })),
1265
+ context: z.optional(Context),
1266
+ destination: Destination,
1267
+ eventType: z
1268
+ .literal('routes:transfer.updated')
1269
+ .check(
1270
+ z.describe('Event type for committed route transfer changes.'),
1271
+ z.meta({ examples: ['routes:transfer.updated'] }),
1272
+ ),
1273
+ filters: z.optional(RoutesTransferFilters),
1274
+ })
1275
+ .check(z.meta({ title: 'Route transfer subscription' })),
1276
+ 'CreateWebhookRoutesTransferRequest',
1277
+ )
1278
+
1279
+ /**
1280
+ * Discriminated on `eventType` so each variant carries its own typed
1281
+ * `filters` object — this is what lets the docs render the valid filter
1282
+ * fields per event type instead of an opaque map. Variant `title`s drive the
1283
+ * doc renderer's selector (see {@link schema.Envelope}).
1284
+ */
1285
+ export const Body = OpenApi.component(
1286
+ z
1287
+ .discriminatedUnion('eventType', [
1288
+ TransferBody,
1289
+ TransactionBody,
1290
+ LogBody,
1291
+ BlockBody,
1292
+ RoutesDepositBody,
1293
+ RoutesTransferBody,
1294
+ ])
1295
+ .check(z.describe('Details for creating a webhook subscription.')),
1296
+ 'CreateWebhookRequest',
1297
+ )
1298
+
1299
+ export const Response = OpenApi.component(
1300
+ z
1301
+ .object({
1302
+ ...Subscription.shape,
1303
+ destination: Destination,
1304
+ secret: z
1305
+ .string()
1306
+ .check(
1307
+ z.describe(
1308
+ 'HMAC signing secret (`whsec_…`) used to verify Tempo webhook signatures. It is shown once when you create the webhook, so store it now.',
1309
+ ),
1310
+ z.meta({ examples: ['whsec_abc123'] }),
1311
+ ),
1312
+ })
1313
+ .check(z.describe('The new webhook subscription, including the one-time signing secret.')),
1314
+ 'CreateWebhookResponse',
1315
+ )
1165
1316
  }
1166
1317
 
1167
1318
  /** Schemas for the listWebhooks operation. */
@@ -1178,15 +1329,23 @@ export namespace schema {
1178
1329
  z.describe('Query parameters for listing your webhook subscriptions.'),
1179
1330
  )
1180
1331
 
1181
- export const Response = z
1182
- .object({
1183
- data: z.array(Subscription).check(z.describe('Webhook subscriptions on this page.')),
1184
- meta: z
1185
- .optional(Schema.CountMeta)
1186
- .check(z.describe('Extra response metadata requested with `include`.')),
1187
- nextCursor: Schema.NextCursor,
1188
- })
1189
- .check(z.describe('A page of your webhook subscriptions.'))
1332
+ export const Response = OpenApi.component(
1333
+ z
1334
+ .object({
1335
+ data: z
1336
+ .array(Subscription)
1337
+ .check(z.describe('Webhook subscriptions on this page.'), z.meta({ examples: [[]] })),
1338
+ meta: z
1339
+ .optional(Schema.CountMeta)
1340
+ .check(
1341
+ z.describe('Extra response metadata requested with `include`.'),
1342
+ z.meta({ examples: [{ totalCount: 1, totalCountCapped: false }] }),
1343
+ ),
1344
+ nextCursor: Schema.NextCursor,
1345
+ })
1346
+ .check(z.describe('A page of webhook subscriptions.')),
1347
+ 'WebhookList',
1348
+ )
1190
1349
  }
1191
1350
 
1192
1351
  /** Schemas for the getWebhook operation. */
@@ -1221,55 +1380,69 @@ export namespace schema {
1221
1380
  z.describe('Query parameters for listing webhook delivery attempts.'),
1222
1381
  )
1223
1382
 
1224
- export const Response = z
1225
- .object({
1226
- data: z.array(Delivery).check(z.describe('Webhook delivery attempts on this page.')),
1227
- meta: z
1228
- .optional(Schema.CountMeta)
1229
- .check(z.describe('Extra response metadata requested with `include`.')),
1230
- nextCursor: Schema.NextCursor,
1231
- })
1232
- .check(z.describe('A page of webhook delivery attempts.'))
1383
+ export const Response = OpenApi.component(
1384
+ z
1385
+ .object({
1386
+ data: z
1387
+ .array(Delivery)
1388
+ .check(
1389
+ z.describe('Webhook delivery attempts on this page.'),
1390
+ z.meta({ examples: [[]] }),
1391
+ ),
1392
+ meta: z
1393
+ .optional(Schema.CountMeta)
1394
+ .check(
1395
+ z.describe('Extra response metadata requested with `include`.'),
1396
+ z.meta({ examples: [{ totalCount: 1, totalCountCapped: false }] }),
1397
+ ),
1398
+ nextCursor: Schema.NextCursor,
1399
+ })
1400
+ .check(z.describe('A page of webhook delivery attempts.')),
1401
+ 'WebhookDeliveryList',
1402
+ )
1233
1403
  }
1234
1404
 
1235
1405
  /** Schemas for the pingWebhook operation. */
1236
1406
  export namespace pingWebhook {
1237
1407
  export const Params = getWebhook.Params
1238
1408
 
1239
- export const Response = z
1240
- .object({
1241
- delivered: z
1242
- .boolean()
1243
- .check(
1244
- z.describe('Whether your endpoint returned a 2xx response.'),
1245
- z.meta({ examples: [true] }),
1246
- ),
1247
- error: z
1248
- .optional(z.string())
1249
- .check(
1250
- z.describe('Why the delivery failed, present when `delivered` is `false`.'),
1251
- z.meta({ examples: ['Connection timed out'] }),
1252
- ),
1253
- eventId: z
1254
- .string()
1255
- .check(
1256
- z.describe('Synthetic event ID (`evt_…`) Tempo sent for this ping.'),
1257
- z.meta({ examples: ['evt_abc123'] }),
1258
- ),
1259
- responseMs: z
1260
- .optional(z.number().check(z.int(), z.nonnegative()))
1261
- .check(
1262
- z.describe('Round-trip delivery time in milliseconds, when the request completed.'),
1263
- z.meta({ examples: [12] }),
1264
- ),
1265
- responseStatus: z
1266
- .optional(z.number().check(z.int()))
1267
- .check(
1268
- z.describe('HTTP status your endpoint returned, when Tempo received a response.'),
1269
- z.meta({ examples: [200] }),
1270
- ),
1271
- })
1272
- .check(z.describe('Result of sending a synthetic ping event to your webhook URL.'))
1409
+ export const Response = OpenApi.component(
1410
+ z
1411
+ .object({
1412
+ delivered: z
1413
+ .boolean()
1414
+ .check(
1415
+ z.describe('Whether your endpoint returned a 2xx response.'),
1416
+ z.meta({ examples: [true] }),
1417
+ ),
1418
+ error: z
1419
+ .optional(z.string())
1420
+ .check(
1421
+ z.describe('Why the delivery failed, present when `delivered` is `false`.'),
1422
+ z.meta({ examples: ['Connection timed out'] }),
1423
+ ),
1424
+ eventId: z
1425
+ .string()
1426
+ .check(
1427
+ z.describe('Synthetic event ID (`evt_…`) Tempo sent for this ping.'),
1428
+ z.meta({ examples: ['evt_abc123'] }),
1429
+ ),
1430
+ responseMs: z
1431
+ .optional(z.number().check(z.int(), z.nonnegative()))
1432
+ .check(
1433
+ z.describe('Round-trip delivery time in milliseconds, when the request completed.'),
1434
+ z.meta({ examples: [12] }),
1435
+ ),
1436
+ responseStatus: z
1437
+ .optional(z.number().check(z.int()))
1438
+ .check(
1439
+ z.describe('HTTP status your endpoint returned, when Tempo received a response.'),
1440
+ z.meta({ examples: [200] }),
1441
+ ),
1442
+ })
1443
+ .check(z.describe('Result of sending a synthetic ping event to a webhook destination.')),
1444
+ 'PingWebhookResponse',
1445
+ )
1273
1446
  }
1274
1447
 
1275
1448
  /** Schemas for the retryWebhookDelivery operation. */
@@ -1291,32 +1464,37 @@ export namespace schema {
1291
1464
  })
1292
1465
  .check(z.describe('Path parameters for retrying a webhook delivery.'))
1293
1466
 
1294
- export const Response = pingWebhook.Response
1467
+ export const Response = OpenApi.component(pingWebhook.Response, 'RetryWebhookDeliveryResponse')
1295
1468
  }
1296
1469
 
1297
1470
  /** Schemas for the updateWebhook operation. */
1298
1471
  export namespace updateWebhook {
1299
1472
  export const Params = getWebhook.Params
1300
1473
 
1301
- export const Body = z
1302
- .object({
1303
- context: z
1304
- .optional(z.nullable(Context))
1305
- .check(z.describe('New human context, or `null` to clear it.')),
1306
- destination: z
1307
- .optional(Destination)
1308
- .check(z.describe('New delivery destination for future events (URL or Slack channel).')),
1309
- filters: z
1310
- .optional(Filters)
1311
- .check(
1312
- z.describe('New filters to apply to future webhook events.'),
1313
- z.meta({ examples: [{ address: '0x20c0000000000000000000008f5425160ebe5525' }] }),
1314
- ),
1315
- status: z
1316
- .optional(Status)
1317
- .check(z.describe('New lifecycle status, such as pausing or resuming delivery.')),
1318
- })
1319
- .check(z.describe('Fields you want to update on the webhook subscription.'))
1474
+ export const Body = OpenApi.component(
1475
+ z
1476
+ .object({
1477
+ context: z
1478
+ .optional(z.nullable(Context))
1479
+ .check(z.describe('New human context, or `null` to clear it.')),
1480
+ destination: z
1481
+ .optional(Destination)
1482
+ .check(
1483
+ z.describe('New delivery destination for future events (URL or Slack channel).'),
1484
+ ),
1485
+ filters: z
1486
+ .optional(Filters)
1487
+ .check(
1488
+ z.describe('New filters to apply to future webhook events.'),
1489
+ z.meta({ examples: [{ address: '0x20c0000000000000000000008f5425160ebe5525' }] }),
1490
+ ),
1491
+ status: z
1492
+ .optional(Status)
1493
+ .check(z.describe('New lifecycle status, such as pausing or resuming delivery.')),
1494
+ })
1495
+ .check(z.describe('Fields to update on the webhook subscription.')),
1496
+ 'UpdateWebhookRequest',
1497
+ )
1320
1498
 
1321
1499
  export const Response = Subscription
1322
1500
  }
@@ -1325,16 +1503,19 @@ export namespace schema {
1325
1503
  export namespace deleteWebhook {
1326
1504
  export const Params = getWebhook.Params
1327
1505
 
1328
- export const Response = z
1329
- .object({
1330
- id: z
1331
- .string()
1332
- .check(
1333
- z.describe('ID of the webhook subscription that was deleted.'),
1334
- z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
1335
- ),
1336
- })
1337
- .check(z.describe('Confirmation that the webhook subscription was deleted.'))
1506
+ export const Response = OpenApi.component(
1507
+ z
1508
+ .object({
1509
+ id: z
1510
+ .string()
1511
+ .check(
1512
+ z.describe('ID of the webhook subscription that was deleted.'),
1513
+ z.meta({ examples: ['wh_001718668800000_2ZPE2gvateYEQ0dQslgvkhjx'] }),
1514
+ ),
1515
+ })
1516
+ .check(z.describe('Confirmation that the webhook subscription was deleted.')),
1517
+ 'DeleteWebhookResponse',
1518
+ )
1338
1519
  }
1339
1520
  }
1340
1521
 
@@ -1349,8 +1530,7 @@ export function webhooks(options: webhooks.Options = {}) {
1349
1530
  const hidden = !options.enabled
1350
1531
  const availableEventTypes = eventTypeDescriptions.filter(
1351
1532
  (eventType) =>
1352
- !isFundingEventType(eventType.type) ||
1353
- options.applicationEventTypes?.includes(eventType.type),
1533
+ !isRoutesEventType(eventType.type) || options.applicationEventTypes?.includes(eventType.type),
1354
1534
  )
1355
1535
  const availableEventTypeSet = new Set(availableEventTypes.map((eventType) => eventType.type))
1356
1536
  // Gate the whole resource on a configured state store. Without it the
@@ -1378,6 +1558,16 @@ export function webhooks(options: webhooks.Options = {}) {
1378
1558
  hide: hidden,
1379
1559
  operationId: 'getWebhookEventTypes',
1380
1560
  responses: OpenApi.responses({
1561
+ errors: {
1562
+ 400: {
1563
+ codes: [],
1564
+ description: 'The API key credential is malformed.',
1565
+ },
1566
+ 404: {
1567
+ codes: ['webhooks_not_enabled'],
1568
+ description: 'Webhooks are not enabled for this API deployment.',
1569
+ },
1570
+ },
1381
1571
  success: {
1382
1572
  description: 'Webhook event types available for subscription.',
1383
1573
  schema: schema.getWebhookEventTypes.Response,
@@ -1432,7 +1622,12 @@ export function webhooks(options: webhooks.Options = {}) {
1432
1622
  },
1433
1623
  403: {
1434
1624
  codes: ['api_key_forbidden', 'limit_exceeded'],
1435
- description: 'The API key lacks access or the subscription limit was reached.',
1625
+ description:
1626
+ 'The API key lacks access or its creator-shared subscription limit was reached.',
1627
+ },
1628
+ 404: {
1629
+ codes: ['webhooks_not_enabled'],
1630
+ description: 'Webhooks are not enabled for this API deployment.',
1436
1631
  },
1437
1632
  },
1438
1633
  success: {
@@ -1466,11 +1661,11 @@ export function webhooks(options: webhooks.Options = {}) {
1466
1661
  message: 'Webhook event type is not available in this deployment',
1467
1662
  status: 400,
1468
1663
  })
1469
- if (isFundingEventType(body.eventType)) {
1664
+ if (isRoutesEventType(body.eventType)) {
1470
1665
  if (principal?.type !== 'api_key') return unauthorized(c)
1471
1666
  if (
1472
1667
  !principal.apiKey.scopes.some(
1473
- (scope) => scope === Scope.wildcard || scope === 'funding:read',
1668
+ (scope) => scope === Scope.wildcard || scope === 'routes:read',
1474
1669
  )
1475
1670
  )
1476
1671
  return Response.error(c, {
@@ -1488,9 +1683,9 @@ export function webhooks(options: webhooks.Options = {}) {
1488
1683
  // Preserve destination errors before the creation-time RPC dependency.
1489
1684
  WebhookDestination.assertDestination(body.destination)
1490
1685
  const maxPerOwner = webhook.maxPerOwner ?? defaultMaxPerOwner
1491
- if ((await Webhooks.countSubscriptions(db, owner)) >= maxPerOwner)
1686
+ if ((await Webhooks.countSubscriptionsForLimit(db, { owner })) >= maxPerOwner)
1492
1687
  throw new Webhooks.LimitExceededError(maxPerOwner)
1493
- const startBlockNumber = isFundingEventType(body.eventType)
1688
+ const startBlockNumber = isRoutesEventType(body.eventType)
1494
1689
  ? undefined
1495
1690
  : await getRpcHead(c.get('getClient')(chainId))
1496
1691
  const subscription = await Webhooks.createSubscription(
@@ -1538,6 +1733,16 @@ export function webhooks(options: webhooks.Options = {}) {
1538
1733
  hide: hidden,
1539
1734
  operationId: 'listWebhooks',
1540
1735
  responses: OpenApi.responses({
1736
+ errors: {
1737
+ 400: {
1738
+ codes: ['query_invalid'],
1739
+ description: 'The query parameters are invalid.',
1740
+ },
1741
+ 404: {
1742
+ codes: ['webhooks_not_enabled'],
1743
+ description: 'Webhooks are not enabled for this API deployment.',
1744
+ },
1745
+ },
1541
1746
  success: {
1542
1747
  description: 'A page of webhook subscriptions.',
1543
1748
  schema: schema.listWebhooks.Response,
@@ -1615,9 +1820,13 @@ export function webhooks(options: webhooks.Options = {}) {
1615
1820
  operationId: 'getWebhook',
1616
1821
  responses: OpenApi.responses({
1617
1822
  errors: {
1823
+ 400: {
1824
+ codes: ['param_invalid'],
1825
+ description: 'The webhook ID is invalid.',
1826
+ },
1618
1827
  404: {
1619
1828
  description: 'No webhook subscription was found for that ID.',
1620
- codes: ['webhook_not_found'],
1829
+ codes: ['webhook_not_found', 'webhooks_not_enabled'],
1621
1830
  },
1622
1831
  },
1623
1832
  success: {
@@ -1672,9 +1881,13 @@ export function webhooks(options: webhooks.Options = {}) {
1672
1881
  operationId: 'listWebhookDeliveries',
1673
1882
  responses: OpenApi.responses({
1674
1883
  errors: {
1884
+ 400: {
1885
+ codes: ['param_invalid', 'query_invalid'],
1886
+ description: 'The webhook ID or query parameters are invalid.',
1887
+ },
1675
1888
  404: {
1676
1889
  description: 'No webhook subscription was found for that ID.',
1677
- codes: ['webhook_not_found'],
1890
+ codes: ['webhook_not_found', 'webhooks_not_enabled'],
1678
1891
  },
1679
1892
  },
1680
1893
  success: {
@@ -1761,9 +1974,13 @@ export function webhooks(options: webhooks.Options = {}) {
1761
1974
  operationId: 'pingWebhook',
1762
1975
  responses: OpenApi.responses({
1763
1976
  errors: {
1977
+ 400: {
1978
+ codes: ['param_invalid'],
1979
+ description: 'The webhook ID is invalid.',
1980
+ },
1764
1981
  404: {
1765
1982
  description: 'No webhook subscription was found for that ID.',
1766
- codes: ['webhook_not_found'],
1983
+ codes: ['webhook_not_found', 'webhooks_not_enabled'],
1767
1984
  },
1768
1985
  },
1769
1986
  success: {
@@ -1826,9 +2043,13 @@ export function webhooks(options: webhooks.Options = {}) {
1826
2043
  operationId: 'retryWebhookDelivery',
1827
2044
  responses: OpenApi.responses({
1828
2045
  errors: {
2046
+ 400: {
2047
+ codes: ['param_invalid'],
2048
+ description: 'The webhook or delivery ID is invalid.',
2049
+ },
1829
2050
  404: {
1830
2051
  description: 'No webhook subscription or delivery was found for those IDs.',
1831
- codes: ['webhook_not_found', 'delivery_not_found'],
2052
+ codes: ['webhook_not_found', 'delivery_not_found', 'webhooks_not_enabled'],
1832
2053
  },
1833
2054
  },
1834
2055
  success: {
@@ -1914,7 +2135,7 @@ export function webhooks(options: webhooks.Options = {}) {
1914
2135
  },
1915
2136
  404: {
1916
2137
  description: 'No webhook subscription was found for that ID.',
1917
- codes: ['webhook_not_found'],
2138
+ codes: ['webhook_not_found', 'webhooks_not_enabled'],
1918
2139
  },
1919
2140
  },
1920
2141
  success: {
@@ -1981,9 +2202,13 @@ export function webhooks(options: webhooks.Options = {}) {
1981
2202
  operationId: 'deleteWebhook',
1982
2203
  responses: OpenApi.responses({
1983
2204
  errors: {
2205
+ 400: {
2206
+ codes: ['param_invalid'],
2207
+ description: 'The webhook ID is invalid.',
2208
+ },
1984
2209
  404: {
1985
2210
  description: 'No webhook subscription was found for that ID.',
1986
- codes: ['webhook_not_found'],
2211
+ codes: ['webhook_not_found', 'webhooks_not_enabled'],
1987
2212
  },
1988
2213
  },
1989
2214
  success: {
@@ -2143,8 +2368,8 @@ export async function getRpcHead(client: Viem.getClient.ReturnType): Promise<num
2143
2368
 
2144
2369
  const filterSchemas = {
2145
2370
  'block:created': schema.BlockFilters,
2146
- 'funding:deposit.updated': schema.FundingDepositFilters,
2147
- 'funding:transfer.updated': schema.FundingTransferFilters,
2371
+ 'routes:deposit.updated': schema.RoutesDepositFilters,
2372
+ 'routes:transfer.updated': schema.RoutesTransferFilters,
2148
2373
  'log:emitted': schema.LogFilters,
2149
2374
  'token:transfer': schema.TransferFilters,
2150
2375
  'transaction:included': schema.TxFilters,
@@ -2199,10 +2424,14 @@ function serializeArgs(value: unknown): unknown {
2199
2424
  const toBig = (value: unknown) => BigInt(String(value))
2200
2425
 
2201
2426
  /** Case-insensitive equality for string fields; bigint equality for numeric. */
2202
- function operandEquals(value: string, target: unknown, kind: 'number' | 'string'): boolean {
2427
+ function operandEquals(
2428
+ value: bigint | number | string,
2429
+ target: unknown,
2430
+ kind: 'number' | 'string',
2431
+ ): boolean {
2203
2432
  return kind === 'number'
2204
2433
  ? toBig(value) === toBig(target)
2205
- : value.toLowerCase() === String(target).toLowerCase()
2434
+ : String(value).toLowerCase() === String(target).toLowerCase()
2206
2435
  }
2207
2436
 
2208
2437
  /**
@@ -2220,17 +2449,18 @@ function operandEquals(value: string, target: unknown, kind: 'number' | 'string'
2220
2449
  * - `{ startsWith }` → hex prefix
2221
2450
  */
2222
2451
  export function matchesOperator(
2223
- value: string | undefined,
2452
+ value: bigint | number | string | undefined,
2224
2453
  op: unknown,
2225
2454
  kind: 'number' | 'string' = 'string',
2226
2455
  ): boolean {
2227
2456
  if (value === undefined) return false
2228
2457
  if (typeof op !== 'object' || op === null) return operandEquals(value, op, kind)
2229
2458
  const o = op as Record<string, unknown>
2459
+ const value_string = String(value)
2230
2460
  if ('selector' in o)
2231
- return value.slice(0, 10).toLowerCase() === String(o['selector']).toLowerCase()
2461
+ return value_string.slice(0, 10).toLowerCase() === String(o['selector']).toLowerCase()
2232
2462
  if ('startsWith' in o)
2233
- return value.toLowerCase().startsWith(String(o['startsWith']).toLowerCase())
2463
+ return value_string.toLowerCase().startsWith(String(o['startsWith']).toLowerCase())
2234
2464
  if ('in' in o) return (o['in'] as readonly unknown[]).some((v) => operandEquals(value, v, kind))
2235
2465
  if ('not' in o) return !operandEquals(value, o['not'], kind)
2236
2466
  if ('eq' in o && kind === 'string') return operandEquals(value, o['eq'], kind)
@@ -2313,13 +2543,12 @@ function toLogEvent(
2313
2543
  const blockNumber = log.blockNumber === null ? undefined : Number(log.blockNumber)
2314
2544
  const logIndex = log.logIndex ?? undefined
2315
2545
  const transactionIndex = log.transactionIndex ?? undefined
2316
- const topics = log.topics.filter((t): t is string => typeof t === 'string')
2317
- const topic0 = Schema.Hash.safeParse(topics[0])
2546
+ const topics = z.array(Schema.Hash).safeParse(log.topics)
2318
2547
  const data = typeof log.data === 'string' ? log.data : '0x'
2319
2548
  if (
2320
2549
  !address.success ||
2321
2550
  !transactionHash.success ||
2322
- !topic0.success ||
2551
+ !topics.success ||
2323
2552
  blockNumber === undefined ||
2324
2553
  logIndex === undefined ||
2325
2554
  transactionIndex === undefined ||
@@ -2333,15 +2562,17 @@ function toLogEvent(
2333
2562
  data,
2334
2563
  logIndex,
2335
2564
  timestamp,
2336
- topics,
2565
+ topics: topics.data,
2337
2566
  transactionHash: transactionHash.data,
2338
2567
  transactionIndex,
2339
2568
  }
2340
2569
  if (!signature || !event || log.args === undefined) return base
2570
+ const topic0 = topics.data[0]
2571
+ if (!topic0) return undefined
2341
2572
  return {
2342
2573
  ...base,
2343
2574
  args: serializeArgs(log.args) as Record<string, unknown>,
2344
- event: { name: event.name, signature, topic0: topic0.data },
2575
+ event: { name: event.name, signature, topic0 },
2345
2576
  }
2346
2577
  }
2347
2578
 
@@ -2396,8 +2627,18 @@ function pushEventArgs(args: Record<string, unknown> | undefined, event: AbiEven
2396
2627
  return pushed
2397
2628
  }
2398
2629
 
2630
+ type LogPushdownFilters = {
2631
+ address?: unknown
2632
+ args?: Record<string, unknown> | undefined
2633
+ signature?: string | undefined
2634
+ topic0?: unknown
2635
+ topic1?: unknown
2636
+ topic2?: unknown
2637
+ topic3?: unknown
2638
+ }
2639
+
2399
2640
  /** Checks that the accepted filter carries a selective anchor rather than matching every log. */
2400
- function hasLogPushdown(f: z.output<typeof schema.LogFilters>): boolean {
2641
+ function hasLogPushdown(f: LogPushdownFilters): boolean {
2401
2642
  if (pushAddress(f.address) !== undefined) return true
2402
2643
 
2403
2644
  const secondaryTopic = [f.topic1, f.topic2, f.topic3].some(
@@ -2504,7 +2745,11 @@ function matchesLog(
2504
2745
  const numeric = /^u?int/.test(input.type)
2505
2746
  const value = args[name]
2506
2747
  const normalized = input.type === 'address' ? lowercaseLeaves(op) : op
2507
- if (!matchesOperator(asString(value), normalized, numeric ? 'number' : 'string')) return false
2748
+ const operand =
2749
+ typeof value === 'bigint' || typeof value === 'number' || typeof value === 'string'
2750
+ ? value
2751
+ : undefined
2752
+ if (!matchesOperator(operand, normalized, numeric ? 'number' : 'string')) return false
2508
2753
  }
2509
2754
  }
2510
2755
  return true
@@ -2667,7 +2912,7 @@ function toPublic(subscription: Webhooks.Subscription) {
2667
2912
  ...(subscription.context === undefined ? {} : { context: subscription.context }),
2668
2913
  createdAt: subscription.createdAt,
2669
2914
  destination: redactDestination(subscription.destination),
2670
- ...(isFundingEventType(subscription.eventType) && subscription.environment !== undefined
2915
+ ...(isRoutesEventType(subscription.eventType) && subscription.environment !== undefined
2671
2916
  ? { environment: subscription.environment }
2672
2917
  : {}),
2673
2918
  eventType: subscription.eventType,