tapimo 0.13.0 → 0.15.0

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