tapimo 0.14.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 (1141) 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 +12457 -10365
  9. package/dist/App.d.ts.map +1 -1
  10. package/dist/App.js +300 -22
  11. package/dist/App.js.map +1 -1
  12. package/dist/Assets.d.ts.map +1 -1
  13. package/dist/Assets.js +2 -1
  14. package/dist/Assets.js.map +1 -1
  15. package/dist/Handler.d.ts +0 -1
  16. package/dist/Handler.d.ts.map +1 -1
  17. package/dist/Handler.js +0 -1
  18. package/dist/Handler.js.map +1 -1
  19. package/dist/Scope.d.ts +13 -5
  20. package/dist/Scope.d.ts.map +1 -1
  21. package/dist/Scope.js +16 -5
  22. package/dist/Scope.js.map +1 -1
  23. package/dist/Webhooks.js +1 -1
  24. package/dist/Webhooks.js.map +1 -1
  25. package/dist/admin/App.d.ts +3057 -549
  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 +1398 -0
  34. package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
  35. package/dist/admin/apps/earn-vaults.js +463 -7
  36. package/dist/admin/apps/earn-vaults.js.map +1 -1
  37. package/dist/admin/apps/organizations.d.ts +267 -15
  38. package/dist/admin/apps/organizations.d.ts.map +1 -1
  39. package/dist/admin/apps/organizations.js +241 -25
  40. package/dist/admin/apps/organizations.js.map +1 -1
  41. package/dist/admin/apps/routes-support.d.ts +95 -0
  42. package/dist/admin/apps/routes-support.d.ts.map +1 -0
  43. package/dist/admin/apps/routes-support.js +151 -0
  44. package/dist/admin/apps/routes-support.js.map +1 -0
  45. package/dist/admin/apps/routes.d.ts +2764 -0
  46. package/dist/admin/apps/routes.d.ts.map +1 -0
  47. package/dist/admin/apps/routes.js +728 -0
  48. package/dist/admin/apps/routes.js.map +1 -0
  49. package/dist/admin/apps/subsidies.d.ts +501 -0
  50. package/dist/admin/apps/subsidies.d.ts.map +1 -0
  51. package/dist/admin/apps/subsidies.js +384 -0
  52. package/dist/admin/apps/subsidies.js.map +1 -0
  53. package/dist/admin/apps/verified-tokens.d.ts +88 -88
  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 +37 -5
  76. package/dist/apps/Zones.js.map +1 -1
  77. package/dist/apps/data/App.d.ts +3971 -2595
  78. package/dist/apps/data/App.d.ts.map +1 -1
  79. package/dist/apps/data/App.js +76 -21
  80. package/dist/apps/data/App.js.map +1 -1
  81. package/dist/apps/data/routes/activities.d.ts +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 +72 -0
  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 +1450 -337
  92. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  93. package/dist/apps/data/routes/earn.js +1226 -144
  94. package/dist/apps/data/routes/earn.js.map +1 -1
  95. package/dist/apps/data/routes/fee-amm.d.ts +5 -0
  96. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
  97. package/dist/apps/data/routes/fee-amm.js +31 -19
  98. package/dist/apps/data/routes/fee-amm.js.map +1 -1
  99. package/dist/apps/data/routes/indexer.d.ts +125 -0
  100. package/dist/apps/data/routes/indexer.d.ts.map +1 -1
  101. package/dist/apps/data/routes/indexer.js +83 -27
  102. package/dist/apps/data/routes/indexer.js.map +1 -1
  103. package/dist/apps/data/routes/rpc.d.ts +507 -33
  104. package/dist/apps/data/routes/rpc.d.ts.map +1 -1
  105. package/dist/apps/data/routes/rpc.js +266 -156
  106. package/dist/apps/data/routes/rpc.js.map +1 -1
  107. package/dist/apps/data/routes/tokenlist.d.ts +47 -15
  108. package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
  109. package/dist/apps/data/routes/tokenlist.js +68 -11
  110. package/dist/apps/data/routes/tokenlist.js.map +1 -1
  111. package/dist/apps/data/routes/tokens.d.ts +2 -0
  112. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  113. package/dist/apps/data/routes/tokens.js +26 -14
  114. package/dist/apps/data/routes/tokens.js.map +1 -1
  115. package/dist/apps/data/routes/transfers.d.ts +28 -12
  116. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  117. package/dist/apps/data/routes/transfers.js +9 -7
  118. package/dist/apps/data/routes/transfers.js.map +1 -1
  119. package/dist/apps/data/routes/valuation.d.ts +30 -30
  120. package/dist/apps/data/routes/verified-tokens.d.ts +9 -9
  121. package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -1
  122. package/dist/apps/data/routes/verified-tokens.js +64 -20
  123. package/dist/apps/data/routes/verified-tokens.js.map +1 -1
  124. package/dist/apps/data/routes/webhooks.d.ts +613 -176
  125. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  126. package/dist/apps/data/routes/webhooks.js +291 -195
  127. package/dist/apps/data/routes/webhooks.js.map +1 -1
  128. package/dist/apps/data/routes/zones.d.ts.map +1 -1
  129. package/dist/apps/data/routes/zones.js +20 -12
  130. package/dist/apps/data/routes/zones.js.map +1 -1
  131. package/dist/apps/docs/reference.js +2 -2
  132. package/dist/apps/docs/reference.js.map +1 -1
  133. package/dist/apps/index.d.ts +1 -1
  134. package/dist/apps/index.d.ts.map +1 -1
  135. package/dist/apps/index.js +1 -1
  136. package/dist/apps/index.js.map +1 -1
  137. package/dist/apps/management/App.d.ts +3763 -3385
  138. package/dist/apps/management/App.d.ts.map +1 -1
  139. package/dist/apps/management/App.js +5 -14
  140. package/dist/apps/management/App.js.map +1 -1
  141. package/dist/apps/management/Billing.d.ts +48 -7
  142. package/dist/apps/management/Billing.d.ts.map +1 -1
  143. package/dist/apps/management/Billing.js +204 -25
  144. package/dist/apps/management/Billing.js.map +1 -1
  145. package/dist/apps/management/routes/api-keys.d.ts +106 -4
  146. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  147. package/dist/apps/management/routes/api-keys.js +43 -15
  148. package/dist/apps/management/routes/api-keys.js.map +1 -1
  149. package/dist/apps/management/routes/billing.d.ts +290 -4
  150. package/dist/apps/management/routes/billing.d.ts.map +1 -1
  151. package/dist/apps/management/routes/billing.js +274 -49
  152. package/dist/apps/management/routes/billing.js.map +1 -1
  153. package/dist/apps/management/routes/faucet.d.ts +6 -6
  154. package/dist/apps/management/routes/faucet.js +1 -1
  155. package/dist/apps/management/routes/faucet.js.map +1 -1
  156. package/dist/apps/management/routes/invitations.d.ts +77 -2
  157. package/dist/apps/management/routes/invitations.d.ts.map +1 -1
  158. package/dist/apps/management/routes/invitations.js +117 -13
  159. package/dist/apps/management/routes/invitations.js.map +1 -1
  160. package/dist/apps/management/routes/invite-links.d.ts +4 -4
  161. package/dist/apps/management/routes/me.d.ts.map +1 -1
  162. package/dist/apps/management/routes/me.js +6 -2
  163. package/dist/apps/management/routes/me.js.map +1 -1
  164. package/dist/apps/management/routes/members.d.ts +30 -30
  165. package/dist/apps/management/routes/orgs.d.ts +18 -2
  166. package/dist/apps/management/routes/orgs.d.ts.map +1 -1
  167. package/dist/apps/management/routes/orgs.js +52 -12
  168. package/dist/apps/management/routes/orgs.js.map +1 -1
  169. package/dist/apps/management/routes/projects.d.ts +4 -4
  170. package/dist/apps/management/routes/projects.d.ts.map +1 -1
  171. package/dist/apps/management/routes/projects.js +6 -1
  172. package/dist/apps/management/routes/projects.js.map +1 -1
  173. package/dist/apps/management/routes/scopes.d.ts.map +1 -1
  174. package/dist/apps/management/routes/scopes.js +4 -1
  175. package/dist/apps/management/routes/scopes.js.map +1 -1
  176. package/dist/apps/management/routes/usage.d.ts +24 -24
  177. package/dist/apps/management/routes/usage.js +21 -4
  178. package/dist/apps/management/routes/usage.js.map +1 -1
  179. package/dist/apps/management/routes/verified-token-requests.d.ts +2 -2
  180. package/dist/apps/management/routes/webhooks.d.ts +280 -214
  181. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  182. package/dist/apps/management/routes/webhooks.js +58 -12
  183. package/dist/apps/management/routes/webhooks.js.map +1 -1
  184. package/dist/apps/mcp.d.ts +1 -1
  185. package/dist/apps/mcp.js +7 -7
  186. package/dist/apps/mcp.js.map +1 -1
  187. package/dist/apps/mpp/App.d.ts.map +1 -1
  188. package/dist/apps/mpp/App.js +35 -7
  189. package/dist/apps/mpp/App.js.map +1 -1
  190. package/dist/apps/mpp/internal/Adapter.d.ts +2 -0
  191. package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
  192. package/dist/apps/mpp/internal/Adapter.js +30 -1
  193. package/dist/apps/mpp/internal/Adapter.js.map +1 -1
  194. package/dist/apps/mpp/internal/Policy.d.ts +22 -4
  195. package/dist/apps/mpp/internal/Policy.d.ts.map +1 -1
  196. package/dist/apps/mpp/internal/Policy.js +24 -6
  197. package/dist/apps/mpp/internal/Policy.js.map +1 -1
  198. package/dist/apps/mpp/internal/Sponsorship.d.ts +3 -0
  199. package/dist/apps/mpp/internal/Sponsorship.d.ts.map +1 -1
  200. package/dist/apps/mpp/internal/Sponsorship.js +6 -3
  201. package/dist/apps/mpp/internal/Sponsorship.js.map +1 -1
  202. package/dist/apps/relay/App.d.ts +2 -0
  203. package/dist/apps/relay/App.d.ts.map +1 -1
  204. package/dist/apps/relay/App.js +134 -75
  205. package/dist/apps/relay/App.js.map +1 -1
  206. package/dist/apps/relay/Sponsorships.d.ts +5 -3
  207. package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
  208. package/dist/apps/relay/Sponsorships.js +209 -28
  209. package/dist/apps/relay/Sponsorships.js.map +1 -1
  210. package/dist/apps/{funding → routes}/Access.d.ts +4 -4
  211. package/dist/apps/routes/Access.d.ts.map +1 -0
  212. package/dist/apps/{funding → routes}/Access.js +4 -4
  213. package/dist/apps/routes/Access.js.map +1 -0
  214. package/dist/apps/{funding → routes}/App.d.ts +418 -124
  215. package/dist/apps/{funding → routes}/App.d.ts.map +1 -1
  216. package/dist/apps/{funding → routes}/App.js +16 -16
  217. package/dist/apps/routes/App.js.map +1 -0
  218. package/dist/apps/routes/Inventory.d.ts.map +1 -0
  219. package/dist/apps/{funding → routes}/Inventory.js +2 -2
  220. package/dist/apps/routes/Inventory.js.map +1 -0
  221. package/dist/apps/routes/index.d.ts +2 -0
  222. package/dist/apps/routes/index.d.ts.map +1 -0
  223. package/dist/apps/routes/index.js +2 -0
  224. package/dist/apps/routes/index.js.map +1 -0
  225. package/dist/apps/{funding → routes}/routes/chains.d.ts +7 -7
  226. package/dist/apps/routes/routes/chains.d.ts.map +1 -0
  227. package/dist/apps/{funding → routes}/routes/chains.js +25 -25
  228. package/dist/apps/routes/routes/chains.js.map +1 -0
  229. package/dist/apps/{funding → routes}/routes/deposit-addresses.d.ts +107 -43
  230. package/dist/apps/routes/routes/deposit-addresses.d.ts.map +1 -0
  231. package/dist/apps/{funding → routes}/routes/deposit-addresses.js +497 -222
  232. package/dist/apps/routes/routes/deposit-addresses.js.map +1 -0
  233. package/dist/apps/{funding → routes}/routes/providers.d.ts +8 -8
  234. package/dist/apps/routes/routes/providers.d.ts.map +1 -0
  235. package/dist/apps/routes/routes/providers.js +57 -0
  236. package/dist/apps/routes/routes/providers.js.map +1 -0
  237. package/dist/apps/{funding → routes}/routes/quotes.d.ts +19 -16
  238. package/dist/apps/routes/routes/quotes.d.ts.map +1 -0
  239. package/dist/apps/{funding → routes}/routes/quotes.js +55 -38
  240. package/dist/apps/routes/routes/quotes.js.map +1 -0
  241. package/dist/apps/{funding → routes}/routes/transfers.d.ts +379 -74
  242. package/dist/apps/routes/routes/transfers.d.ts.map +1 -0
  243. package/dist/apps/routes/routes/transfers.js +1140 -0
  244. package/dist/apps/routes/routes/transfers.js.map +1 -0
  245. package/dist/cli/Cli.d.ts +30 -0
  246. package/dist/cli/Cli.d.ts.map +1 -1
  247. package/dist/cli/commands/admin.d.ts +36 -0
  248. package/dist/cli/commands/admin.d.ts.map +1 -1
  249. package/dist/cli/commands/admin.js +273 -0
  250. package/dist/cli/commands/admin.js.map +1 -1
  251. package/dist/cloudflare.d.ts +16 -14
  252. package/dist/cloudflare.d.ts.map +1 -1
  253. package/dist/cloudflare.js +26 -21
  254. package/dist/cloudflare.js.map +1 -1
  255. package/dist/db/Db.d.ts +63 -21
  256. package/dist/db/Db.d.ts.map +1 -1
  257. package/dist/db/Db.js +1030 -15
  258. package/dist/db/Db.js.map +1 -1
  259. package/dist/db/Schema.d.ts +780 -133
  260. package/dist/db/Schema.d.ts.map +1 -1
  261. package/dist/db/Schema.js +575 -162
  262. package/dist/db/Schema.js.map +1 -1
  263. package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts +4 -0
  264. package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts.map +1 -0
  265. package/dist/db/tables/apiKeyAdmissionBootstraps.js +2 -0
  266. package/dist/db/tables/apiKeyAdmissionBootstraps.js.map +1 -0
  267. package/dist/db/tables/apiKeyAdmissions.d.ts +73 -0
  268. package/dist/db/tables/apiKeyAdmissions.d.ts.map +1 -0
  269. package/dist/db/tables/apiKeyAdmissions.js +142 -0
  270. package/dist/db/tables/apiKeyAdmissions.js.map +1 -0
  271. package/dist/db/tables/apiKeyOwnerAdmissions.d.ts +4 -0
  272. package/dist/db/tables/apiKeyOwnerAdmissions.d.ts.map +1 -0
  273. package/dist/db/tables/apiKeyOwnerAdmissions.js +2 -0
  274. package/dist/db/tables/apiKeyOwnerAdmissions.js.map +1 -0
  275. package/dist/db/tables/apiKeyOwnerTombstones.d.ts +20 -0
  276. package/dist/db/tables/apiKeyOwnerTombstones.d.ts.map +1 -0
  277. package/dist/db/tables/apiKeyOwnerTombstones.js +57 -0
  278. package/dist/db/tables/apiKeyOwnerTombstones.js.map +1 -0
  279. package/dist/db/tables/apiKeyRevocations.d.ts +21 -0
  280. package/dist/db/tables/apiKeyRevocations.d.ts.map +1 -0
  281. package/dist/db/tables/apiKeyRevocations.js +98 -0
  282. package/dist/db/tables/apiKeyRevocations.js.map +1 -0
  283. package/dist/db/tables/authAccounts.d.ts +47 -0
  284. package/dist/db/tables/authAccounts.d.ts.map +1 -0
  285. package/dist/db/tables/authAccounts.js +72 -0
  286. package/dist/db/tables/authAccounts.js.map +1 -0
  287. package/dist/db/tables/authSessions.d.ts +12 -0
  288. package/dist/db/tables/authSessions.d.ts.map +1 -0
  289. package/dist/db/tables/authSessions.js +2 -0
  290. package/dist/db/tables/authSessions.js.map +1 -0
  291. package/dist/db/tables/authVerifications.d.ts +12 -0
  292. package/dist/db/tables/authVerifications.d.ts.map +1 -0
  293. package/dist/db/tables/authVerifications.js +2 -0
  294. package/dist/db/tables/authVerifications.js.map +1 -0
  295. package/dist/db/tables/invitations.d.ts +17 -1
  296. package/dist/db/tables/invitations.d.ts.map +1 -1
  297. package/dist/db/tables/invitations.js +123 -43
  298. package/dist/db/tables/invitations.js.map +1 -1
  299. package/dist/db/tables/memberships.d.ts +8 -0
  300. package/dist/db/tables/memberships.d.ts.map +1 -1
  301. package/dist/db/tables/memberships.js +51 -2
  302. package/dist/db/tables/memberships.js.map +1 -1
  303. package/dist/db/tables/organizations.d.ts +32 -10
  304. package/dist/db/tables/organizations.d.ts.map +1 -1
  305. package/dist/db/tables/organizations.js +110 -49
  306. package/dist/db/tables/organizations.js.map +1 -1
  307. package/dist/db/tables/projects.d.ts +2 -0
  308. package/dist/db/tables/projects.d.ts.map +1 -1
  309. package/dist/db/tables/projects.js +12 -3
  310. package/dist/db/tables/projects.js.map +1 -1
  311. package/dist/db/tables/requestUsage.d.ts.map +1 -1
  312. package/dist/db/tables/requestUsage.js.map +1 -1
  313. package/dist/db/tables/rewardAccounts.d.ts +86 -0
  314. package/dist/db/tables/rewardAccounts.d.ts.map +1 -0
  315. package/dist/db/tables/rewardAccounts.js +88 -0
  316. package/dist/db/tables/rewardAccounts.js.map +1 -0
  317. package/dist/db/tables/rewardCampaignDistributors.d.ts +36 -0
  318. package/dist/db/tables/rewardCampaignDistributors.d.ts.map +1 -0
  319. package/dist/db/tables/rewardCampaignDistributors.js +30 -0
  320. package/dist/db/tables/rewardCampaignDistributors.js.map +1 -0
  321. package/dist/db/tables/rewardCampaigns.d.ts +171 -0
  322. package/dist/db/tables/rewardCampaigns.d.ts.map +1 -0
  323. package/dist/db/tables/rewardCampaigns.js +392 -0
  324. package/dist/db/tables/rewardCampaigns.js.map +1 -0
  325. package/dist/db/tables/rewardCredits.d.ts +53 -0
  326. package/dist/db/tables/rewardCredits.d.ts.map +1 -0
  327. package/dist/db/tables/rewardCredits.js +63 -0
  328. package/dist/db/tables/rewardCredits.js.map +1 -0
  329. package/dist/db/tables/rewardEligibilityAssociations.d.ts +61 -0
  330. package/dist/db/tables/rewardEligibilityAssociations.d.ts.map +1 -0
  331. package/dist/db/tables/rewardEligibilityAssociations.js +103 -0
  332. package/dist/db/tables/rewardEligibilityAssociations.js.map +1 -0
  333. package/dist/db/tables/rewardRuns.d.ts +188 -0
  334. package/dist/db/tables/rewardRuns.d.ts.map +1 -0
  335. package/dist/db/tables/rewardRuns.js +278 -0
  336. package/dist/db/tables/rewardRuns.js.map +1 -0
  337. package/dist/db/tables/rewardTransactionAttempts.d.ts +100 -0
  338. package/dist/db/tables/rewardTransactionAttempts.d.ts.map +1 -0
  339. package/dist/db/tables/rewardTransactionAttempts.js +163 -0
  340. package/dist/db/tables/rewardTransactionAttempts.js.map +1 -0
  341. package/dist/db/tables/routesCatalog.d.ts +58 -0
  342. package/dist/db/tables/routesCatalog.d.ts.map +1 -0
  343. package/dist/db/tables/{fundingCatalog.js → routesCatalog.js} +19 -19
  344. package/dist/db/tables/routesCatalog.js.map +1 -0
  345. package/dist/db/tables/routesDepositAddresses.d.ts +476 -0
  346. package/dist/db/tables/routesDepositAddresses.d.ts.map +1 -0
  347. package/dist/db/tables/routesDepositAddresses.js +587 -0
  348. package/dist/db/tables/routesDepositAddresses.js.map +1 -0
  349. package/dist/db/tables/{fundingDepositRequestObservations.d.ts → routesDepositRequestObservations.d.ts} +6 -6
  350. package/dist/db/tables/routesDepositRequestObservations.d.ts.map +1 -0
  351. package/dist/db/tables/{fundingDepositRequestObservations.js → routesDepositRequestObservations.js} +6 -6
  352. package/dist/db/tables/routesDepositRequestObservations.js.map +1 -0
  353. package/dist/db/tables/{fundingDeposits.d.ts → routesDeposits.d.ts} +210 -22
  354. package/dist/db/tables/routesDeposits.d.ts.map +1 -0
  355. package/dist/db/tables/routesDeposits.js +576 -0
  356. package/dist/db/tables/routesDeposits.js.map +1 -0
  357. package/dist/db/tables/routesIdempotency.d.ts +166 -0
  358. package/dist/db/tables/routesIdempotency.d.ts.map +1 -0
  359. package/dist/db/tables/routesIdempotency.js +330 -0
  360. package/dist/db/tables/routesIdempotency.js.map +1 -0
  361. package/dist/db/tables/routesSubsidies.d.ts +27 -0
  362. package/dist/db/tables/routesSubsidies.d.ts.map +1 -0
  363. package/dist/db/tables/routesSubsidies.js +45 -0
  364. package/dist/db/tables/routesSubsidies.js.map +1 -0
  365. package/dist/db/tables/{fundingTransferEvents.d.ts → routesTransferEvents.d.ts} +3 -3
  366. package/dist/db/tables/routesTransferEvents.d.ts.map +1 -0
  367. package/dist/db/tables/{fundingTransferEvents.js → routesTransferEvents.js} +3 -3
  368. package/dist/db/tables/routesTransferEvents.js.map +1 -0
  369. package/dist/db/tables/routesTransferSubsidies.d.ts +19 -0
  370. package/dist/db/tables/routesTransferSubsidies.d.ts.map +1 -0
  371. package/dist/db/tables/routesTransferSubsidies.js +17 -0
  372. package/dist/db/tables/routesTransferSubsidies.js.map +1 -0
  373. package/dist/db/tables/routesTransferSubsidyNonces.d.ts +51 -0
  374. package/dist/db/tables/routesTransferSubsidyNonces.d.ts.map +1 -0
  375. package/dist/db/tables/routesTransferSubsidyNonces.js +82 -0
  376. package/dist/db/tables/routesTransferSubsidyNonces.js.map +1 -0
  377. package/dist/db/tables/routesTransferTransactions.d.ts +77 -0
  378. package/dist/db/tables/routesTransferTransactions.d.ts.map +1 -0
  379. package/dist/db/tables/{fundingTransferTransactions.js → routesTransferTransactions.js} +31 -13
  380. package/dist/db/tables/routesTransferTransactions.js.map +1 -0
  381. package/dist/db/tables/routesTransfers.d.ts +319 -0
  382. package/dist/db/tables/routesTransfers.d.ts.map +1 -0
  383. package/dist/db/tables/routesTransfers.js +372 -0
  384. package/dist/db/tables/routesTransfers.js.map +1 -0
  385. package/dist/db/tables/sponsoredTransactions.d.ts +75 -20
  386. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
  387. package/dist/db/tables/sponsoredTransactions.js +124 -54
  388. package/dist/db/tables/sponsoredTransactions.js.map +1 -1
  389. package/dist/db/tables/sponsorshipAttributions.d.ts +69 -0
  390. package/dist/db/tables/sponsorshipAttributions.d.ts.map +1 -0
  391. package/dist/db/tables/sponsorshipAttributions.js +77 -0
  392. package/dist/db/tables/sponsorshipAttributions.js.map +1 -0
  393. package/dist/db/tables/sponsorshipReconciliationCursors.d.ts +22 -0
  394. package/dist/db/tables/sponsorshipReconciliationCursors.d.ts.map +1 -0
  395. package/dist/db/tables/sponsorshipReconciliationCursors.js +45 -0
  396. package/dist/db/tables/sponsorshipReconciliationCursors.js.map +1 -0
  397. package/dist/db/tables/stripeCustomers.d.ts +11 -0
  398. package/dist/db/tables/stripeCustomers.d.ts.map +1 -1
  399. package/dist/db/tables/stripeCustomers.js +13 -0
  400. package/dist/db/tables/stripeCustomers.js.map +1 -1
  401. package/dist/db/tables/users.d.ts +17 -1
  402. package/dist/db/tables/users.d.ts.map +1 -1
  403. package/dist/db/tables/users.js +47 -2
  404. package/dist/db/tables/users.js.map +1 -1
  405. package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
  406. package/dist/db/tables/webhookQueueEvents.js +5 -1
  407. package/dist/db/tables/webhookQueueEvents.js.map +1 -1
  408. package/dist/db/tables/webhookSubscriptions.d.ts +19 -11
  409. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  410. package/dist/db/tables/webhookSubscriptions.js +45 -13
  411. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  412. package/dist/handlers/internal/executionError.d.ts +2 -2
  413. package/dist/handlers/internal/executionError.d.ts.map +1 -1
  414. package/dist/handlers/internal/executionError.js +1 -2
  415. package/dist/handlers/internal/executionError.js.map +1 -1
  416. package/dist/handlers/internal/multisig.d.ts +4 -232
  417. package/dist/handlers/internal/multisig.d.ts.map +1 -1
  418. package/dist/handlers/internal/multisig.js +11 -537
  419. package/dist/handlers/internal/multisig.js.map +1 -1
  420. package/dist/handlers/internal/sponsorship.d.ts +19 -8
  421. package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
  422. package/dist/handlers/internal/sponsorship.js +13 -9
  423. package/dist/handlers/internal/sponsorship.js.map +1 -1
  424. package/dist/handlers/relay.d.ts +9 -12
  425. package/dist/handlers/relay.d.ts.map +1 -1
  426. package/dist/handlers/relay.js +81 -85
  427. package/dist/handlers/relay.js.map +1 -1
  428. package/dist/index.d.ts +0 -17
  429. package/dist/index.d.ts.map +1 -1
  430. package/dist/index.js +0 -17
  431. package/dist/index.js.map +1 -1
  432. package/dist/internal/AssetResponse.d.ts +12 -0
  433. package/dist/internal/AssetResponse.d.ts.map +1 -0
  434. package/dist/internal/AssetResponse.js +21 -0
  435. package/dist/internal/AssetResponse.js.map +1 -0
  436. package/dist/internal/Auth.d.ts +48 -12
  437. package/dist/internal/Auth.d.ts.map +1 -1
  438. package/dist/internal/Auth.js +603 -175
  439. package/dist/internal/Auth.js.map +1 -1
  440. package/dist/internal/BetterAuth.d.ts +1488 -0
  441. package/dist/internal/BetterAuth.d.ts.map +1 -0
  442. package/dist/internal/BetterAuth.js +253 -0
  443. package/dist/internal/BetterAuth.js.map +1 -0
  444. package/dist/internal/Cache.d.ts +2 -0
  445. package/dist/internal/Cache.d.ts.map +1 -1
  446. package/dist/internal/Cache.js +2 -0
  447. package/dist/internal/Cache.js.map +1 -1
  448. package/dist/internal/EarnRates.d.ts +26 -3
  449. package/dist/internal/EarnRates.d.ts.map +1 -1
  450. package/dist/internal/EarnRates.js +84 -19
  451. package/dist/internal/EarnRates.js.map +1 -1
  452. package/dist/internal/EarnSharePrices.d.ts +120 -0
  453. package/dist/internal/EarnSharePrices.d.ts.map +1 -0
  454. package/dist/internal/EarnSharePrices.js +179 -0
  455. package/dist/internal/EarnSharePrices.js.map +1 -0
  456. package/dist/internal/EarnVaults.d.ts +4 -0
  457. package/dist/internal/EarnVaults.d.ts.map +1 -1
  458. package/dist/internal/EarnVaults.js +27 -10
  459. package/dist/internal/EarnVaults.js.map +1 -1
  460. package/dist/internal/Email.d.ts +37 -0
  461. package/dist/internal/Email.d.ts.map +1 -0
  462. package/dist/internal/Email.js +16 -0
  463. package/dist/internal/Email.js.map +1 -0
  464. package/dist/internal/Log.d.ts +32 -28
  465. package/dist/internal/Log.d.ts.map +1 -1
  466. package/dist/internal/Log.js +18 -11
  467. package/dist/internal/Log.js.map +1 -1
  468. package/dist/internal/MetricSink.d.ts +3 -0
  469. package/dist/internal/MetricSink.d.ts.map +1 -1
  470. package/dist/internal/MetricSink.js +67 -8
  471. package/dist/internal/MetricSink.js.map +1 -1
  472. package/dist/internal/Mpp.d.ts.map +1 -1
  473. package/dist/internal/Mpp.js +20 -25
  474. package/dist/internal/Mpp.js.map +1 -1
  475. package/dist/internal/OpenApi.d.ts +26 -3
  476. package/dist/internal/OpenApi.d.ts.map +1 -1
  477. package/dist/internal/OpenApi.js +25 -10
  478. package/dist/internal/OpenApi.js.map +1 -1
  479. package/dist/internal/Provider.d.ts +1 -1
  480. package/dist/internal/Provider.d.ts.map +1 -1
  481. package/dist/internal/RateLimit.d.ts.map +1 -1
  482. package/dist/internal/RateLimit.js +13 -1
  483. package/dist/internal/RateLimit.js.map +1 -1
  484. package/dist/internal/Store.d.ts +16 -0
  485. package/dist/internal/Store.d.ts.map +1 -1
  486. package/dist/internal/Store.js +59 -8
  487. package/dist/internal/Store.js.map +1 -1
  488. package/dist/internal/Tidx.d.ts +9 -2
  489. package/dist/internal/Tidx.d.ts.map +1 -1
  490. package/dist/internal/Tidx.js +78 -11
  491. package/dist/internal/Tidx.js.map +1 -1
  492. package/dist/internal/Timing.d.ts +26 -0
  493. package/dist/internal/Timing.d.ts.map +1 -1
  494. package/dist/internal/Timing.js +63 -5
  495. package/dist/internal/Timing.js.map +1 -1
  496. package/dist/internal/VercelOidc.d.ts +94 -0
  497. package/dist/internal/VercelOidc.d.ts.map +1 -0
  498. package/dist/internal/VercelOidc.js +128 -0
  499. package/dist/internal/VercelOidc.js.map +1 -0
  500. package/dist/internal/VerifiedTokens.d.ts +2 -8
  501. package/dist/internal/VerifiedTokens.d.ts.map +1 -1
  502. package/dist/internal/VerifiedTokens.js +24 -24
  503. package/dist/internal/VerifiedTokens.js.map +1 -1
  504. package/dist/internal/Viem.d.ts +30 -2067
  505. package/dist/internal/Viem.d.ts.map +1 -1
  506. package/dist/internal/Viem.js +167 -17
  507. package/dist/internal/Viem.js.map +1 -1
  508. package/dist/internal/Webhooks.d.ts +12 -4
  509. package/dist/internal/Webhooks.d.ts.map +1 -1
  510. package/dist/internal/Webhooks.js +9 -3
  511. package/dist/internal/Webhooks.js.map +1 -1
  512. package/dist/internal/ZoneRpc.d.ts +7 -0
  513. package/dist/internal/ZoneRpc.d.ts.map +1 -0
  514. package/dist/internal/ZoneRpc.js +49 -0
  515. package/dist/internal/ZoneRpc.js.map +1 -0
  516. package/dist/internal/index.d.ts +3 -1
  517. package/dist/internal/index.d.ts.map +1 -1
  518. package/dist/internal/index.js +3 -1
  519. package/dist/internal/index.js.map +1 -1
  520. package/dist/internal/rewards/Audit.d.ts +88 -0
  521. package/dist/internal/rewards/Audit.d.ts.map +1 -0
  522. package/dist/internal/rewards/Audit.js +134 -0
  523. package/dist/internal/rewards/Audit.js.map +1 -0
  524. package/dist/internal/rewards/Campaigns.d.ts +572 -0
  525. package/dist/internal/rewards/Campaigns.d.ts.map +1 -0
  526. package/dist/internal/rewards/Campaigns.js +531 -0
  527. package/dist/internal/rewards/Campaigns.js.map +1 -0
  528. package/dist/internal/rewards/Credits.d.ts +76 -0
  529. package/dist/internal/rewards/Credits.d.ts.map +1 -0
  530. package/dist/internal/rewards/Credits.js +95 -0
  531. package/dist/internal/rewards/Credits.js.map +1 -0
  532. package/dist/internal/rewards/Events.d.ts +100 -0
  533. package/dist/internal/rewards/Events.d.ts.map +1 -0
  534. package/dist/internal/rewards/Events.js +340 -0
  535. package/dist/internal/rewards/Events.js.map +1 -0
  536. package/dist/internal/rewards/Projection.d.ts +237 -0
  537. package/dist/internal/rewards/Projection.d.ts.map +1 -0
  538. package/dist/internal/rewards/Projection.js +616 -0
  539. package/dist/internal/rewards/Projection.js.map +1 -0
  540. package/dist/internal/rewards/Rates.d.ts +44 -0
  541. package/dist/internal/rewards/Rates.d.ts.map +1 -0
  542. package/dist/internal/rewards/Rates.js +60 -0
  543. package/dist/internal/rewards/Rates.js.map +1 -0
  544. package/dist/internal/rewards/Read.d.ts +158 -0
  545. package/dist/internal/rewards/Read.d.ts.map +1 -0
  546. package/dist/internal/rewards/Read.js +292 -0
  547. package/dist/internal/rewards/Read.js.map +1 -0
  548. package/dist/internal/rewards/Runner.d.ts +164 -0
  549. package/dist/internal/rewards/Runner.d.ts.map +1 -0
  550. package/dist/internal/rewards/Runner.js +1778 -0
  551. package/dist/internal/rewards/Runner.js.map +1 -0
  552. package/dist/internal/rewards/Signer.d.ts +224 -0
  553. package/dist/internal/rewards/Signer.d.ts.map +1 -0
  554. package/dist/internal/rewards/Signer.js +135 -0
  555. package/dist/internal/rewards/Signer.js.map +1 -0
  556. package/dist/internal/rewards/index.d.ts +15 -0
  557. package/dist/internal/rewards/index.d.ts.map +1 -0
  558. package/dist/internal/rewards/index.js +15 -0
  559. package/dist/internal/rewards/index.js.map +1 -0
  560. package/dist/internal/{funding → routes}/Action.d.ts +12 -1
  561. package/dist/internal/routes/Action.d.ts.map +1 -0
  562. package/dist/internal/{funding → routes}/Action.js +17 -9
  563. package/dist/internal/routes/Action.js.map +1 -0
  564. package/dist/internal/{funding → routes}/Catalog.d.ts +20 -20
  565. package/dist/internal/routes/Catalog.d.ts.map +1 -0
  566. package/dist/internal/{funding → routes}/Catalog.js +29 -29
  567. package/dist/internal/routes/Catalog.js.map +1 -0
  568. package/dist/internal/{funding → routes}/Chain.d.ts +10 -10
  569. package/dist/internal/routes/Chain.d.ts.map +1 -0
  570. package/dist/internal/{funding → routes}/Chain.js +3 -3
  571. package/dist/internal/routes/Chain.js.map +1 -0
  572. package/dist/internal/{funding → routes}/Deposit.d.ts +45 -23
  573. package/dist/internal/routes/Deposit.d.ts.map +1 -0
  574. package/dist/internal/{funding → routes}/Deposit.js +60 -27
  575. package/dist/internal/routes/Deposit.js.map +1 -0
  576. package/dist/internal/{funding → routes}/DepositAddress.d.ts +56 -27
  577. package/dist/internal/routes/DepositAddress.d.ts.map +1 -0
  578. package/dist/internal/{funding → routes}/DepositAddress.js +95 -33
  579. package/dist/internal/routes/DepositAddress.js.map +1 -0
  580. package/dist/internal/{funding → routes}/DepositWebhook.d.ts +4 -4
  581. package/dist/internal/routes/DepositWebhook.d.ts.map +1 -0
  582. package/dist/internal/{funding → routes}/DepositWebhook.js +4 -4
  583. package/dist/internal/routes/DepositWebhook.js.map +1 -0
  584. package/dist/internal/routes/Economics.d.ts +25 -0
  585. package/dist/internal/routes/Economics.d.ts.map +1 -0
  586. package/dist/internal/routes/Economics.js +28 -0
  587. package/dist/internal/routes/Economics.js.map +1 -0
  588. package/dist/internal/{funding → routes}/Evidence.d.ts +3 -3
  589. package/dist/internal/routes/Evidence.d.ts.map +1 -0
  590. package/dist/internal/{funding → routes}/Evidence.js +7 -7
  591. package/dist/internal/routes/Evidence.js.map +1 -0
  592. package/dist/internal/routes/Observability.d.ts +154 -0
  593. package/dist/internal/routes/Observability.d.ts.map +1 -0
  594. package/dist/internal/routes/Observability.js +389 -0
  595. package/dist/internal/routes/Observability.js.map +1 -0
  596. package/dist/internal/{funding → routes}/Provider.d.ts +311 -105
  597. package/dist/internal/routes/Provider.d.ts.map +1 -0
  598. package/dist/internal/{funding → routes}/Provider.js +229 -98
  599. package/dist/internal/routes/Provider.js.map +1 -0
  600. package/dist/internal/{funding → routes}/Reconciliation.d.ts +11 -6
  601. package/dist/internal/routes/Reconciliation.d.ts.map +1 -0
  602. package/dist/internal/{funding → routes}/Reconciliation.js +408 -158
  603. package/dist/internal/routes/Reconciliation.js.map +1 -0
  604. package/dist/internal/routes/Route.d.ts +21 -0
  605. package/dist/internal/routes/Route.d.ts.map +1 -0
  606. package/dist/internal/{funding → routes}/Route.js +1 -1
  607. package/dist/internal/routes/Route.js.map +1 -0
  608. package/dist/internal/{funding → routes}/SourceObservation.d.ts +6 -6
  609. package/dist/internal/routes/SourceObservation.d.ts.map +1 -0
  610. package/dist/internal/{funding → routes}/SourceObservation.js +8 -8
  611. package/dist/internal/routes/SourceObservation.js.map +1 -0
  612. package/dist/internal/{funding → routes}/Subsidy.d.ts +48 -3
  613. package/dist/internal/routes/Subsidy.d.ts.map +1 -0
  614. package/dist/internal/{funding → routes}/Subsidy.js +43 -3
  615. package/dist/internal/routes/Subsidy.js.map +1 -0
  616. package/dist/internal/{funding → routes}/Token.d.ts +4 -4
  617. package/dist/internal/routes/Token.d.ts.map +1 -0
  618. package/dist/internal/{funding → routes}/Token.js +3 -3
  619. package/dist/internal/routes/Token.js.map +1 -0
  620. package/dist/internal/{funding → routes}/Transfer.d.ts +241 -46
  621. package/dist/internal/routes/Transfer.d.ts.map +1 -0
  622. package/dist/internal/routes/Transfer.js +728 -0
  623. package/dist/internal/routes/Transfer.js.map +1 -0
  624. package/dist/internal/{funding → routes}/TransferReconciliation.d.ts +13 -10
  625. package/dist/internal/routes/TransferReconciliation.d.ts.map +1 -0
  626. package/dist/internal/routes/TransferReconciliation.js +422 -0
  627. package/dist/internal/routes/TransferReconciliation.js.map +1 -0
  628. package/dist/internal/routes/TransferSubsidy.d.ts +201 -0
  629. package/dist/internal/routes/TransferSubsidy.d.ts.map +1 -0
  630. package/dist/internal/routes/TransferSubsidy.js +256 -0
  631. package/dist/internal/routes/TransferSubsidy.js.map +1 -0
  632. package/dist/internal/{funding → routes}/TransferWebhook.d.ts +5 -5
  633. package/dist/internal/routes/TransferWebhook.d.ts.map +1 -0
  634. package/dist/internal/{funding → routes}/TransferWebhook.js +3 -3
  635. package/dist/internal/routes/TransferWebhook.js.map +1 -0
  636. package/dist/internal/{funding → routes}/index.d.ts +2 -0
  637. package/dist/internal/routes/index.d.ts.map +1 -0
  638. package/dist/internal/{funding → routes}/index.js +2 -0
  639. package/dist/internal/routes/index.js.map +1 -0
  640. package/dist/internal/{funding → routes}/providers/across.d.ts +4 -4
  641. package/dist/internal/routes/providers/across.d.ts.map +1 -0
  642. package/dist/internal/{funding → routes}/providers/across.js +13 -13
  643. package/dist/internal/routes/providers/across.js.map +1 -0
  644. package/dist/internal/{funding → routes}/providers/relay.d.ts +21 -12
  645. package/dist/internal/routes/providers/relay.d.ts.map +1 -0
  646. package/dist/internal/{funding → routes}/providers/relay.js +194 -110
  647. package/dist/internal/routes/providers/relay.js.map +1 -0
  648. package/dist/internal/{funding → routes}/providers/rhino.d.ts +4 -4
  649. package/dist/internal/routes/providers/rhino.d.ts.map +1 -0
  650. package/dist/internal/{funding → routes}/providers/rhino.js +10 -10
  651. package/dist/internal/routes/providers/rhino.js.map +1 -0
  652. package/dist/internal/{funding → routes}/providers/squid.d.ts +4 -4
  653. package/dist/internal/routes/providers/squid.d.ts.map +1 -0
  654. package/dist/internal/{funding → routes}/providers/squid.js +14 -14
  655. package/dist/internal/routes/providers/squid.js.map +1 -0
  656. package/dist/internal/{funding → routes}/providers/stargate.d.ts +46 -18
  657. package/dist/internal/routes/providers/stargate.d.ts.map +1 -0
  658. package/dist/internal/routes/providers/stargate.js +898 -0
  659. package/dist/internal/routes/providers/stargate.js.map +1 -0
  660. package/dist/internal/{funding → routes}/providers/symbiosis.d.ts +4 -4
  661. package/dist/internal/routes/providers/symbiosis.d.ts.map +1 -0
  662. package/dist/internal/{funding → routes}/providers/symbiosis.js +30 -20
  663. package/dist/internal/routes/providers/symbiosis.js.map +1 -0
  664. package/dist/internal/webhookDestinations/slack.js +12 -12
  665. package/dist/internal/webhookDestinations/slack.js.map +1 -1
  666. package/dist/providers/index.d.ts +12 -12
  667. package/dist/providers/index.d.ts.map +1 -1
  668. package/dist/providers/index.js +12 -12
  669. package/dist/providers/index.js.map +1 -1
  670. package/dist/server.d.ts +19 -0
  671. package/dist/server.d.ts.map +1 -0
  672. package/dist/server.js +19 -0
  673. package/dist/server.js.map +1 -0
  674. package/package.json +15 -4
  675. package/src/ApiKey.ts +1 -1
  676. package/src/ApiKeys.test.ts +1033 -3
  677. package/src/ApiKeys.ts +489 -48
  678. package/src/App.test-d.ts +1 -1
  679. package/src/App.test.ts +216 -25
  680. package/src/App.ts +334 -31
  681. package/src/Assets.test.ts +2 -2
  682. package/src/Assets.ts +3 -1
  683. package/src/Auth.test-d.ts +1 -1
  684. package/src/Client.test-d.ts +539 -110
  685. package/src/Handler.ts +0 -1
  686. package/src/OpenApi.contract.test.ts +195 -0
  687. package/src/Scope.ts +17 -5
  688. package/src/Webhooks.ts +1 -1
  689. package/src/admin/App.test.ts +30 -2
  690. package/src/admin/App.ts +42 -6
  691. package/src/admin/apps/api-keys.test.ts +267 -5
  692. package/src/admin/apps/api-keys.ts +100 -50
  693. package/src/admin/apps/earn-vaults.test.ts +158 -0
  694. package/src/admin/apps/earn-vaults.ts +679 -6
  695. package/src/admin/apps/organizations.test.ts +306 -17
  696. package/src/admin/apps/organizations.ts +299 -24
  697. package/src/admin/apps/routes-support.test.ts +200 -0
  698. package/src/admin/apps/routes-support.ts +201 -0
  699. package/src/admin/apps/routes.test.ts +450 -0
  700. package/src/admin/apps/routes.ts +896 -0
  701. package/src/admin/apps/scopes.test.ts +15 -5
  702. package/src/admin/apps/subsidies.test.ts +306 -0
  703. package/src/admin/apps/subsidies.ts +457 -0
  704. package/src/admin/apps/verified-tokens.test.ts +8 -3
  705. package/src/admin/apps/verified-tokens.ts +3 -3
  706. package/src/admin/ui/plugin.ts +1 -2
  707. package/src/admin/ui/src/components/RewardCampaignForm.tsx +1009 -0
  708. package/src/admin/ui/src/lib/config.ts +11 -2
  709. package/src/admin/ui/src/lib/earn-vaults.ts +2 -2
  710. package/src/admin/ui/src/lib/organizations.test.ts +83 -50
  711. package/src/admin/ui/src/lib/organizations.ts +106 -25
  712. package/src/admin/ui/src/lib/query-client.ts +1 -1
  713. package/src/admin/ui/src/lib/reward-campaigns.ts +136 -0
  714. package/src/admin/ui/src/lib/routes.test.ts +88 -0
  715. package/src/admin/ui/src/lib/routes.ts +304 -0
  716. package/src/admin/ui/src/lib/subsidies.ts +75 -0
  717. package/src/admin/ui/src/routeTree.gen.ts +63 -0
  718. package/src/admin/ui/src/routes/__root.tsx +12 -1
  719. package/src/admin/ui/src/routes/api-keys.tsx +196 -84
  720. package/src/admin/ui/src/routes/earn.vaults_.$vaultId.edit.tsx +105 -70
  721. package/src/admin/ui/src/routes/organizations_.$orgId.tsx +239 -23
  722. package/src/admin/ui/src/routes/routes.tsx +1615 -0
  723. package/src/admin/ui/src/routes/routes_.support.tsx +248 -0
  724. package/src/admin/ui/src/routes/subsidies.tsx +799 -0
  725. package/src/admin/ui.generated.ts +144 -69
  726. package/src/analytics/Analytics.test.ts +108 -18
  727. package/src/analytics/Analytics.ts +38 -6
  728. package/src/analytics/tables/requestEvents.test.ts +100 -0
  729. package/src/analytics/tables/requestEvents.ts +10 -1
  730. package/src/analytics/tables/routesLifecycleIntervals.ts +140 -0
  731. package/src/apps/Zones.test.ts +15 -0
  732. package/src/apps/Zones.ts +52 -5
  733. package/src/apps/composition.test.ts +68 -60
  734. package/src/apps/data/App.test.ts +154 -2
  735. package/src/apps/data/App.ts +88 -28
  736. package/src/apps/data/routes/activities.test.ts +419 -7
  737. package/src/apps/data/routes/activities.ts +683 -216
  738. package/src/apps/data/routes/balances.test.ts +2 -2
  739. package/src/apps/data/routes/blocks.test.ts +46 -1
  740. package/src/apps/data/routes/coingecko.test.ts +419 -1
  741. package/src/apps/data/routes/coingecko.ts +309 -253
  742. package/src/apps/data/routes/earn.discovery.test.ts +274 -0
  743. package/src/apps/data/routes/earn.test.ts +1294 -17
  744. package/src/apps/data/routes/earn.ts +1838 -321
  745. package/src/apps/data/routes/exchanges.test.ts +12 -15
  746. package/src/apps/data/routes/fee-amm.test.ts +224 -0
  747. package/src/apps/data/routes/fee-amm.ts +191 -160
  748. package/src/apps/data/routes/indexer.test.ts +389 -0
  749. package/src/apps/data/routes/indexer.ts +165 -69
  750. package/src/apps/data/routes/receipts.test.ts +1 -1
  751. package/src/apps/data/routes/rpc.test.ts +352 -8
  752. package/src/apps/data/routes/rpc.ts +407 -219
  753. package/src/apps/data/routes/rpc.zone.test.ts +340 -0
  754. package/src/apps/data/routes/tokenlist.test.ts +285 -0
  755. package/src/apps/data/routes/tokenlist.ts +173 -88
  756. package/src/apps/data/routes/tokens.test.ts +93 -3
  757. package/src/apps/data/routes/tokens.ts +39 -23
  758. package/src/apps/data/routes/transactions.test.ts +1 -1
  759. package/src/apps/data/routes/transfers.test.ts +56 -24
  760. package/src/apps/data/routes/transfers.ts +19 -8
  761. package/src/apps/data/routes/valuation.test.ts +1 -1
  762. package/src/apps/data/routes/verified-tokens.test.ts +345 -0
  763. package/src/apps/data/routes/verified-tokens.ts +99 -29
  764. package/src/apps/data/routes/webhooks.test.ts +645 -83
  765. package/src/apps/data/routes/webhooks.ts +1089 -857
  766. package/src/apps/data/routes/zones.test.ts +148 -71
  767. package/src/apps/data/routes/zones.ts +71 -55
  768. package/src/apps/docs/reference.ts +2 -2
  769. package/src/apps/index.ts +1 -1
  770. package/src/apps/management/App.ts +9 -51
  771. package/src/apps/management/Billing.test.ts +375 -14
  772. package/src/apps/management/Billing.ts +265 -29
  773. package/src/apps/management/routes/api-keys.test.ts +269 -7
  774. package/src/apps/management/routes/api-keys.ts +61 -20
  775. package/src/apps/management/routes/billing.test.ts +477 -15
  776. package/src/apps/management/routes/billing.ts +377 -50
  777. package/src/apps/management/routes/faucet.test.ts +1 -1
  778. package/src/apps/management/routes/faucet.ts +1 -1
  779. package/src/apps/management/routes/invitations.test.ts +270 -3
  780. package/src/apps/management/routes/invitations.ts +185 -15
  781. package/src/apps/management/routes/invoicePreview.test.ts +549 -0
  782. package/src/apps/management/routes/me.test.ts +246 -5
  783. package/src/apps/management/routes/me.ts +7 -2
  784. package/src/apps/management/routes/members.test.ts +108 -0
  785. package/src/apps/management/routes/orgs.test.ts +191 -3
  786. package/src/apps/management/routes/orgs.ts +58 -11
  787. package/src/apps/management/routes/projects.test.ts +33 -3
  788. package/src/apps/management/routes/projects.ts +6 -1
  789. package/src/apps/management/routes/scopes.test.ts +30 -2
  790. package/src/apps/management/routes/scopes.ts +4 -1
  791. package/src/apps/management/routes/usage.test.ts +32 -0
  792. package/src/apps/management/routes/usage.ts +22 -4
  793. package/src/apps/management/routes/webhooks.test.ts +49 -26
  794. package/src/apps/management/routes/webhooks.ts +78 -22
  795. package/src/apps/mcp.test.ts +6 -6
  796. package/src/apps/mcp.ts +7 -7
  797. package/src/apps/mpp/App.ts +37 -7
  798. package/src/apps/mpp/Mpp.test.ts +49 -8
  799. package/src/apps/mpp/Mpp.zone.test.ts +219 -0
  800. package/src/apps/mpp/internal/Adapter.ts +34 -0
  801. package/src/apps/mpp/internal/Policy.test.ts +86 -31
  802. package/src/apps/mpp/internal/Policy.ts +49 -7
  803. package/src/apps/mpp/internal/Sponsorship.test.ts +207 -0
  804. package/src/apps/mpp/internal/Sponsorship.ts +9 -3
  805. package/src/apps/relay/App.test.ts +839 -64
  806. package/src/apps/relay/App.ts +148 -81
  807. package/src/apps/relay/App.zone-billing.test.ts +257 -0
  808. package/src/apps/relay/Sponsorships.test.ts +67 -4
  809. package/src/apps/relay/Sponsorships.ts +233 -32
  810. package/src/apps/relay/Sponsorships.zone.test.ts +102 -0
  811. package/src/apps/{funding → routes}/Access.ts +6 -6
  812. package/src/apps/routes/App.test.ts +165 -0
  813. package/src/apps/routes/App.ts +96 -0
  814. package/src/apps/{funding → routes}/Inventory.ts +2 -2
  815. package/src/apps/routes/index.ts +1 -0
  816. package/src/apps/{funding → routes}/routes/chains.test.ts +66 -66
  817. package/src/apps/{funding → routes}/routes/chains.ts +23 -23
  818. package/src/apps/{funding → routes}/routes/deposit-addresses.test.ts +1358 -458
  819. package/src/apps/{funding → routes}/routes/deposit-addresses.ts +566 -246
  820. package/src/apps/{funding → routes}/routes/providers.test.ts +27 -33
  821. package/src/apps/{funding → routes}/routes/providers.ts +23 -23
  822. package/src/apps/{funding → routes}/routes/quotes.test.ts +298 -41
  823. package/src/apps/{funding → routes}/routes/quotes.ts +57 -40
  824. package/src/apps/{funding → routes}/routes/transfers.test.ts +1100 -353
  825. package/src/apps/routes/routes/transfers.ts +1332 -0
  826. package/src/cli/Cli.test.ts +1 -1
  827. package/src/cli/commands/admin.test.ts +748 -1
  828. package/src/cli/commands/admin.ts +278 -0
  829. package/src/cloudflare.ts +52 -47
  830. package/src/db/Db.test.ts +245 -2
  831. package/src/db/Db.ts +1476 -34
  832. package/src/db/Schema.ts +729 -228
  833. package/src/db/tables/apiKeyAdmissionBootstraps.ts +4 -0
  834. package/src/db/tables/apiKeyAdmissions.ts +218 -0
  835. package/src/db/tables/apiKeyOwnerAdmissions.ts +4 -0
  836. package/src/db/tables/apiKeyOwnerTombstones.ts +81 -0
  837. package/src/db/tables/apiKeyRevocations.test.ts +74 -0
  838. package/src/db/tables/apiKeyRevocations.ts +121 -0
  839. package/src/db/tables/authAccounts.ts +105 -0
  840. package/src/db/tables/authSessions.ts +13 -0
  841. package/src/db/tables/authVerifications.ts +13 -0
  842. package/src/db/tables/invitations.ts +142 -45
  843. package/src/db/tables/memberships.ts +79 -3
  844. package/src/db/tables/organizations.test.ts +690 -13
  845. package/src/db/tables/organizations.ts +139 -55
  846. package/src/db/tables/projects.test.ts +16 -0
  847. package/src/db/tables/projects.ts +13 -3
  848. package/src/db/tables/requestUsage.ts +4 -1
  849. package/src/db/tables/rewardAccounts.ts +178 -0
  850. package/src/db/tables/rewardCampaignDistributors.ts +68 -0
  851. package/src/db/tables/rewardCampaigns.test.ts +1388 -0
  852. package/src/db/tables/rewardCampaigns.ts +647 -0
  853. package/src/db/tables/rewardCredits.ts +110 -0
  854. package/src/db/tables/rewardEligibilityAssociations.test.ts +271 -0
  855. package/src/db/tables/rewardEligibilityAssociations.ts +184 -0
  856. package/src/db/tables/rewardRuns.ts +514 -0
  857. package/src/db/tables/rewardTransactionAttempts.ts +272 -0
  858. package/src/db/tables/routesCatalog.test.ts +185 -0
  859. package/src/db/tables/routesCatalog.ts +163 -0
  860. package/src/db/tables/routesDepositAddresses.test.ts +1048 -0
  861. package/src/db/tables/routesDepositAddresses.ts +1008 -0
  862. package/src/db/tables/{fundingDepositRequestObservations.test.ts → routesDepositRequestObservations.test.ts} +13 -14
  863. package/src/db/tables/{fundingDepositRequestObservations.ts → routesDepositRequestObservations.ts} +10 -10
  864. package/src/db/tables/{fundingDeposits.test.ts → routesDeposits.test.ts} +316 -46
  865. package/src/db/tables/routesDeposits.ts +1062 -0
  866. package/src/db/tables/routesIdempotency.test.ts +796 -0
  867. package/src/db/tables/routesIdempotency.ts +496 -0
  868. package/src/db/tables/routesSubsidies.test.ts +120 -0
  869. package/src/db/tables/routesSubsidies.ts +71 -0
  870. package/src/db/tables/{fundingTransferEvents.ts → routesTransferEvents.ts} +4 -4
  871. package/src/db/tables/routesTransferSubsidies.ts +38 -0
  872. package/src/db/tables/routesTransferSubsidyNonces.ts +124 -0
  873. package/src/db/tables/routesTransferTransactions.test.ts +195 -0
  874. package/src/db/tables/{fundingTransferTransactions.ts → routesTransferTransactions.ts} +63 -18
  875. package/src/db/tables/routesTransfers.test.ts +338 -0
  876. package/src/db/tables/routesTransfers.ts +662 -0
  877. package/src/db/tables/sponsoredTransactions.test.ts +269 -45
  878. package/src/db/tables/sponsoredTransactions.ts +225 -65
  879. package/src/db/tables/sponsorshipAttributions.test.ts +160 -0
  880. package/src/db/tables/sponsorshipAttributions.ts +168 -0
  881. package/src/db/tables/sponsorshipReconciliationCursors.test.ts +115 -0
  882. package/src/db/tables/sponsorshipReconciliationCursors.ts +67 -0
  883. package/src/db/tables/stripeCustomers.test.ts +85 -0
  884. package/src/db/tables/stripeCustomers.ts +24 -0
  885. package/src/db/tables/users.test.ts +129 -0
  886. package/src/db/tables/users.ts +49 -3
  887. package/src/db/tables/webhookQueueEvents.ts +8 -1
  888. package/src/db/tables/webhookSubscriptions.ts +95 -20
  889. package/src/handlers/internal/executionError.ts +3 -4
  890. package/src/handlers/internal/multisig.ts +13 -816
  891. package/src/handlers/internal/sponsorship.ts +26 -10
  892. package/src/handlers/relay.test-d.ts +9 -1
  893. package/src/handlers/relay.test.ts +823 -3
  894. package/src/handlers/relay.ts +127 -107
  895. package/src/index.test-d.ts +7 -0
  896. package/src/index.ts +0 -17
  897. package/src/internal/AssetResponse.ts +26 -0
  898. package/src/internal/Auth.test.ts +1564 -9
  899. package/src/internal/Auth.ts +833 -239
  900. package/src/internal/BetterAuth.test.ts +242 -0
  901. package/src/internal/BetterAuth.ts +349 -0
  902. package/src/internal/Cache.ts +2 -0
  903. package/src/internal/EarnRates.test.ts +17 -0
  904. package/src/internal/EarnRates.ts +124 -31
  905. package/src/internal/EarnSharePrices.test.ts +182 -0
  906. package/src/internal/EarnSharePrices.ts +313 -0
  907. package/src/internal/EarnVaults.test.ts +21 -0
  908. package/src/internal/EarnVaults.ts +33 -11
  909. package/src/internal/Email.ts +54 -0
  910. package/src/internal/Idempotency.test.ts +2 -2
  911. package/src/internal/Log.test-d.ts +8 -7
  912. package/src/internal/Log.test.ts +114 -16
  913. package/src/internal/Log.ts +53 -40
  914. package/src/internal/MetricSink.test.ts +313 -26
  915. package/src/internal/MetricSink.ts +73 -8
  916. package/src/internal/Mpp.test.ts +31 -0
  917. package/src/internal/Mpp.ts +21 -24
  918. package/src/internal/OpenApi.ts +45 -12
  919. package/src/internal/Provider.test.ts +1 -1
  920. package/src/internal/Provider.ts +1 -1
  921. package/src/internal/RateLimit.test.ts +21 -3
  922. package/src/internal/RateLimit.ts +12 -1
  923. package/src/internal/Store.test-d.ts +1 -1
  924. package/src/internal/Store.test.ts +151 -8
  925. package/src/internal/Store.ts +76 -9
  926. package/src/internal/Tidx.test.ts +59 -8
  927. package/src/internal/Tidx.ts +86 -14
  928. package/src/internal/Timing.test.ts +77 -0
  929. package/src/internal/Timing.ts +83 -6
  930. package/src/internal/VercelOidc.test.ts +188 -0
  931. package/src/internal/VercelOidc.ts +193 -0
  932. package/src/internal/VerifiedTokens.test.ts +60 -6
  933. package/src/internal/VerifiedTokens.ts +21 -24
  934. package/src/internal/Viem.batch.test.ts +80 -0
  935. package/src/internal/Viem.test.ts +201 -2
  936. package/src/internal/Viem.ts +221 -25
  937. package/src/internal/Webhooks.test.ts +85 -6
  938. package/src/internal/Webhooks.ts +22 -4
  939. package/src/internal/ZoneRpc.ts +50 -0
  940. package/src/internal/exchange/Provider.test.ts +2 -2
  941. package/src/internal/index.test.ts +3 -1
  942. package/src/internal/index.ts +3 -1
  943. package/src/internal/rewards/Audit.ts +231 -0
  944. package/src/internal/rewards/Campaigns.test.ts +1234 -0
  945. package/src/internal/rewards/Campaigns.ts +1205 -0
  946. package/src/internal/rewards/Credits.ts +165 -0
  947. package/src/internal/rewards/Events.local.test.ts +113 -0
  948. package/src/internal/rewards/Events.test.ts +152 -0
  949. package/src/internal/rewards/Events.ts +468 -0
  950. package/src/internal/rewards/Projection.test.ts +681 -0
  951. package/src/internal/rewards/Projection.ts +987 -0
  952. package/src/internal/rewards/Rates.test.ts +171 -0
  953. package/src/internal/rewards/Rates.ts +110 -0
  954. package/src/internal/rewards/Read.test.ts +501 -0
  955. package/src/internal/rewards/Read.ts +476 -0
  956. package/src/internal/rewards/Runner.checkpoint.test.ts +80 -0
  957. package/src/internal/rewards/Runner.states.test.ts +188 -0
  958. package/src/internal/rewards/Runner.test.ts +90 -0
  959. package/src/internal/rewards/Runner.ts +2229 -0
  960. package/src/internal/rewards/Signer.test.ts +79 -0
  961. package/src/internal/rewards/Signer.ts +180 -0
  962. package/src/internal/rewards/index.ts +14 -0
  963. package/src/internal/{funding → routes}/Action.test.ts +63 -14
  964. package/src/internal/{funding → routes}/Action.ts +35 -8
  965. package/src/internal/{funding → routes}/Catalog.test.ts +3 -3
  966. package/src/internal/{funding → routes}/Catalog.ts +39 -39
  967. package/src/internal/{funding → routes}/Chain.test.ts +1 -1
  968. package/src/internal/{funding → routes}/Chain.ts +11 -11
  969. package/src/internal/{funding → routes}/Deposit.test.ts +1 -1
  970. package/src/internal/{funding → routes}/Deposit.ts +93 -45
  971. package/src/internal/{funding → routes}/DepositAddress.test.ts +11 -3
  972. package/src/internal/{funding → routes}/DepositAddress.ts +132 -53
  973. package/src/internal/{funding → routes}/DepositWebhook.test.ts +61 -18
  974. package/src/internal/{funding → routes}/DepositWebhook.ts +9 -9
  975. package/src/internal/routes/Economics.test.ts +42 -0
  976. package/src/internal/routes/Economics.ts +47 -0
  977. package/src/internal/{funding → routes}/Evidence.test.ts +6 -6
  978. package/src/internal/{funding → routes}/Evidence.ts +9 -9
  979. package/src/internal/routes/Observability.test.ts +636 -0
  980. package/src/internal/routes/Observability.ts +668 -0
  981. package/src/internal/{funding → routes}/Provider.test.ts +489 -153
  982. package/src/internal/{funding → routes}/Provider.ts +489 -186
  983. package/src/internal/{funding → routes}/Reconciliation.local.test.ts +84 -12
  984. package/src/internal/{funding → routes}/Reconciliation.test.ts +1213 -279
  985. package/src/internal/{funding → routes}/Reconciliation.ts +501 -203
  986. package/src/internal/routes/Reconciliation.unattributed.test.ts +250 -0
  987. package/src/internal/{funding → routes}/Route.ts +7 -7
  988. package/src/internal/{funding → routes}/SourceObservation.test.ts +13 -14
  989. package/src/internal/{funding → routes}/SourceObservation.ts +13 -13
  990. package/src/internal/{funding → routes}/Subsidy.local.test.ts +7 -7
  991. package/src/internal/routes/Subsidy.test.ts +169 -0
  992. package/src/internal/{funding → routes}/Subsidy.ts +86 -6
  993. package/src/internal/{funding → routes}/Token.test.ts +1 -1
  994. package/src/internal/{funding → routes}/Token.ts +5 -5
  995. package/src/internal/routes/Transfer.test.ts +1199 -0
  996. package/src/internal/routes/Transfer.ts +1206 -0
  997. package/src/internal/routes/TransferReconciliation.test.ts +731 -0
  998. package/src/internal/routes/TransferReconciliation.ts +527 -0
  999. package/src/internal/routes/TransferSubsidy.test.ts +172 -0
  1000. package/src/internal/routes/TransferSubsidy.ts +447 -0
  1001. package/src/internal/{funding → routes}/TransferWebhook.test.ts +13 -13
  1002. package/src/internal/{funding → routes}/TransferWebhook.ts +7 -7
  1003. package/src/internal/{funding → routes}/index.test.ts +5 -3
  1004. package/src/internal/{funding → routes}/index.ts +2 -0
  1005. package/src/internal/{funding → routes}/providers/across.ts +16 -16
  1006. package/src/internal/{funding → routes}/providers/index.test.ts +157 -44
  1007. package/src/internal/{funding → routes}/providers/relay.test.ts +165 -32
  1008. package/src/internal/{funding → routes}/providers/relay.ts +228 -121
  1009. package/src/internal/{funding → routes}/providers/rhino.ts +16 -16
  1010. package/src/internal/{funding → routes}/providers/squid.ts +17 -17
  1011. package/src/internal/routes/providers/stargate.test.ts +728 -0
  1012. package/src/internal/routes/providers/stargate.ts +1276 -0
  1013. package/src/internal/{funding → routes}/providers/symbiosis.ts +64 -24
  1014. package/src/internal/webhookDestinations/slack.ts +10 -10
  1015. package/src/providers/index.ts +13 -13
  1016. package/src/server.ts +18 -0
  1017. package/dist/apps/funding/Access.d.ts.map +0 -1
  1018. package/dist/apps/funding/Access.js.map +0 -1
  1019. package/dist/apps/funding/App.js.map +0 -1
  1020. package/dist/apps/funding/Inventory.d.ts.map +0 -1
  1021. package/dist/apps/funding/Inventory.js.map +0 -1
  1022. package/dist/apps/funding/ProviderAttempts.d.ts +0 -5
  1023. package/dist/apps/funding/ProviderAttempts.d.ts.map +0 -1
  1024. package/dist/apps/funding/ProviderAttempts.js +0 -24
  1025. package/dist/apps/funding/ProviderAttempts.js.map +0 -1
  1026. package/dist/apps/funding/index.d.ts +0 -2
  1027. package/dist/apps/funding/index.d.ts.map +0 -1
  1028. package/dist/apps/funding/index.js +0 -2
  1029. package/dist/apps/funding/index.js.map +0 -1
  1030. package/dist/apps/funding/routes/chains.d.ts.map +0 -1
  1031. package/dist/apps/funding/routes/chains.js.map +0 -1
  1032. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +0 -1
  1033. package/dist/apps/funding/routes/deposit-addresses.js.map +0 -1
  1034. package/dist/apps/funding/routes/providers.d.ts.map +0 -1
  1035. package/dist/apps/funding/routes/providers.js +0 -57
  1036. package/dist/apps/funding/routes/providers.js.map +0 -1
  1037. package/dist/apps/funding/routes/quotes.d.ts.map +0 -1
  1038. package/dist/apps/funding/routes/quotes.js.map +0 -1
  1039. package/dist/apps/funding/routes/transfers.d.ts.map +0 -1
  1040. package/dist/apps/funding/routes/transfers.js +0 -828
  1041. package/dist/apps/funding/routes/transfers.js.map +0 -1
  1042. package/dist/db/tables/fundingCatalog.d.ts +0 -58
  1043. package/dist/db/tables/fundingCatalog.d.ts.map +0 -1
  1044. package/dist/db/tables/fundingCatalog.js.map +0 -1
  1045. package/dist/db/tables/fundingDepositAddresses.d.ts +0 -192
  1046. package/dist/db/tables/fundingDepositAddresses.d.ts.map +0 -1
  1047. package/dist/db/tables/fundingDepositAddresses.js +0 -235
  1048. package/dist/db/tables/fundingDepositAddresses.js.map +0 -1
  1049. package/dist/db/tables/fundingDepositRequestObservations.d.ts.map +0 -1
  1050. package/dist/db/tables/fundingDepositRequestObservations.js.map +0 -1
  1051. package/dist/db/tables/fundingDeposits.d.ts.map +0 -1
  1052. package/dist/db/tables/fundingDeposits.js +0 -295
  1053. package/dist/db/tables/fundingDeposits.js.map +0 -1
  1054. package/dist/db/tables/fundingIdempotency.d.ts +0 -91
  1055. package/dist/db/tables/fundingIdempotency.d.ts.map +0 -1
  1056. package/dist/db/tables/fundingIdempotency.js +0 -103
  1057. package/dist/db/tables/fundingIdempotency.js.map +0 -1
  1058. package/dist/db/tables/fundingTransferEvents.d.ts.map +0 -1
  1059. package/dist/db/tables/fundingTransferEvents.js.map +0 -1
  1060. package/dist/db/tables/fundingTransferTransactions.d.ts +0 -53
  1061. package/dist/db/tables/fundingTransferTransactions.d.ts.map +0 -1
  1062. package/dist/db/tables/fundingTransferTransactions.js.map +0 -1
  1063. package/dist/db/tables/fundingTransfers.d.ts +0 -99
  1064. package/dist/db/tables/fundingTransfers.d.ts.map +0 -1
  1065. package/dist/db/tables/fundingTransfers.js +0 -110
  1066. package/dist/db/tables/fundingTransfers.js.map +0 -1
  1067. package/dist/internal/funding/Action.d.ts.map +0 -1
  1068. package/dist/internal/funding/Action.js.map +0 -1
  1069. package/dist/internal/funding/Catalog.d.ts.map +0 -1
  1070. package/dist/internal/funding/Catalog.js.map +0 -1
  1071. package/dist/internal/funding/Chain.d.ts.map +0 -1
  1072. package/dist/internal/funding/Chain.js.map +0 -1
  1073. package/dist/internal/funding/Deposit.d.ts.map +0 -1
  1074. package/dist/internal/funding/Deposit.js.map +0 -1
  1075. package/dist/internal/funding/DepositAddress.d.ts.map +0 -1
  1076. package/dist/internal/funding/DepositAddress.js.map +0 -1
  1077. package/dist/internal/funding/DepositWebhook.d.ts.map +0 -1
  1078. package/dist/internal/funding/DepositWebhook.js.map +0 -1
  1079. package/dist/internal/funding/Evidence.d.ts.map +0 -1
  1080. package/dist/internal/funding/Evidence.js.map +0 -1
  1081. package/dist/internal/funding/Provider.d.ts.map +0 -1
  1082. package/dist/internal/funding/Provider.js.map +0 -1
  1083. package/dist/internal/funding/Reconciliation.d.ts.map +0 -1
  1084. package/dist/internal/funding/Reconciliation.js.map +0 -1
  1085. package/dist/internal/funding/Route.d.ts +0 -21
  1086. package/dist/internal/funding/Route.d.ts.map +0 -1
  1087. package/dist/internal/funding/Route.js.map +0 -1
  1088. package/dist/internal/funding/SourceObservation.d.ts.map +0 -1
  1089. package/dist/internal/funding/SourceObservation.js.map +0 -1
  1090. package/dist/internal/funding/Subsidy.d.ts.map +0 -1
  1091. package/dist/internal/funding/Subsidy.js.map +0 -1
  1092. package/dist/internal/funding/Token.d.ts.map +0 -1
  1093. package/dist/internal/funding/Token.js.map +0 -1
  1094. package/dist/internal/funding/Transfer.d.ts.map +0 -1
  1095. package/dist/internal/funding/Transfer.js +0 -462
  1096. package/dist/internal/funding/Transfer.js.map +0 -1
  1097. package/dist/internal/funding/TransferReconciliation.d.ts.map +0 -1
  1098. package/dist/internal/funding/TransferReconciliation.js +0 -192
  1099. package/dist/internal/funding/TransferReconciliation.js.map +0 -1
  1100. package/dist/internal/funding/TransferWebhook.d.ts.map +0 -1
  1101. package/dist/internal/funding/TransferWebhook.js.map +0 -1
  1102. package/dist/internal/funding/index.d.ts.map +0 -1
  1103. package/dist/internal/funding/index.js.map +0 -1
  1104. package/dist/internal/funding/providers/across.d.ts.map +0 -1
  1105. package/dist/internal/funding/providers/across.js.map +0 -1
  1106. package/dist/internal/funding/providers/relay.d.ts.map +0 -1
  1107. package/dist/internal/funding/providers/relay.js.map +0 -1
  1108. package/dist/internal/funding/providers/rhino.d.ts.map +0 -1
  1109. package/dist/internal/funding/providers/rhino.js.map +0 -1
  1110. package/dist/internal/funding/providers/squid.d.ts.map +0 -1
  1111. package/dist/internal/funding/providers/squid.js.map +0 -1
  1112. package/dist/internal/funding/providers/stargate.d.ts.map +0 -1
  1113. package/dist/internal/funding/providers/stargate.js +0 -579
  1114. package/dist/internal/funding/providers/stargate.js.map +0 -1
  1115. package/dist/internal/funding/providers/symbiosis.d.ts.map +0 -1
  1116. package/dist/internal/funding/providers/symbiosis.js.map +0 -1
  1117. package/src/apps/funding/App.test.ts +0 -78
  1118. package/src/apps/funding/App.ts +0 -88
  1119. package/src/apps/funding/ProviderAttempts.ts +0 -26
  1120. package/src/apps/funding/index.ts +0 -1
  1121. package/src/apps/funding/routes/transfers.ts +0 -987
  1122. package/src/db/tables/fundingCatalog.test.ts +0 -122
  1123. package/src/db/tables/fundingCatalog.ts +0 -163
  1124. package/src/db/tables/fundingDepositAddresses.test.ts +0 -608
  1125. package/src/db/tables/fundingDepositAddresses.ts +0 -443
  1126. package/src/db/tables/fundingDeposits.ts +0 -572
  1127. package/src/db/tables/fundingIdempotency.test.ts +0 -182
  1128. package/src/db/tables/fundingIdempotency.ts +0 -180
  1129. package/src/db/tables/fundingTransferTransactions.test.ts +0 -112
  1130. package/src/db/tables/fundingTransfers.test.ts +0 -115
  1131. package/src/db/tables/fundingTransfers.ts +0 -189
  1132. package/src/handlers/internal/multisig.test.ts +0 -818
  1133. package/src/internal/funding/Subsidy.test.ts +0 -75
  1134. package/src/internal/funding/Transfer.test.ts +0 -524
  1135. package/src/internal/funding/Transfer.ts +0 -762
  1136. package/src/internal/funding/TransferReconciliation.test.ts +0 -147
  1137. package/src/internal/funding/TransferReconciliation.ts +0 -264
  1138. package/src/internal/funding/providers/stargate.test.ts +0 -328
  1139. package/src/internal/funding/providers/stargate.ts +0 -856
  1140. /package/dist/apps/{funding → routes}/Inventory.d.ts +0 -0
  1141. /package/src/internal/{funding → routes}/Route.test.ts +0 -0
@@ -5,17 +5,19 @@ import * as core_Provider from '../Provider.js'
5
5
  import * as OpenApi from '../OpenApi.js'
6
6
  import * as Schema from '../Schema.js'
7
7
  import * as Value from '../Value.js'
8
+ import * as Viem from '../Viem.js'
8
9
  import * as Action from './Action.js'
9
10
  import type * as core_Catalog from './Catalog.js'
10
11
  import type * as core_Chain from './Chain.js'
12
+ import * as Economics from './Economics.js'
11
13
  import type * as core_Route from './Route.js'
12
14
  import type * as core_Token from './Token.js'
13
15
  import type * as Transfer from './Transfer.js'
14
16
 
15
- /** Tempo token used when the caller omits `destinationToken`. */
17
+ /** Destination token used when the caller omits `destinationToken`. */
16
18
  const defaultDestinationToken = 'usdce'
17
19
 
18
- /** Funding provider schemas. */
20
+ /** Route provider schemas. */
19
21
  export namespace schema {
20
22
  /** Bounded upstream error code safe for structured logs. */
21
23
  export const ErrorCode = z.string().check(z.regex(/^[A-Za-z0-9_.:-]{1,64}$/))
@@ -36,13 +38,13 @@ export namespace schema {
36
38
  type: z.optional(z.string()),
37
39
  })
38
40
 
39
- /** Positive decimal amount accepted by funding quote requests. */
41
+ /** Positive decimal amount accepted by route quote requests. */
40
42
  export const PositiveDecimal = z.string().check(z.regex(/^(?=.*[1-9])\d+(\.\d+)?$/))
41
43
 
42
- /** Positive base-unit amount accepted by funding quote requests. */
44
+ /** Positive base-unit amount accepted by route quote requests. */
43
45
  export const PositiveInteger = z.string().check(z.regex(/^(?=.*[1-9])\d+$/))
44
46
 
45
- /** Normalized chain reference passed to funding providers. */
47
+ /** Normalized chain reference passed to route providers. */
46
48
  export const ChainRef = OpenApi.component(
47
49
  Schema.describe(
48
50
  z.object({
@@ -63,12 +65,12 @@ export namespace schema {
63
65
  .string()
64
66
  .check(z.describe('Human-readable chain name.'), z.meta({ examples: ['Base'] })),
65
67
  }),
66
- 'A normalized chain reference for funding quotes.',
68
+ 'A normalized chain reference for route quotes.',
67
69
  ),
68
- 'FundingChain',
70
+ 'RoutesChain',
69
71
  )
70
72
 
71
- /** Normalized token reference passed to funding providers. */
73
+ /** Normalized token reference passed to route providers. */
72
74
  export const TokenRef = OpenApi.component(
73
75
  Schema.describe(
74
76
  z.object({
@@ -113,16 +115,16 @@ export namespace schema {
113
115
  verified: z
114
116
  .boolean()
115
117
  .check(
116
- z.describe('Whether Tempo recognizes this token in its funding quote inventory.'),
118
+ z.describe('Whether Tempo recognizes this token in its route quote inventory.'),
117
119
  z.meta({ examples: [true] }),
118
120
  ),
119
121
  }),
120
- 'A normalized token reference for funding quotes.',
122
+ 'A normalized token reference for route quotes.',
121
123
  ),
122
- 'FundingToken',
124
+ 'RoutesToken',
123
125
  )
124
126
 
125
- /** Provider identity embedded in funding resources. */
127
+ /** Provider identity embedded in route resources. */
126
128
  export const ProviderRef = OpenApi.component(
127
129
  Schema.describe(
128
130
  z.object({
@@ -131,12 +133,31 @@ export namespace schema {
131
133
  .string()
132
134
  .check(z.describe('Human-readable provider name.'), z.meta({ examples: ['Relay'] })),
133
135
  }),
134
- 'Provider metadata embedded in a funding quote.',
136
+ 'Provider metadata embedded in a route quote.',
135
137
  ),
136
- 'FundingProvider',
138
+ 'RoutesProvider',
137
139
  )
138
140
 
139
- /** Source amount unit accepted by a funding quote request. */
141
+ /** One token amount paid by a subsidy provider. */
142
+ export const Subsidy = OpenApi.component(
143
+ Schema.describe(
144
+ z.object({
145
+ amount: Schema.TokenAmount,
146
+ provider: z
147
+ .string()
148
+ .check(
149
+ z.minLength(1),
150
+ z.describe('Stable id of the subsidy provider.'),
151
+ z.meta({ examples: ['relay'] }),
152
+ ),
153
+ token: TokenRef,
154
+ }),
155
+ 'One token amount paid on behalf of the deposit recipient.',
156
+ ),
157
+ 'RoutesSubsidy',
158
+ )
159
+
160
+ /** Source amount unit accepted by a route quote request. */
140
161
  export const SourceAmountUnits = z
141
162
  ._default(z.enum(['baseUnits', 'decimal']), 'baseUnits')
142
163
  .check(
@@ -144,22 +165,30 @@ export namespace schema {
144
165
  z.meta({ examples: ['baseUnits', 'decimal'] }),
145
166
  )
146
167
 
147
- /** Normalized caller request passed to funding providers. */
168
+ /** Normalized caller request passed to route providers. */
148
169
  export const QuoteRequest = z
149
170
  .strictObject({
171
+ destinationChain: z
172
+ .optional(z.string().check(z.minLength(1)))
173
+ .check(
174
+ z.describe('Destination chain CAIP-2 id, slug, or alias. Defaults to Tempo.'),
175
+ z.meta({ examples: ['tempo', 'base', 'ethereum', 'eip155:4217'] }),
176
+ ),
150
177
  destinationToken: z
151
178
  .optional(z.string())
152
179
  .check(
153
- z.describe('Tempo destination token symbol, address, or token key. Defaults to USDC.e.'),
154
- z.meta({ examples: ['usdc.e'] }),
180
+ z.describe(
181
+ 'Destination token symbol, address, or token key. Defaults to USDC.e for Tempo destinations.',
182
+ ),
183
+ z.meta({ examples: ['usdc.e', 'usdc'] }),
155
184
  ),
156
185
  provider: z
157
186
  .optional(z.string().check(z.minLength(1)))
158
187
  .check(
159
188
  z.describe(
160
- 'Only request a quote from this provider. Use an id returned by the funding providers endpoint, or omit it to query every available provider.',
189
+ 'Only request a quote from this provider. Use an id returned by the route providers endpoint, or omit it to query every available provider.',
161
190
  ),
162
- z.meta({ examples: ['relay'] }),
191
+ z.meta({ examples: ['relay', 'stargate'] }),
163
192
  ),
164
193
  sourceAmount: PositiveDecimal.check(
165
194
  z.describe('Positive source token amount. Base units by default, so 1 USDC is `1000000`.'),
@@ -173,19 +202,19 @@ export namespace schema {
173
202
  z.describe(
174
203
  'Source chain alias or stable id, such as `base`, `solana`, or `eip155:8453`.',
175
204
  ),
176
- z.meta({ examples: ['base', 'eip155:8453'] }),
205
+ z.meta({ examples: ['base', 'ethereum', 'tempo', 'eip155:8453'] }),
177
206
  ),
178
- sourceToken: z
179
- .string()
180
- .check(
181
- z.minLength(1),
182
- z.describe(
183
- 'Source token symbol, contract address, or Tempo token key. Lookup is scoped to `sourceChain`; non-EVM addresses are case-sensitive. An unknown token returns an empty list.',
184
- ),
185
- z.meta({ examples: ['usdc', '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'] }),
207
+ sourceToken: z.string().check(
208
+ z.minLength(1),
209
+ z.describe(
210
+ 'Source token symbol, contract address, or Tempo token key. Lookup is scoped to `sourceChain`; non-EVM addresses are case-sensitive. An unknown token returns an empty list.',
186
211
  ),
212
+ z.meta({
213
+ examples: ['usdc', 'usdce', '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'],
214
+ }),
215
+ ),
187
216
  })
188
- .check(z.describe('Query parameters for live funding quotes into Tempo.'))
217
+ .check(z.describe('Query parameters for live route quotes.'))
189
218
 
190
219
  /** Provider-specific quote status for the requested amount. */
191
220
  export const QuoteStatus = z.enum(['available', 'thin', 'unknown', 'unavailable'])
@@ -193,7 +222,7 @@ export namespace schema {
193
222
  /** Machine-readable provider quote quality tier. */
194
223
  export const QualityTier = z.enum(['liquid', 'thin', 'unknown', 'unavailable'])
195
224
 
196
- /** Quote data returned by a funding provider. */
225
+ /** Quote data returned by a route provider. */
197
226
  export const GetQuoteResult = Schema.describe(
198
227
  z.object({
199
228
  expiresAt: z.optional(z.iso.datetime()),
@@ -210,10 +239,10 @@ export namespace schema {
210
239
  sampledAt: z.iso.datetime(),
211
240
  status: QuoteStatus,
212
241
  }),
213
- 'Quote data returned by a funding provider.',
242
+ 'Quote data returned by a route provider.',
214
243
  )
215
244
 
216
- /** Executable preparation returned by a funding provider. */
245
+ /** Executable preparation returned by a route provider. */
217
246
  export const PrepareResult = z.object({
218
247
  action: Action.schema.Action,
219
248
  correlation: z.optional(
@@ -237,7 +266,7 @@ export namespace schema {
237
266
  sampledAt: z.iso.datetime(),
238
267
  })
239
268
 
240
- /** Reusable deposit address provisioned by a funding provider. */
269
+ /** Reusable deposit address provisioned by a route provider. */
241
270
  export const DepositAddressResult = z
242
271
  .object({
243
272
  address: z
@@ -270,6 +299,7 @@ export namespace schema {
270
299
  refundAmountExpected: z.optional(z.string().check(z.regex(/^\d+$/))),
271
300
  refundTransactionHashes: z.array(z.string()),
272
301
  sourceTransactionHashes: z.array(z.string()),
302
+ subsidy: z.optional(Subsidy),
273
303
  status: z.string().check(z.minLength(1)),
274
304
  updatedAt: z.iso.datetime(),
275
305
  })
@@ -280,8 +310,8 @@ export namespace schema {
280
310
  requests: z.array(DepositAddressRequest),
281
311
  })
282
312
 
283
- /** Quote quality signals exposed to funding API callers. */
284
- export const FundingQuoteQuality = OpenApi.component(
313
+ /** Quote quality signals exposed to routes API callers. */
314
+ export const RoutesQuoteQuality = OpenApi.component(
285
315
  Schema.describe(
286
316
  z.object({
287
317
  estimatedSeconds: z
@@ -290,18 +320,6 @@ export namespace schema {
290
320
  z.describe('Estimated settlement time in seconds, when known.'),
291
321
  z.meta({ examples: [2] }),
292
322
  ),
293
- liquiditySource: z
294
- .string()
295
- .check(
296
- z.describe('Provider source for the live quote quality signal.'),
297
- z.meta({ examples: ['providerQuote'] }),
298
- ),
299
- sourceDetail: z
300
- .optional(z.string())
301
- .check(
302
- z.describe('Provider-specific source or endpoint detail for the quality signal.'),
303
- z.meta({ examples: ['providerEndpoint'] }),
304
- ),
305
323
  tier: z
306
324
  .enum(['liquid', 'thin'])
307
325
  .check(
@@ -309,12 +327,12 @@ export namespace schema {
309
327
  z.meta({ examples: ['liquid'] }),
310
328
  ),
311
329
  }),
312
- 'Machine-readable liquidity, fee, and source signals for a successful quote.',
330
+ 'Machine-readable quality and settlement-time signals for a successful quote.',
313
331
  ),
314
- 'FundingQuoteQuality',
332
+ 'RoutesQuoteQuality',
315
333
  )
316
334
 
317
- /** Provider quote freshness data exposed to funding API callers. */
335
+ /** Provider quote freshness data exposed to routes API callers. */
318
336
  export const QuoteDetails = OpenApi.component(
319
337
  Schema.describe(
320
338
  z.object({
@@ -331,16 +349,18 @@ export namespace schema {
331
349
  z.meta({ examples: ['2026-01-01T00:00:00Z'] }),
332
350
  ),
333
351
  }),
334
- 'Freshness data for a provider funding quote.',
352
+ 'Freshness data for a provider route quote.',
335
353
  ),
336
- 'FundingQuoteDetails',
354
+ 'RoutesQuoteDetails',
337
355
  )
338
356
 
339
- /** Successful normalized funding quote returned to callers. */
340
- export const FundingQuote = OpenApi.component(
357
+ /** Successful normalized route quote returned to callers. */
358
+ export const RoutesQuote = OpenApi.component(
341
359
  Schema.describe(
342
360
  z.object({
343
- destinationAmount: Schema.TokenAmount.check(z.describe('Expected destination amount.')),
361
+ destinationAmount: Schema.TokenAmount.check(
362
+ z.describe('Expected amount received after provider deductions, including pool fees.'),
363
+ ),
344
364
  destinationAmountMin: z
345
365
  .optional(Schema.TokenAmount)
346
366
  .check(
@@ -348,36 +368,34 @@ export namespace schema {
348
368
  'Provider-derived minimum destination amount. Symbiosis and Squid quotes use a fixed 1% slippage tolerance.',
349
369
  ),
350
370
  ),
351
- destinationChain: ChainRef.check(
352
- z.describe('Destination chain, always Tempo mainnet in V1.'),
353
- ),
354
- destinationToken: TokenRef.check(z.describe('Tempo token expected from this quote.')),
371
+ destinationChain: ChainRef.check(z.describe('Chain that receives the routed token.')),
372
+ destinationToken: TokenRef.check(z.describe('Token expected from this quote.')),
355
373
  id: z
356
374
  .string()
357
375
  .check(
358
- z.describe('Stable deterministic funding quote id.'),
376
+ z.describe('Stable deterministic route quote id.'),
359
377
  z.meta({ examples: ['base-usdc-tempo-usdce-relay'] }),
360
378
  ),
361
379
  provider: ProviderRef,
362
- quality: FundingQuoteQuality,
380
+ quality: RoutesQuoteQuality,
363
381
  quote: QuoteDetails,
364
382
  sourceAmount: Schema.TokenAmount,
365
383
  sourceChain: ChainRef.check(z.describe('Chain where the caller currently holds funds.')),
366
384
  sourceToken: TokenRef.check(z.describe('Token the caller currently holds.')),
367
385
  }),
368
- 'One successful provider-specific funding quote.',
386
+ 'One successful provider-specific route quote.',
369
387
  ),
370
- 'FundingQuote',
388
+ 'RoutesQuote',
371
389
  )
372
390
  }
373
391
 
374
- /** Chain metadata declared by a funding route. */
392
+ /** Chain metadata declared by a provider route. */
375
393
  export type Chain = core_Chain.Chain
376
394
 
377
- /** Token metadata declared by a funding route. */
395
+ /** Token metadata declared by a provider route. */
378
396
  export type Token = core_Token.Resolved
379
397
 
380
- /** Provider ids accepted by funding quote requests. */
398
+ /** Provider ids accepted by route quote requests. */
381
399
  export type ProviderId = string
382
400
 
383
401
  /** Provider-specific quote status for the requested amount. */
@@ -386,48 +404,83 @@ export type QuoteStatus = z.output<typeof schema.QuoteStatus>
386
404
  /** Machine-readable quote quality tier. */
387
405
  export type QualityTier = z.output<typeof schema.QualityTier>
388
406
 
389
- /** Normalized chain reference passed to funding providers. */
407
+ /** Normalized chain reference passed to route providers. */
390
408
  export type ChainRef = z.output<typeof schema.ChainRef>
391
409
 
392
- /** Normalized token amount passed to funding providers. */
410
+ /** Normalized token amount passed to route providers. */
393
411
  export type TokenAmount = ReturnType<typeof resolveSourceAmount>
394
412
 
395
- /** Normalized token reference passed to funding providers. */
413
+ /** Normalized token reference passed to route providers. */
396
414
  export type TokenRef = z.output<typeof schema.TokenRef>
397
415
 
398
- /** A normalized internal candidate passed to funding quote providers. */
416
+ /** One token amount paid by a subsidy provider. */
417
+ export type Subsidy = z.output<typeof schema.Subsidy>
418
+
419
+ /** A normalized internal candidate passed to route quote providers. */
399
420
  export type QuoteCandidate = ReturnType<typeof createQuoteCandidate>
400
421
 
401
422
  /** A normalized route candidate passed to deposit-address providers. */
402
423
  export type DepositAddressCandidate = ReturnType<typeof createDepositAddressCandidate>
403
424
 
404
- /** A successful normalized funding quote returned to callers. */
405
- export type FundingQuote = z.output<typeof schema.FundingQuote>
425
+ /** A successful normalized route quote returned to callers. */
426
+ export type RoutesQuote = z.output<typeof schema.RoutesQuote>
406
427
 
407
- /** Cache policy for a single funding quote request. */
428
+ /** Cache policy for a single route quote request. */
408
429
  export type CachePolicy = {
409
430
  /** Whether providers should bypass their own quote or inventory caches. */
410
431
  bypass: boolean
411
432
  }
412
433
 
413
- /** Normalized caller request passed to funding providers. */
434
+ /** Normalized caller request passed to route providers. */
414
435
  export type QuoteRequest = z.output<typeof schema.QuoteRequest>
415
436
 
437
+ /** Bounded quote sample retained for request-level reliability telemetry. */
438
+ export type QuoteSample = {
439
+ /** Quote age when the provider request completed. */
440
+ ageMs: number
441
+ /** Destination value loss relative to the requested source amount, in signed basis points. */
442
+ customerValueLossBps?: number | undefined
443
+ /** Destination chain in the quoted corridor. */
444
+ destinationChain: string
445
+ /** Destination token in the quoted corridor. */
446
+ destinationToken: string
447
+ /** Amount the provider timestamp is ahead of the API clock. */
448
+ futureSkewMs: number
449
+ /** Provider that returned the quote. */
450
+ provider: string
451
+ /** Source chain in the quoted corridor. */
452
+ sourceChain: string
453
+ /** Source token in the quoted corridor. */
454
+ sourceToken: string
455
+ }
456
+
457
+ /** Request-level result used to measure quote availability and freshness. */
458
+ export type QuoteRequestResult = {
459
+ /** Number of configured route candidates matching the request. */
460
+ candidateCount: number
461
+ /** Bounded request outcome for quote-availability measurement. */
462
+ outcome: 'available' | 'failed' | 'unavailable' | 'unsupported'
463
+ /** Successful provider quote samples returned to the caller. */
464
+ quotes: readonly QuoteSample[]
465
+ }
466
+
416
467
  /** Contract of the provider `getQuote` method. */
417
468
  export declare namespace getQuote {
418
- /** Input passed to a funding provider for one curated quote candidate. */
469
+ /** Input passed to a route provider for one curated quote candidate. */
419
470
  type Parameters = {
420
471
  /** Curated candidate selected for live provider quoting. */
421
472
  candidate: QuoteCandidate
422
473
  /** Cache policy for provider-side discovery and quote lookups. */
423
474
  cache: CachePolicy
424
- /** Destination chain, always Tempo mainnet in V1. */
475
+ /** Chain that receives the routed token. */
425
476
  destinationChain: ChainRef
426
- /** Tempo token expected from this quote. */
477
+ /** Token expected from this quote. */
427
478
  destinationToken: TokenRef
479
+ /** Stable non-secret tenant identity for provider-local fairness. */
480
+ quotaKey?: string | undefined
428
481
  /** Normalized caller request that produced this quote candidate. */
429
482
  request: QuoteRequest
430
- /** Canonical funding route selected for this quote candidate. */
483
+ /** Canonical provider route selected for this quote candidate. */
431
484
  route: core_Route.Route
432
485
  /** Source amount in base units and display form. */
433
486
  sourceAmount: TokenAmount
@@ -437,7 +490,7 @@ export declare namespace getQuote {
437
490
  sourceToken: TokenRef
438
491
  }
439
492
 
440
- /** Quote data returned by a funding provider. */
493
+ /** Quote data returned by a route provider. */
441
494
  type ReturnType = z.output<typeof schema.GetQuoteResult>
442
495
  }
443
496
 
@@ -451,23 +504,23 @@ export declare namespace prepareTransfer {
451
504
  requestId: string
452
505
  }
453
506
 
454
- /** Input passed to a funding provider preparing one executable transfer. */
507
+ /** Input passed to a route provider preparing one executable transfer. */
455
508
  type Parameters = {
456
509
  /** Curated candidate selected for preparation. */
457
510
  candidate: QuoteCandidate
458
- /** Funding method the caller selected. */
511
+ /** Route method the caller selected. */
459
512
  method: Transfer.Method
460
513
  /** Amount mode the caller selected. */
461
514
  mode: Transfer.Mode
462
515
  /** Final beneficiary on the destination chain. */
463
516
  recipient: string
464
- /** Source-chain account that signs the funding action. */
517
+ /** Source-chain account that signs the route action. */
465
518
  sender: string
466
519
  /** Caller slippage bound in basis points. */
467
520
  slippageBps?: number | undefined
468
521
  }
469
522
 
470
- /** Executable preparation returned by a funding provider. */
523
+ /** Executable preparation returned by a route provider. */
471
524
  type ReturnType = z.output<typeof schema.PrepareResult>
472
525
  }
473
526
 
@@ -477,13 +530,43 @@ export declare namespace validateTransferAction {
477
530
  type Parameters = prepareTransfer.Parameters & {
478
531
  /** Executable action returned by the provider. */
479
532
  action: Action.Action
533
+ /** Minimum destination amount encoded by the provider action. */
534
+ destinationAmountMin: string
480
535
  }
481
536
 
482
537
  /** Provider-specific constraints established by validation. */
483
538
  type ReturnType = {
484
539
  /** Exact native values independently validated against provider calldata. */
485
540
  nativeValues?: readonly Action.NativeValue[] | undefined
541
+ /** Exact additional token approvals independently validated against provider calldata. */
542
+ tokenApprovals?: readonly Action.TokenApproval[] | undefined
543
+ }
544
+ }
545
+
546
+ /** Contract for provider-specific destination delivery verification. */
547
+ export declare namespace verifyDestinationDelivery {
548
+ /** Stored transfer terms and provider evidence. */
549
+ type Parameters = {
550
+ /** Configured chain that receives the provider delivery. */
551
+ destinationChain: Chain
552
+ /** Private provider state captured while preparing and registering the transfer. */
553
+ providerState?: Transfer.ProviderState | undefined
554
+ /** Configured chain containing the submitted transaction. */
555
+ sourceChain: Chain
556
+ /** Stored public transfer terms. */
557
+ transfer: Transfer.Snapshot
486
558
  }
559
+
560
+ /** Destination delivery verification outcome. */
561
+ type ReturnType =
562
+ | { type: 'invalid' }
563
+ | { type: 'pending' }
564
+ | {
565
+ /** Verified destination transaction reference. */
566
+ transactionHash: string
567
+ /** The destination delivery matches the stored transfer terms. */
568
+ type: 'verified'
569
+ }
487
570
  }
488
571
 
489
572
  /** Contract for provider-specific source transaction verification. */
@@ -509,6 +592,18 @@ export declare namespace verifySourceTransaction {
509
592
  | { type: 'invalid' }
510
593
  | { type: 'pending' }
511
594
  | {
595
+ /** Private provider state retained while awaiting replacement evidence. */
596
+ providerState: Transfer.ProviderState
597
+ /** Previously verified source evidence left the canonical chain. */
598
+ type: 'reorged'
599
+ }
600
+ | {
601
+ /** The transaction supports the transfer but does not execute it. */
602
+ type: 'related'
603
+ }
604
+ | {
605
+ /** Exact destination amount observed in the source transaction, when provider fees changed after preparation. */
606
+ destinationAmount?: string | undefined
512
607
  /** Private provider evidence retained for reconciliation. */
513
608
  providerState?: Transfer.ProviderState | undefined
514
609
  /** The transaction matches the stored transfer terms. */
@@ -544,8 +639,12 @@ export declare namespace listDepositAddressRequests {
544
639
  address: string
545
640
  /** Opaque provider cursor returned by the previous page. */
546
641
  continuation?: string | undefined
642
+ /** Token delivered by the provider, when needed to identify a subsidy payment. */
643
+ destinationToken?: TokenRef | undefined
547
644
  /** Existing provider request to refresh directly. */
548
645
  requestId?: string | undefined
646
+ /** Token received by the provider, when needed to identify a subsidy payment. */
647
+ sourceToken?: TokenRef | undefined
549
648
  }
550
649
 
551
650
  /** One page of normalized provider requests. */
@@ -608,13 +707,15 @@ export declare namespace observeDepositAddressRequest {
608
707
  | {
609
708
  /** Verified destination transaction references. */
610
709
  destinationTransactionHashes: readonly string[]
710
+ /** Token amount paid by the provider for this request. */
711
+ subsidy?: z.output<typeof schema.Subsidy> | undefined
611
712
  /** Authenticated provider delivery was observed onchain. */
612
713
  type: 'verified'
613
714
  }
614
715
  )
615
716
  }
616
717
 
617
- /** Optional webhook capability implemented by a complete funding integration. */
718
+ /** Optional webhook capability implemented by a complete route integration. */
618
719
  export type Webhook = {
619
720
  /** Authenticates, resolves, and enqueues one provider status event. */
620
721
  receive(input: Webhook.receive.Parameters): Promise<Webhook.receive.ReturnType>
@@ -622,11 +723,11 @@ export type Webhook = {
622
723
  verify(input: Webhook.verify.Parameters): Webhook.verify.ReturnType
623
724
  }
624
725
 
625
- /** Contracts for a funding provider webhook capability. */
726
+ /** Contracts for a route provider webhook capability. */
626
727
  export declare namespace Webhook {
627
728
  /** Contracts for receiving one authenticated provider webhook. */
628
729
  namespace receive {
629
- /** Raw provider webhook request passed to a funding integration. */
730
+ /** Raw provider webhook request passed to a route integration. */
630
731
  type Parameters = {
631
732
  /** Exact request body bytes decoded as UTF-8. */
632
733
  body: string
@@ -634,9 +735,9 @@ export declare namespace Webhook {
634
735
  headers: Headers
635
736
  }
636
737
 
637
- /** Durable queue message emitted for one authenticated funding status hint. */
738
+ /** Durable queue message emitted for one authenticated routes status hint. */
638
739
  type Dispatchable = {
639
- /** Stored funding deposit address id. */
740
+ /** Stored route deposit address id. */
640
741
  addressId: string
641
742
  /** Bounded follow-up state for work awaiting provider or settlement confirmation. */
642
743
  followUp?: FollowUp | undefined
@@ -647,7 +748,7 @@ export declare namespace Webhook {
647
748
  /** Mechanism that requested reconciliation. */
648
749
  trigger: 'chain' | 'manual' | 'poll' | 'webhook'
649
750
  /** Reconciliation queue message discriminator. */
650
- type: 'funding:deposit-address:reconcile'
751
+ type: 'routes:deposit-address:reconcile'
651
752
  /** Authenticated provider webhook timing carried into reconciliation. */
652
753
  webhookTiming?: WebhookTiming | undefined
653
754
  }
@@ -680,7 +781,7 @@ export declare namespace Webhook {
680
781
  trigger?: Dispatchable['trigger'] | undefined
681
782
  }
682
783
 
683
- /** Safe disposition of one authenticated funding provider webhook. */
784
+ /** Safe disposition of one authenticated route provider webhook. */
684
785
  type ReturnType =
685
786
  | { addressId: string; type: 'queued' }
686
787
  | { type: 'ignored' }
@@ -689,10 +790,10 @@ export declare namespace Webhook {
689
790
 
690
791
  /** Contracts for verifying one provider webhook. */
691
792
  namespace verify {
692
- /** Raw provider webhook request passed to a funding integration. */
793
+ /** Raw provider webhook request passed to a route integration. */
693
794
  type Parameters = receive.Parameters
694
795
 
695
- /** Authenticated provider hint extracted from a funding webhook. */
796
+ /** Authenticated provider hint extracted from a routes webhook. */
696
797
  type ReturnType = {
697
798
  /** Reusable provider address, when the provider attributed one. */
698
799
  address?: string | undefined
@@ -708,14 +809,14 @@ export declare namespace Webhook {
708
809
  }
709
810
  }
710
811
 
711
- /** A funding provider descriptor and live quote implementation. */
712
- export type Provider<id extends string = string> = core_Provider.Provider<id, 'funding'> & {
713
- /** Provisions a reusable funding deposit address, when supported. */
812
+ /** A route provider descriptor and live quote implementation. */
813
+ export type Provider<id extends string = string> = core_Provider.Provider<id, 'routes'> & {
814
+ /** Provisions a reusable route deposit address, when supported. */
714
815
  createDepositAddress?(
715
816
  input: createDepositAddress.Parameters,
716
817
  signal: AbortSignal,
717
818
  ): Promise<createDepositAddress.ReturnType>
718
- /** Requests a live funding quote. */
819
+ /** Requests a live route quote. */
719
820
  getQuote(input: getQuote.Parameters, signal: AbortSignal): Promise<getQuote.ReturnType>
720
821
  /** Lists requests discovered for a reusable deposit address, when supported. */
721
822
  listDepositAddressRequests?(
@@ -727,7 +828,7 @@ export type Provider<id extends string = string> = core_Provider.Provider<id, 'f
727
828
  input: observeDepositAddressRequest.Parameters,
728
829
  signal: AbortSignal,
729
830
  ): Promise<observeDepositAddressRequest.ReturnType>
730
- /** Prepares an executable funding transfer, when the provider supports it. */
831
+ /** Prepares an executable route transfer, when the provider supports it. */
731
832
  prepareTransfer?(
732
833
  input: prepareTransfer.Parameters,
733
834
  signal: AbortSignal,
@@ -736,6 +837,11 @@ export type Provider<id extends string = string> = core_Provider.Provider<id, 'f
736
837
  validateTransferAction?(
737
838
  input: validateTransferAction.Parameters,
738
839
  ): validateTransferAction.ReturnType
840
+ /** Verifies destination delivery for a registered transfer, when supported. */
841
+ verifyDestinationDelivery?(
842
+ input: verifyDestinationDelivery.Parameters,
843
+ signal: AbortSignal,
844
+ ): Promise<verifyDestinationDelivery.ReturnType>
739
845
  /** Verifies a submitted source transaction, when supported. */
740
846
  verifySourceTransaction?(
741
847
  input: verifySourceTransaction.Parameters,
@@ -745,75 +851,93 @@ export type Provider<id extends string = string> = core_Provider.Provider<id, 'f
745
851
  webhook?: Webhook | undefined
746
852
  }
747
853
 
748
- /** Defines a funding provider from its identity and quote implementation. */
854
+ /** Defines a route provider from its identity and quote implementation. */
749
855
  export function from<const id extends string>(options: from.Options<id>): Provider<id> {
750
856
  if (options.id !== normalizeInput(options.id) || options.id.length === 0)
751
857
  throw new ProviderConfigurationError('Provider ids must be lowercase and trimmed.')
752
- return core_Provider.from({ ...options, type: 'funding' })
858
+ return core_Provider.from({ ...options, type: 'routes' })
753
859
  }
754
860
 
755
861
  export declare namespace from {
756
- /** Funding provider definition. */
862
+ /** Route provider definition. */
757
863
  type Options<id extends string> = Omit<Provider<id>, 'type'>
758
864
  }
759
865
 
760
- /** Narrows a registered provider to a funding provider. */
866
+ /** Narrows a registered provider to a route provider. */
761
867
  export function is(provider: core_Provider.Provider): provider is Provider {
762
868
  return (
763
- provider.type === 'funding' && 'getQuote' in provider && typeof provider.getQuote === 'function'
869
+ provider.type === 'routes' && 'getQuote' in provider && typeof provider.getQuote === 'function'
764
870
  )
765
871
  }
766
872
 
767
- /** Narrows a funding provider to one that prepares executable transfers. */
873
+ /** Narrows a route provider to one that prepares executable transfers. */
768
874
  export function canPrepareTransfer(provider: Provider): provider is Provider & {
769
875
  prepareTransfer: NonNullable<Provider['prepareTransfer']>
770
876
  } {
771
877
  return typeof provider.prepareTransfer === 'function'
772
878
  }
773
879
 
774
- /** Narrows a funding provider to one that provisions reusable deposit addresses. */
880
+ /** Narrows a route provider to one that provisions reusable deposit addresses. */
775
881
  export function canCreateDepositAddress(provider: Provider): provider is Provider & {
776
882
  createDepositAddress: NonNullable<Provider['createDepositAddress']>
777
883
  } {
778
884
  return typeof provider.createDepositAddress === 'function'
779
885
  }
780
886
 
781
- /** Narrows a funding provider to one that tracks reusable deposit addresses. */
887
+ /** Narrows a route provider to one that tracks reusable deposit addresses. */
782
888
  export function canListDepositAddressRequests(provider: Provider): provider is Provider & {
783
889
  listDepositAddressRequests: NonNullable<Provider['listDepositAddressRequests']>
784
890
  } {
785
891
  return typeof provider.listDepositAddressRequests === 'function'
786
892
  }
787
893
 
788
- /** Narrows a funding provider to one that observes reusable-address delivery onchain. */
894
+ /** Narrows a route provider to one that observes reusable-address delivery onchain. */
789
895
  export function canObserveDepositAddressRequest(provider: Provider): provider is Provider & {
790
896
  observeDepositAddressRequest: NonNullable<Provider['observeDepositAddressRequest']>
791
897
  } {
792
898
  return typeof provider.observeDepositAddressRequest === 'function'
793
899
  }
794
900
 
795
- /** Narrows a funding provider to one that verifies submitted source transactions. */
901
+ /** Narrows a route provider to one that reconciles registered transfers. */
902
+ export function canReconcileTransfer(provider: Provider): provider is Provider & {
903
+ verifyDestinationDelivery: NonNullable<Provider['verifyDestinationDelivery']>
904
+ verifySourceTransaction: NonNullable<Provider['verifySourceTransaction']>
905
+ } {
906
+ return (
907
+ typeof provider.verifyDestinationDelivery === 'function' &&
908
+ typeof provider.verifySourceTransaction === 'function'
909
+ )
910
+ }
911
+
912
+ /** Narrows a route provider to one that verifies submitted source transactions. */
796
913
  export function canVerifySourceTransaction(provider: Provider): provider is Provider & {
797
914
  verifySourceTransaction: NonNullable<Provider['verifySourceTransaction']>
798
915
  } {
799
916
  return typeof provider.verifySourceTransaction === 'function'
800
917
  }
801
918
 
802
- /** Narrows a funding provider to one with authenticated webhook receipt. */
919
+ /** Narrows a route provider to one with authenticated webhook receipt. */
803
920
  export function canReceiveWebhook(provider: Provider): provider is Provider & {
804
921
  webhook: Webhook
805
922
  } {
806
923
  return provider.webhook !== undefined
807
924
  }
808
925
 
809
- /** Funding provider method recorded by request diagnostics. */
926
+ /** Route provider method recorded by operational telemetry. */
810
927
  export type ProviderOperation =
811
928
  | 'createDepositAddress'
812
929
  | 'getQuote'
813
930
  | 'listDepositAddressRequests'
931
+ | 'observeDepositAddressRequest'
814
932
  | 'prepareTransfer'
933
+ | 'receiveWebhook'
934
+ | 'verifyDestinationDelivery'
935
+ | 'verifySourceTransaction'
936
+
937
+ /** Route provider identity retained by bounded operation telemetry. */
938
+ export type ProviderIdentity = Pick<Provider, 'id'>
815
939
 
816
- /** One provider attempt made while resolving a funding quote request. */
940
+ /** One timed route provider operation. */
817
941
  export type ProviderAttempt =
818
942
  | {
819
943
  /** Wall-clock duration of the provider attempt in milliseconds. */
@@ -821,9 +945,9 @@ export type ProviderAttempt =
821
945
  /** Provider method invoked by the attempt. */
822
946
  operation: ProviderOperation
823
947
  /** Successful or expected-unavailable provider outcome. */
824
- outcome: 'available' | 'thin' | 'unavailable'
825
- /** Provider that handled the quote candidate. */
826
- provider: Provider
948
+ outcome: 'available' | 'success' | 'thin' | 'unavailable'
949
+ /** Provider that handled the operation. */
950
+ provider: ProviderIdentity
827
951
  }
828
952
  | {
829
953
  /** Error thrown by the provider boundary. */
@@ -834,8 +958,8 @@ export type ProviderAttempt =
834
958
  operation: ProviderOperation
835
959
  /** Failed provider outcome. */
836
960
  outcome: 'failed'
837
- /** Provider that handled the quote candidate. */
838
- provider: Provider
961
+ /** Provider that handled the operation. */
962
+ provider: ProviderIdentity
839
963
  }
840
964
 
841
965
  /** Bounded result for one provider attempt. */
@@ -859,7 +983,52 @@ export type ProviderFailure = {
859
983
  /** Provider method that failed. */
860
984
  operation: ProviderOperation
861
985
  /** Provider that failed. */
862
- provider: Provider
986
+ provider: ProviderIdentity
987
+ }
988
+
989
+ /** Observes one provider operation without changing its result. */
990
+ export async function observe<const result>(
991
+ provider: ProviderIdentity,
992
+ fn: () => Promise<result>,
993
+ options: observe.Options,
994
+ ): Promise<result> {
995
+ const start = performance.now()
996
+ const report = (attempt: ProviderAttempt) => {
997
+ try {
998
+ options.onAttempt(formatAttempt(attempt))
999
+ } catch {
1000
+ // Observability hooks never alter provider behavior.
1001
+ }
1002
+ }
1003
+ try {
1004
+ const value = await fn()
1005
+ report({
1006
+ durationMs: performance.now() - start,
1007
+ operation: options.operation,
1008
+ outcome: 'success',
1009
+ provider,
1010
+ })
1011
+ return value
1012
+ } catch (cause) {
1013
+ report({
1014
+ cause,
1015
+ durationMs: performance.now() - start,
1016
+ operation: options.operation,
1017
+ outcome: 'failed',
1018
+ provider,
1019
+ })
1020
+ throw cause
1021
+ }
1022
+ }
1023
+
1024
+ export declare namespace observe {
1025
+ /** Provider operation observation configuration. */
1026
+ type Options = {
1027
+ /** Receives the bounded provider operation result. */
1028
+ onAttempt: (result: ProviderAttemptResult) => void
1029
+ /** Stable provider method identifier. */
1030
+ operation: ProviderOperation
1031
+ }
863
1032
  }
864
1033
 
865
1034
  // Slow provider responses can still contain valid quotes; keep the boundary
@@ -890,14 +1059,14 @@ export function getChains(options: getChains.Options) {
890
1059
  export declare namespace getChains {
891
1060
  /** Options for getting provider-supported source chains. */
892
1061
  type Options = {
893
- /** Compiled funding catalog containing provider routes. */
1062
+ /** Compiled route catalog containing provider routes. */
894
1063
  catalog: core_Catalog.Snapshot
895
1064
  /** Providers whose routes contribute source chains and tokens. */
896
1065
  providers: readonly Provider[]
897
1066
  }
898
1067
  }
899
1068
 
900
- /** Returns the supplied funding quote providers. */
1069
+ /** Returns the supplied route quote providers. */
901
1070
  export function getProviders(options: getProviders.Options) {
902
1071
  return options.providers
903
1072
  .filter((provider) => (options.catalog.routesByProvider.get(provider.id)?.length ?? 0) > 0)
@@ -907,14 +1076,14 @@ export function getProviders(options: getProviders.Options) {
907
1076
  export declare namespace getProviders {
908
1077
  /** Options for getting providers. */
909
1078
  type Options = {
910
- /** Compiled funding catalog containing provider routes. */
1079
+ /** Compiled route catalog containing provider routes. */
911
1080
  catalog: core_Catalog.Snapshot
912
- /** Funding providers included in this deployment. */
1081
+ /** Route providers included in this deployment. */
913
1082
  providers: readonly Provider[]
914
1083
  }
915
1084
  }
916
1085
 
917
- /** Returns successful live funding quotes from the supplied providers. */
1086
+ /** Returns successful live route quotes from the supplied providers. */
918
1087
  export async function getQuotes(options: getQuotes.Options) {
919
1088
  const providers = options.providers ?? []
920
1089
  const operation = 'getQuote' satisfies ProviderOperation
@@ -930,7 +1099,9 @@ export async function getQuotes(options: getQuotes.Options) {
930
1099
  const result = await quoteCandidate(candidate, {
931
1100
  cache: options.cache ?? { bypass: false },
932
1101
  provider,
1102
+ quotaKey: options.quotaKey ?? 'public:anonymous',
933
1103
  request: {
1104
+ destinationChain: options.destinationChain,
934
1105
  destinationToken: options.destinationToken,
935
1106
  provider: options.provider,
936
1107
  sourceAmount: options.sourceAmount,
@@ -967,7 +1138,7 @@ export async function getQuotes(options: getQuotes.Options) {
967
1138
  try {
968
1139
  options.onAttempt?.(attempt)
969
1140
  } catch {
970
- // Observability hooks never alter funding quote behavior.
1141
+ // Observability hooks never alter route quote behavior.
971
1142
  }
972
1143
  }
973
1144
  const quotes = results.flatMap((result) =>
@@ -984,6 +1155,37 @@ export async function getQuotes(options: getQuotes.Options) {
984
1155
  ]
985
1156
  : [],
986
1157
  )
1158
+ const outcome = (() => {
1159
+ if (quotes.length > 0) return 'available'
1160
+ if (candidates.length === 0) return 'unsupported'
1161
+ if (failures.length > 0) return 'failed'
1162
+ return 'unavailable'
1163
+ })()
1164
+ try {
1165
+ options.onResult?.({
1166
+ candidateCount: candidates.length,
1167
+ outcome,
1168
+ quotes: quotes.map((quote) => {
1169
+ const ageMs = Date.now() - Date.parse(quote.quote.sampledAt)
1170
+ const customerValueLossBps = Economics.differenceBps({
1171
+ reference: quote.sourceAmount,
1172
+ value: quote.destinationAmount,
1173
+ })
1174
+ return {
1175
+ ageMs: Math.max(0, ageMs),
1176
+ ...(customerValueLossBps === undefined ? {} : { customerValueLossBps }),
1177
+ destinationChain: quote.destinationChain.id,
1178
+ destinationToken: quote.destinationToken.tokenKey,
1179
+ futureSkewMs: Math.max(0, -ageMs),
1180
+ provider: quote.provider.id,
1181
+ sourceChain: quote.sourceChain.id,
1182
+ sourceToken: quote.sourceToken.tokenKey,
1183
+ }
1184
+ }),
1185
+ })
1186
+ } catch {
1187
+ // Reliability telemetry never alters route quote behavior.
1188
+ }
987
1189
  if (quotes.length === 0 && failures.length > 0) throw new ProviderQuoteError(failures, values)
988
1190
  return quotes
989
1191
  }
@@ -997,7 +1199,8 @@ export function getQuoteCandidates(options: getQuoteCandidates.Options) {
997
1199
  if (!amount.success) throw new InvalidAmountError()
998
1200
  const sourceChain = resolveSourceChain(options.sourceChain, catalog)
999
1201
  const sourceToken = resolveSourceToken(sourceChain, options.sourceToken, catalog)
1000
- const destination = resolveDestinationToken(options.destinationToken, catalog)
1202
+ const destinationChain = resolveDestinationChain(options.destinationChain ?? 'tempo', catalog)
1203
+ const destination = resolveDestinationToken(destinationChain, options.destinationToken, catalog)
1001
1204
  const provider = options.provider ? resolveProvider(options.provider, providers) : undefined
1002
1205
 
1003
1206
  if (providers.length === 0) return []
@@ -1028,22 +1231,26 @@ export function getQuoteCandidates(options: getQuoteCandidates.Options) {
1028
1231
  }
1029
1232
 
1030
1233
  export declare namespace getQuoteCandidates {
1031
- /** Options for selecting funding quote candidates. */
1234
+ /** Options for selecting route quote candidates. */
1032
1235
  type Options = QuoteRequest & {
1033
- /** Compiled funding catalog containing provider routes. */
1236
+ /** Compiled route catalog containing provider routes. */
1034
1237
  catalog: core_Catalog.Snapshot
1035
- /** Funding providers considered by the request. */
1238
+ /** Route providers considered by the request. */
1036
1239
  providers: readonly Provider[]
1037
1240
  }
1038
1241
  }
1039
1242
 
1040
1243
  export declare namespace getQuotes {
1041
- /** Options for requesting live funding quotes. */
1244
+ /** Options for requesting live route quotes. */
1042
1245
  type Options = getQuoteCandidates.Options & {
1043
1246
  /** Cache policy for provider-side discovery and quote lookups. */
1044
1247
  cache?: CachePolicy | undefined
1045
1248
  /** Receives one bounded observation for every provider attempt. */
1046
1249
  onAttempt?: ((attempt: ProviderAttempt) => void) | undefined
1250
+ /** Receives the bounded request-level quote result. */
1251
+ onResult?: ((result: QuoteRequestResult) => void) | undefined
1252
+ /** Stable non-secret tenant identity for provider-local fairness. */
1253
+ quotaKey?: string | undefined
1047
1254
  /** Per-provider quote timeout in milliseconds. */
1048
1255
  providerTimeoutMs?: number | undefined
1049
1256
  }
@@ -1063,18 +1270,8 @@ export async function createDepositAddress(
1063
1270
  ): Promise<createDepositAddress.Selection | undefined> {
1064
1271
  const operation = 'createDepositAddress' satisfies ProviderOperation
1065
1272
  if (!schema.PositiveInteger.safeParse(options.amount).success) throw new InvalidAmountError()
1066
- const candidates = getDepositAddressCandidates(options).sort((a, b) =>
1067
- a.provider.id.localeCompare(b.provider.id),
1068
- )
1069
- const selected = candidates[0]
1273
+ const selected = selectDepositAddress(options)
1070
1274
  if (!selected) return undefined
1071
- const recipient = normalizeAccountAddress(options.recipient, selected.candidate.destinationChain)
1072
- const refundAddress = normalizeAccountAddress(
1073
- options.refundAddress,
1074
- selected.candidate.sourceChain,
1075
- )
1076
- if (!recipient) throw new ProviderPayloadError()
1077
- if (!refundAddress) throw new InvalidRefundAddressError()
1078
1275
 
1079
1276
  const start = performance.now()
1080
1277
  try {
@@ -1085,8 +1282,8 @@ export async function createDepositAddress(
1085
1282
  {
1086
1283
  amount: options.amount,
1087
1284
  candidate: selected.candidate,
1088
- recipient,
1089
- refundAddress,
1285
+ recipient: selected.recipient,
1286
+ refundAddress: selected.refundAddress,
1090
1287
  subsidize: options.subsidize,
1091
1288
  },
1092
1289
  signal,
@@ -1113,7 +1310,7 @@ export async function createDepositAddress(
1113
1310
  } catch {
1114
1311
  // Observability hooks never alter provisioning behavior.
1115
1312
  }
1116
- return { ...selected, recipient, refundAddress, result }
1313
+ return { ...selected, result }
1117
1314
  } catch (cause) {
1118
1315
  const attempt: ProviderAttempt =
1119
1316
  cause instanceof ProviderUnavailableError
@@ -1140,6 +1337,47 @@ export async function createDepositAddress(
1140
1337
  }
1141
1338
  }
1142
1339
 
1340
+ /** Selects and normalizes the deterministic reusable-address route without provisioning it. */
1341
+ export function selectDepositAddress(
1342
+ options: selectDepositAddress.Options,
1343
+ ): selectDepositAddress.Result | undefined {
1344
+ const candidates = getDepositAddressCandidates(options).sort((a, b) =>
1345
+ a.provider.id.localeCompare(b.provider.id),
1346
+ )
1347
+ const selected = candidates[0]
1348
+ if (!selected) return undefined
1349
+ const recipient = normalizeAccountAddress(options.recipient, selected.candidate.destinationChain)
1350
+ const refundAddress = normalizeAccountAddress(
1351
+ options.refundAddress,
1352
+ selected.candidate.sourceChain,
1353
+ )
1354
+ if (!recipient) throw new ProviderPayloadError()
1355
+ if (!refundAddress) throw new InvalidRefundAddressError()
1356
+ return { ...selected, recipient, refundAddress }
1357
+ }
1358
+
1359
+ export declare namespace selectDepositAddress {
1360
+ /** Route and accounts used to select one reusable-address provider. */
1361
+ type Options = getDepositAddressCandidates.Options & {
1362
+ /** Final beneficiary on Tempo. */
1363
+ recipient: string
1364
+ /** Source-chain account that receives refunds. */
1365
+ refundAddress: string
1366
+ }
1367
+
1368
+ /** Deterministic provider route with normalized accounts. */
1369
+ type Result = {
1370
+ /** Curated reusable-address route selected for provisioning. */
1371
+ candidate: DepositAddressCandidate
1372
+ /** Provider selected for the reusable address. */
1373
+ provider: ReturnType<typeof getDepositAddressCandidates>[number]['provider']
1374
+ /** Normalized final beneficiary on Tempo. */
1375
+ recipient: string
1376
+ /** Normalized source-chain refund account. */
1377
+ refundAddress: string
1378
+ }
1379
+ }
1380
+
1143
1381
  export declare namespace createDepositAddress {
1144
1382
  /** Options for provisioning one reusable deposit address. */
1145
1383
  type Options = getDepositAddressCandidates.Options & {
@@ -1184,6 +1422,11 @@ export async function prepareTransfer(
1184
1422
  const operation = 'prepareTransfer' satisfies ProviderOperation
1185
1423
  const candidates = getPrepareCandidates(options)
1186
1424
  if (candidates.length === 0) return undefined
1425
+ const first = candidates[0]!
1426
+ const recipient = normalizeAccountAddress(options.recipient, first.candidate.destinationChain)
1427
+ if (!recipient) throw new InvalidRecipientAddressError()
1428
+ const sender = normalizeAccountAddress(options.sender, first.candidate.sourceChain)
1429
+ if (!sender) throw new InvalidSenderAddressError()
1187
1430
 
1188
1431
  const attempts: ProviderAttempt[] = []
1189
1432
  const results = await Promise.allSettled(
@@ -1194,8 +1437,8 @@ export async function prepareTransfer(
1194
1437
  candidate,
1195
1438
  method: options.method,
1196
1439
  mode: options.mode,
1197
- recipient: options.recipient,
1198
- sender: options.sender,
1440
+ recipient,
1441
+ sender,
1199
1442
  slippageBps: options.slippageBps,
1200
1443
  }
1201
1444
  const parsed = schema.PrepareResult.safeParse(
@@ -1226,12 +1469,14 @@ export async function prepareTransfer(
1226
1469
  const constraints = provider.validateTransferAction?.({
1227
1470
  ...parameters,
1228
1471
  action: result.action,
1472
+ destinationAmountMin: result.destinationAmountMin,
1229
1473
  })
1230
1474
  Action.validateEvmCalls({
1231
1475
  action: result.action,
1232
1476
  nativeValues: constraints?.nativeValues,
1233
1477
  sourceAmount: candidate.sourceAmount.amount,
1234
1478
  sourceTokenAddress: candidate.sourceToken.address,
1479
+ tokenApprovals: constraints?.tokenApprovals,
1235
1480
  })
1236
1481
  } catch (cause) {
1237
1482
  if (cause instanceof Action.InvalidActionError) throw new ProviderPayloadError()
@@ -1297,7 +1542,19 @@ export async function prepareTransfer(
1297
1542
  if (delta !== 0n) return delta > 0n ? 1 : -1
1298
1543
  return a.provider.id < b.provider.id ? -1 : 1
1299
1544
  })
1300
- return prepared[0]!
1545
+ const selected = prepared[0]!
1546
+ const bestDestinationAmount = prepared.reduce(
1547
+ (best, entry) =>
1548
+ BigInt(entry.result.destinationAmount) > BigInt(best) ? entry.result.destinationAmount : best,
1549
+ selected.result.destinationAmount,
1550
+ )
1551
+ return {
1552
+ ...selected,
1553
+ bestDestinationAmount,
1554
+ preparedCount: prepared.length,
1555
+ recipient,
1556
+ sender,
1557
+ }
1301
1558
  }
1302
1559
 
1303
1560
  export declare namespace prepareTransfer {
@@ -1309,7 +1566,7 @@ export declare namespace prepareTransfer {
1309
1566
  providerTimeoutMs?: number | undefined
1310
1567
  /** Final beneficiary on the destination chain. */
1311
1568
  recipient: string
1312
- /** Source-chain account that signs the funding action. */
1569
+ /** Source-chain account that signs the route action. */
1313
1570
  sender: string
1314
1571
  /** Caller slippage bound in basis points. */
1315
1572
  slippageBps?: number | undefined
@@ -1317,12 +1574,20 @@ export declare namespace prepareTransfer {
1317
1574
 
1318
1575
  /** The selected preparation with a guaranteed expiry. */
1319
1576
  type Selection = {
1577
+ /** Highest expected destination amount returned by a successful candidate. */
1578
+ bestDestinationAmount: string
1320
1579
  /** Curated candidate the preparation was produced for. */
1321
1580
  candidate: QuoteCandidate
1581
+ /** Number of successful preparations considered for automatic selection. */
1582
+ preparedCount: number
1322
1583
  /** Provider that produced the selected preparation. */
1323
1584
  provider: Provider
1585
+ /** Normalized final beneficiary on the destination chain. */
1586
+ recipient: string
1324
1587
  /** The preparation, with a default expiry applied when the provider gave none. */
1325
1588
  result: prepareTransfer.ReturnType & { expiresAt: string }
1589
+ /** Normalized source-chain account that signs the route action. */
1590
+ sender: string
1326
1591
  }
1327
1592
  }
1328
1593
 
@@ -1358,13 +1623,13 @@ export function getDepositAddressCandidates(options: getDepositAddressCandidates
1358
1623
  export declare namespace getDepositAddressCandidates {
1359
1624
  /** Options for selecting reusable deposit-address routes. */
1360
1625
  type Options = {
1361
- /** Compiled funding catalog containing provider routes and capabilities. */
1626
+ /** Compiled route catalog containing provider routes and capabilities. */
1362
1627
  catalog: core_Catalog.Snapshot
1363
1628
  /** Tempo destination chain selected by app composition. */
1364
1629
  destinationChainId: number
1365
1630
  /** Tempo destination token symbol, contract address, or token key. */
1366
1631
  destinationToken: string
1367
- /** Funding providers considered by the request. */
1632
+ /** Route providers considered by the request. */
1368
1633
  providers: readonly Provider[]
1369
1634
  /** Source chain CAIP-2 id, slug, or alias. */
1370
1635
  sourceChain: string
@@ -1382,14 +1647,14 @@ export function getPrepareCandidates(options: getPrepareCandidates.Options) {
1382
1647
  const amount = schema.PositiveInteger.safeParse(options.sourceAmount)
1383
1648
  if (!amount.success) throw new InvalidAmountError()
1384
1649
  const sourceChain = resolveSourceChain(options.sourceChain, options.catalog)
1385
- const destinationChainId = `eip155:${options.destinationChainId}`
1650
+ const destinationChain = resolveDestinationChain(options.destinationChain, options.catalog)
1386
1651
  const selectedProvider = options.provider
1387
1652
  ? resolveProvider(options.provider, options.providers)
1388
1653
  : undefined
1389
1654
 
1390
1655
  return options.catalog.routes.flatMap((entry) => {
1391
1656
  if (entry.route.source.chain.id !== sourceChain.id) return []
1392
- if (entry.route.destination.chain.id !== destinationChainId) return []
1657
+ if (entry.route.destination.chain.id !== destinationChain.id) return []
1393
1658
  if (!matchesToken(entry.route.source, options.sourceToken)) return []
1394
1659
  if (!matchesToken(entry.route.destination, options.destinationToken)) return []
1395
1660
  if (!entry.capabilities?.transfer?.modes.includes(options.mode)) return []
@@ -1419,19 +1684,19 @@ export function getPrepareCandidates(options: getPrepareCandidates.Options) {
1419
1684
  export declare namespace getPrepareCandidates {
1420
1685
  /** Options for selecting preparation candidates. */
1421
1686
  type Options = {
1422
- /** Compiled funding catalog containing provider routes and capabilities. */
1687
+ /** Compiled route catalog containing provider routes and capabilities. */
1423
1688
  catalog: core_Catalog.Snapshot
1424
- /** Tempo destination chain selected by app composition. */
1425
- destinationChainId: number
1426
- /** Tempo destination token symbol, contract address, or token key. */
1689
+ /** Destination chain CAIP-2 id, slug, or alias. */
1690
+ destinationChain: string
1691
+ /** Destination token symbol, contract address, or token key. */
1427
1692
  destinationToken: string
1428
- /** Funding method passed to provider preparation. */
1693
+ /** Route method passed to provider preparation. */
1429
1694
  method: Transfer.Method
1430
1695
  /** Amount mode the caller selected. */
1431
1696
  mode: Transfer.Mode
1432
- /** Funding provider ID selected by the caller. */
1697
+ /** Route provider ID selected by the caller. */
1433
1698
  provider?: string | undefined
1434
- /** Funding providers considered by the request. */
1699
+ /** Route providers considered by the request. */
1435
1700
  providers: readonly Provider[]
1436
1701
  /** Source amount in base units. */
1437
1702
  sourceAmount: string
@@ -1442,15 +1707,17 @@ export declare namespace getPrepareCandidates {
1442
1707
  }
1443
1708
  }
1444
1709
 
1445
- /** Source amount unit accepted by the funding quote request. */
1710
+ /** Source amount unit accepted by the route quote request. */
1446
1711
  export type SourceAmountUnits = z.output<typeof schema.SourceAmountUnits>
1447
1712
 
1448
- /** Fetch implementation accepted by funding provider factories. */
1713
+ /** Fetch implementation accepted by route provider factories. */
1449
1714
  export type Fetch = typeof globalThis.fetch
1450
1715
 
1451
1716
  /** Returns bounded provider failure details suitable for structured request logs. */
1452
1717
  export function failure(options: ProviderFailure): failure.Result {
1453
1718
  const { cause, operation, provider } = options
1719
+ const rpc = Viem.requestFailure(cause)
1720
+ if (rpc) return { ...rpc, id: provider.id, operation }
1454
1721
  if (
1455
1722
  cause instanceof ProviderTimeoutError ||
1456
1723
  (cause instanceof DOMException && cause.name === 'AbortError')
@@ -1466,7 +1733,11 @@ export function failure(options: ProviderFailure): failure.Result {
1466
1733
  status: cause.status,
1467
1734
  }
1468
1735
  }
1469
- if (cause instanceof ProviderPayloadError)
1736
+ if (
1737
+ cause instanceof ProviderPayloadError ||
1738
+ cause instanceof WebhookAuthenticationError ||
1739
+ cause instanceof WebhookPayloadError
1740
+ )
1470
1741
  return { failure: 'payload', id: provider.id, operation }
1471
1742
  if (cause instanceof ProviderRateLimitError)
1472
1743
  return { failure: 'rate_limit', id: provider.id, operation }
@@ -1477,12 +1748,16 @@ export function failure(options: ProviderFailure): failure.Result {
1477
1748
  export declare namespace failure {
1478
1749
  /** Bounded provider failure fields. */
1479
1750
  type Result = {
1751
+ /** EIP-155 chain whose RPC request failed. */
1752
+ chainId?: number | undefined
1480
1753
  /** Stable provider error code, when one is safe to retain. */
1481
1754
  code?: string | undefined
1482
1755
  /** Failure boundary that rejected the provider request. */
1483
- failure: 'http' | 'network' | 'payload' | 'rate_limit' | 'timeout' | 'unknown'
1756
+ failure: 'http' | 'network' | 'payload' | 'query' | 'rate_limit' | 'timeout' | 'unknown'
1484
1757
  /** Provider identifier. */
1485
1758
  id: string
1759
+ /** Upstream error message, when one was returned. */
1760
+ message?: string | undefined
1486
1761
  /** Provider operation identifier. */
1487
1762
  operation: ProviderOperation
1488
1763
  /** Upstream HTTP status, when a response was received. */
@@ -1580,6 +1855,7 @@ async function quoteCandidate(
1580
1855
  options: {
1581
1856
  cache: CachePolicy
1582
1857
  provider: Provider
1858
+ quotaKey: string
1583
1859
  request: QuoteRequest
1584
1860
  timeoutMs: number
1585
1861
  },
@@ -1593,6 +1869,7 @@ async function quoteCandidate(
1593
1869
  cache: options.cache,
1594
1870
  destinationChain: candidate.destinationChain,
1595
1871
  destinationToken: candidate.destinationToken,
1872
+ quotaKey: options.quotaKey,
1596
1873
  request: options.request,
1597
1874
  route: candidate.route,
1598
1875
  sourceAmount: candidate.sourceAmount,
@@ -1731,8 +2008,8 @@ type SuccessfulQuoteResult = getQuote.ReturnType & {
1731
2008
  status: 'available' | 'thin'
1732
2009
  }
1733
2010
 
1734
- function createQuote(candidate: QuoteCandidate, quote: SuccessfulQuoteResult): FundingQuote {
1735
- return schema.FundingQuote.parse({
2011
+ function createQuote(candidate: QuoteCandidate, quote: SuccessfulQuoteResult): RoutesQuote {
2012
+ return schema.RoutesQuote.parse({
1736
2013
  destinationAmount: Value.tokenAmount({
1737
2014
  baseUnits: quote.destinationAmount,
1738
2015
  currency: candidate.destinationToken.currency,
@@ -1755,10 +2032,6 @@ function createQuote(candidate: QuoteCandidate, quote: SuccessfulQuoteResult): F
1755
2032
  ...(quote.quality?.estimatedSeconds !== undefined
1756
2033
  ? { estimatedSeconds: quote.quality.estimatedSeconds }
1757
2034
  : {}),
1758
- liquiditySource: quote.quality?.liquiditySource ?? 'providerQuote',
1759
- ...(quote.quality?.sourceDetail !== undefined
1760
- ? { sourceDetail: quote.quality.sourceDetail }
1761
- : {}),
1762
2035
  tier: quote.status === 'thin' ? ('thin' as const) : ('liquid' as const),
1763
2036
  },
1764
2037
  quote: {
@@ -1809,7 +2082,8 @@ function errorCode(input: unknown) {
1809
2082
  return parsed.success ? parsed.data : undefined
1810
2083
  }
1811
2084
 
1812
- function attemptResult(attempt: ProviderAttempt): ProviderAttemptResult {
2085
+ /** Formats one provider attempt for logs and aggregate metrics. */
2086
+ export function formatAttempt(attempt: ProviderAttempt): ProviderAttemptResult {
1813
2087
  return {
1814
2088
  durationMs: attempt.durationMs,
1815
2089
  ...(attempt.outcome === 'failed'
@@ -1827,9 +2101,23 @@ function attemptResult(attempt: ProviderAttempt): ProviderAttemptResult {
1827
2101
  }
1828
2102
  }
1829
2103
 
1830
- function resolveDestinationToken(input: string | undefined, catalog: core_Catalog.Snapshot) {
2104
+ function resolveDestinationChain(input: string, catalog: core_Catalog.Snapshot) {
2105
+ const normalized = normalizeInput(input)
2106
+ const chain = catalog.chainsByKey.get(normalized)
2107
+ if (!chain || !catalog.routes.some((entry) => entry.route.destination.chain.id === chain.id))
2108
+ throw new UnsupportedDestinationChainError()
2109
+ return chain
2110
+ }
2111
+
2112
+ function resolveDestinationToken(
2113
+ chain: Chain,
2114
+ input: string | undefined,
2115
+ catalog: core_Catalog.Snapshot,
2116
+ ) {
1831
2117
  const destinations = uniqueBy(
1832
- catalog.routes.map((entry) => entry.route.destination),
2118
+ catalog.routes
2119
+ .filter((entry) => entry.route.destination.chain.id === chain.id)
2120
+ .map((entry) => entry.route.destination),
1833
2121
  (token) => `${token.chain.id}:${token.address}`,
1834
2122
  )
1835
2123
  if (input === undefined) {
@@ -1933,59 +2221,74 @@ function normalizeAccountAddress(value: string, chain: ChainRef): string | undef
1933
2221
  }
1934
2222
  }
1935
2223
 
2224
+ /** Error thrown when the caller supplies an unsupported destination chain. */
2225
+ export class UnsupportedDestinationChainError extends Error {
2226
+ override name = 'RoutesProvider.UnsupportedDestinationChainError'
2227
+ }
2228
+
1936
2229
  /** Error thrown when the caller supplies an unsupported destination token. */
1937
2230
  export class UnsupportedDestinationTokenError extends Error {
1938
- override name = 'FundingProvider.UnsupportedDestinationTokenError'
2231
+ override name = 'RoutesProvider.UnsupportedDestinationTokenError'
1939
2232
  }
1940
2233
 
1941
2234
  /** Error thrown when a provider webhook cannot be authenticated. */
1942
2235
  export class WebhookAuthenticationError extends Error {
1943
- override name = 'FundingProvider.WebhookAuthenticationError'
2236
+ override name = 'RoutesProvider.WebhookAuthenticationError'
1944
2237
  }
1945
2238
 
1946
2239
  /** Error thrown when an authenticated provider webhook has an invalid body. */
1947
2240
  export class WebhookPayloadError extends Error {
1948
- override name = 'FundingProvider.WebhookPayloadError'
2241
+ override name = 'RoutesProvider.WebhookPayloadError'
1949
2242
  }
1950
2243
 
1951
2244
  /** Error thrown when the caller supplies an invalid source amount. */
1952
2245
  export class InvalidAmountError extends Error {
1953
- override name = 'FundingProvider.InvalidAmountError'
2246
+ override name = 'RoutesProvider.InvalidAmountError'
1954
2247
  }
1955
2248
 
1956
2249
  /** Error thrown when the caller supplies an invalid source-chain refund address. */
1957
2250
  export class InvalidRefundAddressError extends Error {
1958
- override name = 'FundingProvider.InvalidRefundAddressError'
2251
+ override name = 'RoutesProvider.InvalidRefundAddressError'
2252
+ }
2253
+
2254
+ /** Error thrown when the caller supplies an invalid destination-chain recipient. */
2255
+ export class InvalidRecipientAddressError extends Error {
2256
+ override name = 'RoutesProvider.InvalidRecipientAddressError'
2257
+ }
2258
+
2259
+ /** Error thrown when the caller supplies an invalid source-chain sender. */
2260
+ export class InvalidSenderAddressError extends Error {
2261
+ override name = 'RoutesProvider.InvalidSenderAddressError'
1959
2262
  }
1960
2263
 
1961
2264
  /** Error thrown when provider deployment configuration is invalid. */
1962
2265
  export class ProviderConfigurationError extends Error {
1963
- override name = 'FundingProvider.ProviderConfigurationError'
2266
+ override name = 'RoutesProvider.ProviderConfigurationError'
1964
2267
  }
1965
2268
 
1966
2269
  /** Error thrown when a provider response does not match the requested quote. */
1967
2270
  export class ProviderPayloadError extends Error {
1968
- override name = 'FundingProvider.ProviderPayloadError'
2271
+ override name = 'RoutesProvider.ProviderPayloadError'
1969
2272
  }
1970
2273
 
1971
2274
  /** Error thrown when a provider confirms that no executable route is available. */
1972
2275
  export class ProviderUnavailableError extends Error {
1973
- override name = 'FundingProvider.ProviderUnavailableError'
2276
+ override name = 'RoutesProvider.ProviderUnavailableError'
1974
2277
  }
1975
2278
 
1976
2279
  /** Error thrown internally when a provider exceeds its quote timeout. */
1977
2280
  export class ProviderTimeoutError extends Error {
1978
- override name = 'FundingProvider.ProviderTimeoutError'
2281
+ override name = 'RoutesProvider.ProviderTimeoutError'
1979
2282
  }
1980
2283
 
1981
2284
  /** Error thrown when an internal provider quota rejects a quote request. */
1982
2285
  export class ProviderRateLimitError extends Error {
1983
- override name = 'FundingProvider.ProviderRateLimitError'
2286
+ override name = 'RoutesProvider.ProviderRateLimitError'
1984
2287
  }
1985
2288
 
1986
2289
  /** Error thrown when a provider returns an unsuccessful HTTP response. */
1987
2290
  export class ProviderResponseError extends Error {
1988
- override name = 'FundingProvider.ProviderResponseError'
2291
+ override name = 'RoutesProvider.ProviderResponseError'
1989
2292
 
1990
2293
  constructor(
1991
2294
  /** Provider response status. */
@@ -1999,13 +2302,13 @@ export class ProviderResponseError extends Error {
1999
2302
 
2000
2303
  /** Error thrown when every matching provider fails to produce a quote. */
2001
2304
  export class ProviderQuoteError extends Error {
2002
- override name = 'FundingProvider.ProviderQuoteError'
2305
+ override name = 'RoutesProvider.ProviderQuoteError'
2003
2306
 
2004
2307
  /** Provider failures that prevented a successful quote. */
2005
2308
  failures: readonly ProviderFailure[]
2006
2309
 
2007
2310
  /** Bounded provider attempts retained for request logs. */
2008
- fundingProviderAttempts: readonly ProviderAttemptResult[]
2311
+ routesProviderAttempts: readonly ProviderAttemptResult[]
2009
2312
 
2010
2313
  /** First bounded provider failure retained for request logs. */
2011
2314
  providerFailure?: failure.Result | undefined
@@ -2016,7 +2319,7 @@ export class ProviderQuoteError extends Error {
2016
2319
  constructor(failures: readonly ProviderFailure[], attempts: readonly ProviderAttempt[] = []) {
2017
2320
  super()
2018
2321
  this.failures = failures
2019
- this.fundingProviderAttempts = attempts.map(attemptResult)
2322
+ this.routesProviderAttempts = attempts.map(formatAttempt)
2020
2323
  const values = failures.map(failure)
2021
2324
  const first = values[0]
2022
2325
  if (first) this.providerFailure = first
@@ -2026,10 +2329,10 @@ export class ProviderQuoteError extends Error {
2026
2329
 
2027
2330
  /** Error thrown when the caller filters to an unknown provider. */
2028
2331
  export class UnsupportedProviderError extends Error {
2029
- override name = 'FundingProvider.UnsupportedProviderError'
2332
+ override name = 'RoutesProvider.UnsupportedProviderError'
2030
2333
  }
2031
2334
 
2032
2335
  /** Error thrown when the caller supplies an unsupported source chain. */
2033
2336
  export class UnsupportedSourceChainError extends Error {
2034
- override name = 'FundingProvider.UnsupportedSourceChainError'
2337
+ override name = 'RoutesProvider.UnsupportedSourceChainError'
2035
2338
  }