tapimo 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/dist/App.d.ts +11333 -9563
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +39 -3
  4. package/dist/App.js.map +1 -1
  5. package/dist/Scope.d.ts +2 -0
  6. package/dist/Scope.d.ts.map +1 -1
  7. package/dist/Scope.js +17 -0
  8. package/dist/Scope.js.map +1 -1
  9. package/dist/Webhooks.js +2 -2
  10. package/dist/Webhooks.js.map +1 -1
  11. package/dist/admin/App.d.ts +1064 -924
  12. package/dist/admin/App.d.ts.map +1 -1
  13. package/dist/admin/apps/api-keys.d.ts +80 -0
  14. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  15. package/dist/admin/apps/api-keys.js +54 -0
  16. package/dist/admin/apps/api-keys.js.map +1 -1
  17. package/dist/admin/apps/earn-vaults.d.ts +63 -15
  18. package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
  19. package/dist/admin/apps/earn-vaults.js +2 -1
  20. package/dist/admin/apps/earn-vaults.js.map +1 -1
  21. package/dist/admin/apps/organizations.d.ts +92 -3
  22. package/dist/admin/apps/organizations.d.ts.map +1 -1
  23. package/dist/admin/apps/organizations.js +69 -7
  24. package/dist/admin/apps/organizations.js.map +1 -1
  25. package/dist/admin/apps/verified-tokens.d.ts +7 -7
  26. package/dist/admin/ui.generated.d.ts +1 -1
  27. package/dist/admin/ui.generated.d.ts.map +1 -1
  28. package/dist/admin/ui.generated.js +151 -151
  29. package/dist/admin/ui.generated.js.map +1 -1
  30. package/dist/apps/Zones.d.ts +28 -28
  31. package/dist/apps/Zones.js +7 -7
  32. package/dist/apps/data/App.d.ts +2909 -2523
  33. package/dist/apps/data/App.d.ts.map +1 -1
  34. package/dist/apps/data/App.js +26 -21
  35. package/dist/apps/data/App.js.map +1 -1
  36. package/dist/apps/data/ZoneSelection.d.ts +8 -8
  37. package/dist/apps/data/ZoneSelection.d.ts.map +1 -1
  38. package/dist/apps/data/ZoneSelection.js +1 -1
  39. package/dist/apps/data/ZoneSelection.js.map +1 -1
  40. package/dist/apps/data/routes/activities.d.ts +588 -584
  41. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  42. package/dist/apps/data/routes/activities.js +1561 -1239
  43. package/dist/apps/data/routes/activities.js.map +1 -1
  44. package/dist/apps/data/routes/addresses.d.ts +22 -22
  45. package/dist/apps/data/routes/balances.d.ts +26 -26
  46. package/dist/apps/data/routes/balances.d.ts.map +1 -1
  47. package/dist/apps/data/routes/balances.js +43 -16
  48. package/dist/apps/data/routes/balances.js.map +1 -1
  49. package/dist/apps/data/routes/blocks.d.ts +44 -44
  50. package/dist/apps/data/routes/blocks.d.ts.map +1 -1
  51. package/dist/apps/data/routes/blocks.js +21 -11
  52. package/dist/apps/data/routes/blocks.js.map +1 -1
  53. package/dist/apps/data/routes/coingecko.d.ts +3 -3
  54. package/dist/apps/data/routes/earn.d.ts +201 -25
  55. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  56. package/dist/apps/data/routes/earn.js +434 -75
  57. package/dist/apps/data/routes/earn.js.map +1 -1
  58. package/dist/apps/data/routes/exchanges.d.ts +160 -145
  59. package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
  60. package/dist/apps/data/routes/exchanges.js +180 -114
  61. package/dist/apps/data/routes/exchanges.js.map +1 -1
  62. package/dist/apps/data/routes/fee-amm.d.ts +2 -2
  63. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
  64. package/dist/apps/data/routes/fee-amm.js +18 -19
  65. package/dist/apps/data/routes/fee-amm.js.map +1 -1
  66. package/dist/apps/data/routes/receipts.d.ts +155 -55
  67. package/dist/apps/data/routes/receipts.d.ts.map +1 -1
  68. package/dist/apps/data/routes/receipts.js +28 -10
  69. package/dist/apps/data/routes/receipts.js.map +1 -1
  70. package/dist/apps/data/routes/tokenlist.d.ts +13 -13
  71. package/dist/apps/data/routes/tokens.d.ts +5 -5
  72. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  73. package/dist/apps/data/routes/tokens.js +51 -20
  74. package/dist/apps/data/routes/tokens.js.map +1 -1
  75. package/dist/apps/data/routes/transactions.d.ts +7 -2
  76. package/dist/apps/data/routes/transactions.d.ts.map +1 -1
  77. package/dist/apps/data/routes/transactions.js +37 -17
  78. package/dist/apps/data/routes/transactions.js.map +1 -1
  79. package/dist/apps/data/routes/transfers.d.ts +13 -13
  80. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  81. package/dist/apps/data/routes/transfers.js +18 -12
  82. package/dist/apps/data/routes/transfers.js.map +1 -1
  83. package/dist/apps/data/routes/valuation.d.ts +31 -31
  84. package/dist/apps/data/routes/valuation.d.ts.map +1 -1
  85. package/dist/apps/data/routes/valuation.js +12 -7
  86. package/dist/apps/data/routes/valuation.js.map +1 -1
  87. package/dist/apps/data/routes/verified-tokens.d.ts +8 -8
  88. package/dist/apps/data/routes/webhooks.d.ts +816 -113
  89. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  90. package/dist/apps/data/routes/webhooks.js +47 -5
  91. package/dist/apps/data/routes/webhooks.js.map +1 -1
  92. package/dist/apps/data/routes/zones.d.ts +14 -14
  93. package/dist/apps/data/routes/zones.js +1 -1
  94. package/dist/apps/funding/App.d.ts +466 -44
  95. package/dist/apps/funding/App.d.ts.map +1 -1
  96. package/dist/apps/funding/App.js +1 -1
  97. package/dist/apps/funding/App.js.map +1 -1
  98. package/dist/apps/funding/routes/deposit-addresses.d.ts +17 -17
  99. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
  100. package/dist/apps/funding/routes/deposit-addresses.js +17 -12
  101. package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
  102. package/dist/apps/funding/routes/transfers.d.ts +650 -57
  103. package/dist/apps/funding/routes/transfers.d.ts.map +1 -1
  104. package/dist/apps/funding/routes/transfers.js +238 -24
  105. package/dist/apps/funding/routes/transfers.js.map +1 -1
  106. package/dist/apps/management/App.d.ts +5120 -4152
  107. package/dist/apps/management/App.d.ts.map +1 -1
  108. package/dist/apps/management/Billing.d.ts +1 -1
  109. package/dist/apps/management/Billing.d.ts.map +1 -1
  110. package/dist/apps/management/Billing.js +17 -1
  111. package/dist/apps/management/Billing.js.map +1 -1
  112. package/dist/apps/management/routes/api-keys.d.ts +632 -81
  113. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  114. package/dist/apps/management/routes/api-keys.js +236 -4
  115. package/dist/apps/management/routes/api-keys.js.map +1 -1
  116. package/dist/apps/management/routes/billing.d.ts +76 -76
  117. package/dist/apps/management/routes/faucet.d.ts +6 -6
  118. package/dist/apps/management/routes/invitations.d.ts +24 -24
  119. package/dist/apps/management/routes/invite-links.d.ts +4 -4
  120. package/dist/apps/management/routes/members.d.ts +16 -16
  121. package/dist/apps/management/routes/orgs.d.ts +20 -20
  122. package/dist/apps/management/routes/projects.d.ts +4 -4
  123. package/dist/apps/management/routes/usage.d.ts +8 -8
  124. package/dist/apps/management/routes/verified-token-requests.d.ts +17 -17
  125. package/dist/apps/management/routes/webhooks.d.ts +675 -25
  126. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  127. package/dist/apps/management/routes/webhooks.js +21 -21
  128. package/dist/apps/management/routes/webhooks.js.map +1 -1
  129. package/dist/apps/relay/App.d.ts.map +1 -1
  130. package/dist/apps/relay/App.js +115 -23
  131. package/dist/apps/relay/App.js.map +1 -1
  132. package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
  133. package/dist/apps/relay/Sponsorships.js +27 -1
  134. package/dist/apps/relay/Sponsorships.js.map +1 -1
  135. package/dist/db/Db.d.ts.map +1 -1
  136. package/dist/db/Db.js +34 -1
  137. package/dist/db/Db.js.map +1 -1
  138. package/dist/db/Schema.d.ts +11 -5
  139. package/dist/db/Schema.d.ts.map +1 -1
  140. package/dist/db/Schema.js +21 -3
  141. package/dist/db/Schema.js.map +1 -1
  142. package/dist/db/tables/fundingCatalog.d.ts +4 -2
  143. package/dist/db/tables/fundingCatalog.d.ts.map +1 -1
  144. package/dist/db/tables/fundingCatalog.js +5 -1
  145. package/dist/db/tables/fundingCatalog.js.map +1 -1
  146. package/dist/db/tables/fundingTransferTransactions.d.ts +38 -0
  147. package/dist/db/tables/fundingTransferTransactions.d.ts.map +1 -1
  148. package/dist/db/tables/fundingTransferTransactions.js +44 -3
  149. package/dist/db/tables/fundingTransferTransactions.js.map +1 -1
  150. package/dist/db/tables/fundingTransfers.d.ts +17 -0
  151. package/dist/db/tables/fundingTransfers.d.ts.map +1 -1
  152. package/dist/db/tables/fundingTransfers.js +21 -0
  153. package/dist/db/tables/fundingTransfers.js.map +1 -1
  154. package/dist/db/tables/organizations.d.ts +24 -0
  155. package/dist/db/tables/organizations.d.ts.map +1 -1
  156. package/dist/db/tables/organizations.js +27 -0
  157. package/dist/db/tables/organizations.js.map +1 -1
  158. package/dist/db/tables/projects.d.ts +25 -1
  159. package/dist/db/tables/projects.d.ts.map +1 -1
  160. package/dist/db/tables/projects.js +26 -0
  161. package/dist/db/tables/projects.js.map +1 -1
  162. package/dist/db/tables/sponsoredTransactions.d.ts +44 -0
  163. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
  164. package/dist/db/tables/sponsoredTransactions.js +146 -13
  165. package/dist/db/tables/sponsoredTransactions.js.map +1 -1
  166. package/dist/db/tables/webhookSubscriptions.d.ts +10 -6
  167. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  168. package/dist/db/tables/webhookSubscriptions.js +9 -6
  169. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  170. package/dist/handlers/internal/utils.d.ts.map +1 -1
  171. package/dist/handlers/internal/utils.js +9 -0
  172. package/dist/handlers/internal/utils.js.map +1 -1
  173. package/dist/internal/Auth.d.ts +3 -1
  174. package/dist/internal/Auth.d.ts.map +1 -1
  175. package/dist/internal/Auth.js +6 -3
  176. package/dist/internal/Auth.js.map +1 -1
  177. package/dist/internal/EarnVaults.d.ts +3 -3
  178. package/dist/internal/EarnVaults.js +5 -5
  179. package/dist/internal/EarnVaults.js.map +1 -1
  180. package/dist/internal/Fetch.d.ts +23 -0
  181. package/dist/internal/Fetch.d.ts.map +1 -0
  182. package/dist/internal/Fetch.js +26 -0
  183. package/dist/internal/Fetch.js.map +1 -0
  184. package/dist/internal/Log.d.ts +4 -2
  185. package/dist/internal/Log.d.ts.map +1 -1
  186. package/dist/internal/Log.js +16 -3
  187. package/dist/internal/Log.js.map +1 -1
  188. package/dist/internal/OpenApi.d.ts +5 -3
  189. package/dist/internal/OpenApi.d.ts.map +1 -1
  190. package/dist/internal/OpenApi.js +13 -3
  191. package/dist/internal/OpenApi.js.map +1 -1
  192. package/dist/internal/Response.d.ts +1 -1
  193. package/dist/internal/Response.d.ts.map +1 -1
  194. package/dist/internal/Schema.d.ts +6 -3
  195. package/dist/internal/Schema.d.ts.map +1 -1
  196. package/dist/internal/Schema.js +8 -2
  197. package/dist/internal/Schema.js.map +1 -1
  198. package/dist/internal/Store.d.ts +16 -3
  199. package/dist/internal/Store.d.ts.map +1 -1
  200. package/dist/internal/Store.js +82 -16
  201. package/dist/internal/Store.js.map +1 -1
  202. package/dist/internal/Tidx.d.ts.map +1 -1
  203. package/dist/internal/Tidx.js +7 -2
  204. package/dist/internal/Tidx.js.map +1 -1
  205. package/dist/internal/Timeout.d.ts +36 -0
  206. package/dist/internal/Timeout.d.ts.map +1 -0
  207. package/dist/internal/Timeout.js +37 -0
  208. package/dist/internal/Timeout.js.map +1 -0
  209. package/dist/internal/Timing.d.ts +9 -0
  210. package/dist/internal/Timing.d.ts.map +1 -1
  211. package/dist/internal/Timing.js +7 -0
  212. package/dist/internal/Timing.js.map +1 -1
  213. package/dist/internal/Viem.d.ts +16 -1
  214. package/dist/internal/Viem.d.ts.map +1 -1
  215. package/dist/internal/Viem.js +12 -2
  216. package/dist/internal/Viem.js.map +1 -1
  217. package/dist/internal/WebhookDestination.d.ts.map +1 -1
  218. package/dist/internal/WebhookDestination.js +3 -0
  219. package/dist/internal/WebhookDestination.js.map +1 -1
  220. package/dist/internal/funding/Action.d.ts +9 -0
  221. package/dist/internal/funding/Action.d.ts.map +1 -1
  222. package/dist/internal/funding/Action.js +16 -8
  223. package/dist/internal/funding/Action.js.map +1 -1
  224. package/dist/internal/funding/Catalog.d.ts +9 -2
  225. package/dist/internal/funding/Catalog.d.ts.map +1 -1
  226. package/dist/internal/funding/Catalog.js +19 -8
  227. package/dist/internal/funding/Catalog.js.map +1 -1
  228. package/dist/internal/funding/DepositWebhook.d.ts.map +1 -1
  229. package/dist/internal/funding/DepositWebhook.js +2 -1
  230. package/dist/internal/funding/DepositWebhook.js.map +1 -1
  231. package/dist/internal/funding/Evidence.d.ts.map +1 -1
  232. package/dist/internal/funding/Evidence.js +2 -10
  233. package/dist/internal/funding/Evidence.js.map +1 -1
  234. package/dist/internal/funding/Provider.d.ts +108 -13
  235. package/dist/internal/funding/Provider.d.ts.map +1 -1
  236. package/dist/internal/funding/Provider.js +34 -8
  237. package/dist/internal/funding/Provider.js.map +1 -1
  238. package/dist/internal/funding/SourceObservation.d.ts.map +1 -1
  239. package/dist/internal/funding/SourceObservation.js +5 -7
  240. package/dist/internal/funding/SourceObservation.js.map +1 -1
  241. package/dist/internal/funding/Transfer.d.ts +114 -18
  242. package/dist/internal/funding/Transfer.d.ts.map +1 -1
  243. package/dist/internal/funding/Transfer.js +185 -55
  244. package/dist/internal/funding/Transfer.js.map +1 -1
  245. package/dist/internal/funding/TransferReconciliation.d.ts +52 -0
  246. package/dist/internal/funding/TransferReconciliation.d.ts.map +1 -0
  247. package/dist/internal/funding/TransferReconciliation.js +192 -0
  248. package/dist/internal/funding/TransferReconciliation.js.map +1 -0
  249. package/dist/internal/funding/TransferWebhook.d.ts +21 -0
  250. package/dist/internal/funding/TransferWebhook.d.ts.map +1 -0
  251. package/dist/internal/funding/TransferWebhook.js +43 -0
  252. package/dist/internal/funding/TransferWebhook.js.map +1 -0
  253. package/dist/internal/funding/index.d.ts +1 -0
  254. package/dist/internal/funding/index.d.ts.map +1 -1
  255. package/dist/internal/funding/index.js +1 -0
  256. package/dist/internal/funding/index.js.map +1 -1
  257. package/dist/internal/funding/providers/relay.d.ts.map +1 -1
  258. package/dist/internal/funding/providers/relay.js +3 -12
  259. package/dist/internal/funding/providers/relay.js.map +1 -1
  260. package/dist/internal/funding/providers/stargate.d.ts +127 -9
  261. package/dist/internal/funding/providers/stargate.d.ts.map +1 -1
  262. package/dist/internal/funding/providers/stargate.js +548 -112
  263. package/dist/internal/funding/providers/stargate.js.map +1 -1
  264. package/dist/internal/index.d.ts +1 -0
  265. package/dist/internal/index.d.ts.map +1 -1
  266. package/dist/internal/index.js +1 -0
  267. package/dist/internal/index.js.map +1 -1
  268. package/dist/internal/webhookDestinations/slack.d.ts.map +1 -1
  269. package/dist/internal/webhookDestinations/slack.js +16 -0
  270. package/dist/internal/webhookDestinations/slack.js.map +1 -1
  271. package/package.json +2 -2
  272. package/src/App.test.ts +100 -0
  273. package/src/App.ts +43 -3
  274. package/src/Client.test-d.ts +129 -2
  275. package/src/Scope.test.ts +20 -0
  276. package/src/Scope.ts +16 -0
  277. package/src/Webhooks.ts +2 -2
  278. package/src/admin/apps/api-keys.test.ts +75 -0
  279. package/src/admin/apps/api-keys.ts +64 -0
  280. package/src/admin/apps/earn-vaults.test.ts +1 -1
  281. package/src/admin/apps/earn-vaults.ts +2 -1
  282. package/src/admin/apps/organizations.test.ts +53 -1
  283. package/src/admin/apps/organizations.ts +90 -5
  284. package/src/admin/ui/src/lib/api-keys.ts +19 -0
  285. package/src/admin/ui/src/lib/organizations.test.ts +112 -1
  286. package/src/admin/ui/src/lib/organizations.ts +55 -0
  287. package/src/admin/ui/src/routes/api-keys.tsx +89 -2
  288. package/src/admin/ui/src/routes/organizations_.$orgId.tsx +116 -0
  289. package/src/admin/ui.generated.ts +189 -151
  290. package/src/apps/Zones.test.ts +7 -7
  291. package/src/apps/Zones.ts +7 -7
  292. package/src/apps/composition.test.ts +2 -1
  293. package/src/apps/data/App.test.ts +41 -0
  294. package/src/apps/data/App.ts +30 -21
  295. package/src/apps/data/ZoneSelection.test.ts +2 -2
  296. package/src/apps/data/ZoneSelection.ts +8 -8
  297. package/src/apps/data/routes/activities.test.ts +1526 -12
  298. package/src/apps/data/routes/activities.ts +1774 -1356
  299. package/src/apps/data/routes/balances.ts +133 -97
  300. package/src/apps/data/routes/blocks.test.ts +533 -0
  301. package/src/apps/data/routes/blocks.ts +35 -16
  302. package/src/apps/data/routes/earn.test.ts +373 -16
  303. package/src/apps/data/routes/earn.ts +548 -79
  304. package/src/apps/data/routes/earn.zone-access.test.ts +6 -6
  305. package/src/apps/data/routes/exchanges.test.ts +740 -15
  306. package/src/apps/data/routes/exchanges.ts +954 -753
  307. package/src/apps/data/routes/fee-amm.ts +17 -18
  308. package/src/apps/data/routes/receipts.ts +47 -16
  309. package/src/apps/data/routes/tokens.test.ts +578 -0
  310. package/src/apps/data/routes/tokens.ts +283 -225
  311. package/src/apps/data/routes/transactions.ts +68 -29
  312. package/src/apps/data/routes/transfers.test.ts +421 -0
  313. package/src/apps/data/routes/transfers.ts +45 -27
  314. package/src/apps/data/routes/valuation.ts +94 -78
  315. package/src/apps/data/routes/webhooks.test.ts +21 -5
  316. package/src/apps/data/routes/webhooks.ts +63 -8
  317. package/src/apps/data/routes/zones.test.ts +2 -2
  318. package/src/apps/data/routes/zones.ts +1 -1
  319. package/src/apps/funding/App.ts +12 -2
  320. package/src/apps/funding/routes/deposit-addresses.test.ts +29 -7
  321. package/src/apps/funding/routes/deposit-addresses.ts +19 -14
  322. package/src/apps/funding/routes/quotes.test.ts +5 -9
  323. package/src/apps/funding/routes/transfers.test.ts +901 -23
  324. package/src/apps/funding/routes/transfers.ts +347 -64
  325. package/src/apps/management/Billing.ts +18 -5
  326. package/src/apps/management/routes/api-keys.test.ts +220 -0
  327. package/src/apps/management/routes/api-keys.ts +280 -3
  328. package/src/apps/management/routes/webhooks.test.ts +3 -3
  329. package/src/apps/management/routes/webhooks.ts +24 -25
  330. package/src/apps/relay/App.test.ts +212 -1
  331. package/src/apps/relay/App.ts +158 -29
  332. package/src/apps/relay/Sponsorships.ts +24 -1
  333. package/src/db/Db.ts +48 -1
  334. package/src/db/Schema.ts +22 -4
  335. package/src/db/tables/earnVaults.test.ts +9 -9
  336. package/src/db/tables/fundingCatalog.test.ts +16 -2
  337. package/src/db/tables/fundingCatalog.ts +9 -3
  338. package/src/db/tables/fundingTransferTransactions.test.ts +43 -0
  339. package/src/db/tables/fundingTransferTransactions.ts +79 -3
  340. package/src/db/tables/fundingTransfers.test.ts +26 -0
  341. package/src/db/tables/fundingTransfers.ts +36 -0
  342. package/src/db/tables/organizations.test.ts +41 -0
  343. package/src/db/tables/organizations.ts +49 -0
  344. package/src/db/tables/projects.test.ts +55 -0
  345. package/src/db/tables/projects.ts +46 -1
  346. package/src/db/tables/sponsoredTransactions.test.ts +338 -0
  347. package/src/db/tables/sponsoredTransactions.ts +197 -13
  348. package/src/db/tables/webhookSubscriptions.ts +18 -11
  349. package/src/handlers/internal/utils.test.ts +53 -0
  350. package/src/handlers/internal/utils.ts +15 -0
  351. package/src/internal/Auth.ts +12 -4
  352. package/src/internal/EarnVaults.capabilities.test.ts +2 -2
  353. package/src/internal/EarnVaults.test.ts +1 -1
  354. package/src/internal/EarnVaults.ts +5 -5
  355. package/src/internal/Fetch.test.ts +46 -0
  356. package/src/internal/Fetch.ts +56 -0
  357. package/src/internal/Log.test-d.ts +2 -0
  358. package/src/internal/Log.test.ts +21 -0
  359. package/src/internal/Log.ts +22 -5
  360. package/src/internal/OpenApi.ts +14 -4
  361. package/src/internal/Response.ts +1 -1
  362. package/src/internal/Schema.test.ts +2 -0
  363. package/src/internal/Schema.ts +12 -2
  364. package/src/internal/Store.test.ts +178 -0
  365. package/src/internal/Store.ts +104 -18
  366. package/src/internal/Tidx.test.ts +2 -1
  367. package/src/internal/Tidx.ts +7 -2
  368. package/src/internal/Timeout.test.ts +35 -0
  369. package/src/internal/Timeout.ts +73 -0
  370. package/src/internal/Timing.ts +16 -0
  371. package/src/internal/Viem.ts +39 -3
  372. package/src/internal/WebhookDestination.ts +3 -0
  373. package/src/internal/Webhooks.test.ts +45 -0
  374. package/src/internal/funding/Action.test.ts +41 -1
  375. package/src/internal/funding/Action.ts +69 -41
  376. package/src/internal/funding/Catalog.test.ts +34 -0
  377. package/src/internal/funding/Catalog.ts +28 -11
  378. package/src/internal/funding/DepositWebhook.ts +2 -1
  379. package/src/internal/funding/Evidence.ts +2 -13
  380. package/src/internal/funding/Provider.test.ts +73 -0
  381. package/src/internal/funding/Provider.ts +125 -28
  382. package/src/internal/funding/SourceObservation.ts +5 -9
  383. package/src/internal/funding/Transfer.test.ts +155 -0
  384. package/src/internal/funding/Transfer.ts +387 -147
  385. package/src/internal/funding/TransferReconciliation.test.ts +147 -0
  386. package/src/internal/funding/TransferReconciliation.ts +264 -0
  387. package/src/internal/funding/TransferWebhook.test.ts +128 -0
  388. package/src/internal/funding/TransferWebhook.ts +67 -0
  389. package/src/internal/funding/index.test.ts +1 -0
  390. package/src/internal/funding/index.ts +1 -0
  391. package/src/internal/funding/providers/index.test.ts +4 -167
  392. package/src/internal/funding/providers/relay.test.ts +2 -2
  393. package/src/internal/funding/providers/relay.ts +3 -15
  394. package/src/internal/funding/providers/stargate.test.ts +328 -0
  395. package/src/internal/funding/providers/stargate.ts +807 -135
  396. package/src/internal/index.test.ts +1 -0
  397. package/src/internal/index.ts +1 -0
  398. package/src/internal/webhookDestinations/slack.ts +15 -0
@@ -157,7 +157,7 @@ export var schema;
157
157
  * are absent on the base (no-`include`) response and best-effort when
158
158
  * requested (a token whose metadata is unavailable keeps just `address`).
159
159
  */
160
- schema.PairToken = Schema.describe(z.object({
160
+ schema.PairToken = OpenApi.component(Schema.describe(z.object({
161
161
  address: Schema.tokenAddress(Tokens.tokenExample.address).check(z.describe('TIP-20 token contract address — the `0x`-prefixed 20-byte identifier for this token.'), z.meta({ examples: [Tokens.tokenExample.address] })),
162
162
  currency: z
163
163
  .optional(z.string())
@@ -177,14 +177,13 @@ export var schema;
177
177
  verified: z
178
178
  .optional(z.boolean())
179
179
  .check(z.describe('Whether Tempo has verified this token metadata.'), z.meta({ examples: [true] })),
180
- }), 'One side of a trading pair (with metadata when requested via `include=tokens`).');
181
- /** A token amount carrying its nominal value in the requested denomination. */
182
- const ValuedAmount = z.extend(Schema.TokenAmount, {
180
+ }), 'One side of a trading pair (with metadata when requested via `include=tokens`).'), 'ExchangePairToken');
181
+ const ValuedAmount = OpenApi.component(Schema.describe(z.extend(Schema.TokenAmount, {
183
182
  valuation: z
184
183
  .optional(z.nullable(Valuation.schema.Value))
185
184
  .check(z.describe('The amount’s nominal value in the requested `valuation.currency`. `null` when the token is ' +
186
185
  'unverified, its display currency has no rate, or rates were unavailable.')),
187
- });
186
+ }), 'A token amount carrying its nominal value in the requested denomination.'), 'ExchangeValuedAmount');
188
187
  /** Schemas for creating an executable exchange quote. */
189
188
  let createQuote;
190
189
  (function (createQuote) {
@@ -210,7 +209,7 @@ export var schema;
210
209
  })
211
210
  .check(z.describe('Query parameters for creating an exchange quote.'));
212
211
  /** Quote request with one pinned side and caller-selected slippage. */
213
- createQuote.Request = z
212
+ createQuote.Request = OpenApi.component(z
214
213
  .strictObject({
215
214
  account: z
216
215
  .optional(Schema.Address)
@@ -227,26 +226,26 @@ export var schema;
227
226
  })
228
227
  .check(z.refine((request) => request.sourceToken !== request.destinationToken, {
229
228
  error: 'Source and destination tokens must differ.',
230
- }), z.describe('Request for an executable quote from the configured exchange providers.'));
229
+ }), z.describe('Request for an executable quote from the configured exchange providers.')), 'CreateExchangeQuoteRequest');
231
230
  /** One call in the unsigned Tempo transaction plan. */
232
- createQuote.Call = z
231
+ createQuote.Call = OpenApi.component(z
233
232
  .object({
234
233
  data: Schema.Hex.check(z.describe('ABI-encoded call data.'), z.meta({ examples: ['0x095ea7b3'] })),
235
234
  to: Schema.Address.check(z.describe('Contract or precompile that receives the call.'), z.meta({ examples: [Addresses.stablecoinDex] })),
236
235
  value: Schema.Quantity.check(z.describe('Native token value sent with the call.'), z.meta({ examples: ['0x0'] })),
237
236
  })
238
- .check(z.describe('One unsigned call in the Tempo transaction plan.'));
237
+ .check(z.describe('One unsigned call in the Tempo transaction plan.')), 'ExchangeQuoteCall');
239
238
  const QuoteToken = Schema.describe(z.partial(z.omit(Tokens.schema.Token, { id: true }), {
240
239
  logoUri: true,
241
240
  verified: true,
242
241
  }), 'A token referenced by an exchange quote, with RPC metadata and optional enrichments.');
243
- const DestinationToken = z.extend(QuoteToken, {
242
+ const DestinationToken = OpenApi.component(Schema.describe(z.extend(QuoteToken, {
244
243
  address: DestinationTokenAddress.check(z.describe('TIP-20 token the swap receives.')),
245
- });
246
- const SourceToken = z.extend(QuoteToken, {
244
+ }), 'The token received by an exchange quote.'), 'ExchangeQuoteDestinationToken');
245
+ const SourceToken = OpenApi.component(Schema.describe(z.extend(QuoteToken, {
247
246
  address: SourceTokenAddress.check(z.describe('TIP-20 token the swap spends.')),
248
- });
249
- createQuote.Transaction = z
247
+ }), 'The token spent by an exchange quote.'), 'ExchangeQuoteSourceToken');
248
+ createQuote.Transaction = OpenApi.component(z
250
249
  .object({
251
250
  calls: z.array(createQuote.Call).check(z.minLength(1), z.describe('Calls to execute in order.'), z.meta({
252
251
  examples: [
@@ -262,17 +261,17 @@ export var schema;
262
261
  })),
263
262
  chainId: Schema.ChainId.check(z.describe('Tempo chain where these calls execute.')),
264
263
  })
265
- .check(z.describe('Unsigned Tempo transaction plan.'));
264
+ .check(z.describe('Unsigned Tempo transaction plan.')), 'ExchangeQuoteTransaction');
266
265
  /** Response-level valuation rate provenance. */
267
- createQuote.Meta = z
266
+ createQuote.Meta = OpenApi.component(z
268
267
  .object({
269
268
  valuation: z
270
269
  .optional(Valuation.schema.Pricing)
271
270
  .check(z.describe('Rate provenance for amount valuations. Present when conversion rates were consulted.')),
272
271
  })
273
- .check(z.describe('Response-level resources attached to this quote.'));
272
+ .check(z.describe('Response-level resources attached to this quote.')), 'ExchangeQuoteMeta');
274
273
  /** Provider-neutral EIP-712 payload to sign before finalizing a quote. */
275
- createQuote.TypedData = z
274
+ createQuote.TypedData = OpenApi.component(z
276
275
  .object({
277
276
  domain: z.record(z.string(), z.unknown()).check(z.describe('EIP-712 signing domain.'), z.meta({
278
277
  examples: [
@@ -324,7 +323,7 @@ export var schema;
324
323
  ],
325
324
  })),
326
325
  })
327
- .check(z.describe('EIP-712 payload the wallet must sign before execution can continue.'));
326
+ .check(z.describe('EIP-712 payload the wallet must sign before execution can continue.')), 'ExchangeQuoteTypedData');
328
327
  const Provider = z
329
328
  .string()
330
329
  .check(z.describe('Provider selected for this route.'), z.meta({ examples: ['nativeDex'] }));
@@ -332,20 +331,23 @@ export var schema;
332
331
  gasEstimate: Schema.DecimalString.check(z.describe('Estimated network fee in the chain native token’s base unit.'), z.meta({ examples: ['150000000000000'] })),
333
332
  provider: Provider,
334
333
  };
335
- const ApprovalRequired = {
336
- approval: z.object({
337
- calls: z.array(createQuote.Call).check(z.minLength(1), z.describe('Approval calls to confirm before requesting a fresh quote.'), z.meta({
338
- examples: [
339
- [
340
- {
341
- data: exampleApprovalCall.data,
342
- to: exampleApprovalCall.to,
343
- value: '0x0',
344
- },
345
- ],
334
+ const Approval = OpenApi.component(z
335
+ .object({
336
+ calls: z.array(createQuote.Call).check(z.minLength(1), z.describe('Approval calls to confirm before requesting a fresh quote.'), z.meta({
337
+ examples: [
338
+ [
339
+ {
340
+ data: exampleApprovalCall.data,
341
+ to: exampleApprovalCall.to,
342
+ value: '0x0',
343
+ },
346
344
  ],
347
- })),
348
- }),
345
+ ],
346
+ })),
347
+ })
348
+ .check(z.describe('Token approval calls required before requesting a fresh quote.')), 'ExchangeQuoteApproval');
349
+ const ApprovalRequired = {
350
+ approval: Approval,
349
351
  status: z
350
352
  .literal('approvalRequired')
351
353
  .check(z.describe('Confirm the approvals, then request a fresh quote.'), z.meta({ examples: ['approvalRequired'] })),
@@ -366,44 +368,63 @@ export var schema;
366
368
  typedData: createQuote.TypedData,
367
369
  };
368
370
  const ExactSource = {
369
- destinationAmount: ValuedAmount.check(z.describe('Quoted destination amount.')),
370
- destinationAmountMin: ValuedAmount.check(z.describe('Minimum destination amount after slippage.')),
371
+ destinationAmount: ValuedAmount,
372
+ destinationAmountMin: ValuedAmount,
371
373
  destinationToken: DestinationToken,
372
374
  meta: z.optional(createQuote.Meta).check(z.describe('Valuation rate provenance for this quote.')),
373
375
  mode: z
374
376
  .literal('exactSource')
375
377
  .check(z.describe('The source amount is fixed and the destination has a minimum.'), z.meta({ examples: ['exactSource'] })),
376
- sourceAmount: ValuedAmount.check(z.describe('Exact source amount.')),
377
- sourceToken: SourceToken.check(z.describe('Token spent by the swap.')),
378
+ sourceAmount: ValuedAmount,
379
+ sourceToken: SourceToken,
378
380
  };
379
381
  const ExactDestination = {
380
- destinationAmount: ValuedAmount.check(z.describe('Exact destination amount.')),
381
- destinationToken: DestinationToken.check(z.describe('Token received by the swap.')),
382
+ destinationAmount: ValuedAmount,
383
+ destinationToken: DestinationToken,
382
384
  meta: z.optional(createQuote.Meta).check(z.describe('Valuation rate provenance for this quote.')),
383
385
  mode: z
384
386
  .literal('exactDestination')
385
387
  .check(z.describe('The destination amount is fixed and the source has a maximum.'), z.meta({ examples: ['exactDestination'] })),
386
- sourceAmount: ValuedAmount.check(z.describe('Quoted source amount.')),
387
- sourceAmountMax: ValuedAmount.check(z.describe('Maximum source amount after slippage.')),
388
+ sourceAmount: ValuedAmount,
389
+ sourceAmountMax: ValuedAmount,
388
390
  sourceToken: SourceToken,
389
391
  };
392
+ const ExactSourceApprovalRequired = OpenApi.component(z
393
+ .object({ ...ApprovalRequired, ...ExactSource, ...Quote })
394
+ .check(z.describe('An exact-source quote that requires token approval.')), 'ExchangeQuoteExactSourceApprovalRequired');
395
+ const ExactSourceReady = OpenApi.component(z
396
+ .object({ ...ExactSource, ...Quote, ...Ready })
397
+ .check(z.describe('An exact-source quote ready to execute.')), 'ExchangeQuoteExactSourceReady');
398
+ const ExactSourceSignatureRequired = OpenApi.component(z
399
+ .object({ ...ExactSource, ...Quote, ...SignatureRequired })
400
+ .check(z.describe('An exact-source quote that requires a signature.')), 'ExchangeQuoteExactSourceSignatureRequired');
401
+ const ExactDestinationApprovalRequired = OpenApi.component(z
402
+ .object({ ...ApprovalRequired, ...ExactDestination, ...Quote })
403
+ .check(z.describe('An exact-destination quote that requires token approval.')), 'ExchangeQuoteExactDestinationApprovalRequired');
404
+ const ExactDestinationReady = OpenApi.component(z
405
+ .object({ ...ExactDestination, ...Quote, ...Ready })
406
+ .check(z.describe('An exact-destination quote ready to execute.')), 'ExchangeQuoteExactDestinationReady');
407
+ const ExactDestinationSignatureRequired = OpenApi.component(z
408
+ .object({ ...ExactDestination, ...Quote, ...SignatureRequired })
409
+ .check(z.describe('An exact-destination quote that requires a signature.')), 'ExchangeQuoteExactDestinationSignatureRequired');
390
410
  /** Provider-neutral quote and the action needed to execute it. */
391
- createQuote.Response = z
411
+ createQuote.Response = OpenApi.component(z
392
412
  .union([
393
- z.object({ ...ApprovalRequired, ...ExactSource, ...Quote }),
394
- z.object({ ...ExactSource, ...Quote, ...Ready }),
395
- z.object({ ...ExactSource, ...Quote, ...SignatureRequired }),
396
- z.object({ ...ApprovalRequired, ...ExactDestination, ...Quote }),
397
- z.object({ ...ExactDestination, ...Quote, ...Ready }),
398
- z.object({ ...ExactDestination, ...Quote, ...SignatureRequired }),
413
+ ExactSourceApprovalRequired,
414
+ ExactSourceReady,
415
+ ExactSourceSignatureRequired,
416
+ ExactDestinationApprovalRequired,
417
+ ExactDestinationReady,
418
+ ExactDestinationSignatureRequired,
399
419
  ])
400
- .check(z.describe('Provider-neutral exchange quote with its next execution action.'));
420
+ .check(z.describe('Provider-neutral exchange quote with its next execution action.')), 'ExchangeQuote');
401
421
  })(createQuote = schema.createQuote || (schema.createQuote = {}));
402
422
  /** Schemas for finishing a quote after a provider-requested signature. */
403
423
  let executeQuote;
404
424
  (function (executeQuote) {
405
425
  /** Signed continuation request. */
406
- executeQuote.Request = z.strictObject({
426
+ executeQuote.Request = OpenApi.component(z
427
+ .strictObject({
407
428
  account: Schema.Address.check(z.describe('Wallet that signed and will execute the swap.'), z.meta({ examples: ['0x1111111111111111111111111111111111111111'] })),
408
429
  continuation: z
409
430
  .string()
@@ -412,14 +433,17 @@ export var schema;
412
433
  .string()
413
434
  .check(z.minLength(1), z.describe('Provider that issued the continuation.'), z.meta({ examples: ['uniswap'] })),
414
435
  signature: Schema.Hex.check(z.refine((value) => value.length === 132, { error: 'Signature must be 65 bytes.' }), z.describe('65-byte EIP-712 signature requested by the quote.'), z.meta({ examples: [`0x${'11'.repeat(65)}`] })),
415
- });
436
+ })
437
+ .check(z.describe('Request to finalize a provider quote after signing its typed data.')), 'FinalizeExchangeQuoteRequest');
416
438
  /** Final transaction plan. */
417
- executeQuote.Response = z.object({
439
+ executeQuote.Response = OpenApi.component(z
440
+ .object({
418
441
  provider: z
419
442
  .string()
420
443
  .check(z.describe('Provider that built the transaction.'), z.meta({ examples: ['uniswap'] })),
421
444
  transaction: createQuote.Transaction,
422
- });
445
+ })
446
+ .check(z.describe('Final unsigned transaction plan for a signed provider quote.')), 'FinalizedExchangeQuote');
423
447
  })(executeQuote = schema.executeQuote || (schema.executeQuote = {}));
424
448
  /** Schemas for the getPairs operation. */
425
449
  let getPairs;
@@ -453,9 +477,9 @@ export var schema;
453
477
  })
454
478
  .check(...Schema.pageChecks(), z.describe('Filters, pagination, and sorting options for listing exchange trading pairs.'));
455
479
  /** A single trading pair on the stablecoin DEX. */
456
- getPairs.Pair = z
480
+ getPairs.Pair = OpenApi.component(z
457
481
  .object({
458
- base: schema.PairToken.check(z.describe('Base token — the asset whose price is quoted in the pair.')),
482
+ base: schema.PairToken,
459
483
  blockNumber: z
460
484
  .number()
461
485
  .check(z.int(), z.nonnegative(), z.describe('Block number where the pair was created.'), z.meta({ examples: [23456789] })),
@@ -466,23 +490,25 @@ export var schema;
466
490
  .string()
467
491
  .check(z.regex(/^\d+$/), z.describe('Liquidity signal for the pair: the base-token balance held by the DEX, returned as a decimal integer string in the token’s smallest units. Present only when `sort=liquidity`.')))
468
492
  .check(z.describe('Liquidity signal for the pair, present only when you request `sort=liquidity`.'), z.meta({ examples: ['1000000'] })),
469
- quote: schema.PairToken.check(z.describe('Quote token — the asset used to price the base token.')),
493
+ quote: schema.PairToken,
470
494
  timestamp: z.iso
471
495
  .datetime()
472
496
  .check(z.describe('Block timestamp when the pair was created.'), z.meta({ examples: ['2024-01-01T00:00:00Z'] })),
473
497
  transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction that created the pair.')),
474
498
  })
475
- .check(z.describe('One trading pair on Tempo’s built-in stablecoin exchange.'));
499
+ .check(z.describe('One trading pair on Tempo’s built-in stablecoin exchange.')), 'ExchangePair');
500
+ /** Response metadata requested through `include`, such as capped counts. */
501
+ getPairs.Meta = OpenApi.component(Schema.CountMeta, 'ExchangePairListMeta');
476
502
  /** Page of trading pairs on the stablecoin DEX, ordered by creation. */
477
- getPairs.Response = z
503
+ getPairs.Response = OpenApi.component(z
478
504
  .object({
479
505
  data: z.array(getPairs.Pair).check(z.describe('Trading pairs returned on this page.')),
480
506
  meta: z
481
- .optional(Schema.CountMeta)
507
+ .optional(getPairs.Meta)
482
508
  .check(z.describe('Response-level resources requested with `include`, such as `totalCount`.')),
483
509
  nextCursor: Schema.NextCursor,
484
510
  })
485
- .check(z.describe('A paginated list of trading pairs on Tempo’s built-in stablecoin exchange.'));
511
+ .check(z.describe('A paginated list of trading pairs on Tempo’s built-in stablecoin exchange.')), 'ExchangePairList');
486
512
  })(getPairs = schema.getPairs || (schema.getPairs = {}));
487
513
  /** Schemas for the getPair operation (single trading pair detail). */
488
514
  let getPair;
@@ -555,12 +581,12 @@ export var schema;
555
581
  'transaction expands one fill group into a variable number of swap rows, so a ' +
556
582
  'positional `page` has no stable meaning on this feed.'));
557
583
  /** One swap-side token with RPC metadata and optional curated fields. */
558
- getSwaps.SwapSide = Schema.describe(Tokens.schema.TokenReference, 'A token referenced by one side of a swap.');
584
+ getSwaps.SwapSide = OpenApi.component(Schema.describe(Tokens.schema.TokenReference, 'A token referenced by one side of a swap.'), 'ExchangeSwapToken');
559
585
  /** A single maker-order fill within a swap, framed from the taker's perspective. */
560
- getSwaps.Fill = z
586
+ getSwaps.Fill = OpenApi.component(z
561
587
  .object({
562
- destinationAmount: ValuedAmount.check(z.describe('Amount the taker received in this fill.')),
563
- destinationToken: getSwaps.SwapSide.check(z.describe('Token the taker received in this fill.')),
588
+ destinationAmount: ValuedAmount,
589
+ destinationToken: getSwaps.SwapSide,
564
590
  logIndex: z
565
591
  .number()
566
592
  .check(z.int(), z.nonnegative(), z.describe('Log index of this fill within its block.'), z.meta({ examples: [0] })),
@@ -572,10 +598,10 @@ export var schema;
572
598
  price: z
573
599
  .string()
574
600
  .check(z.regex(/^\d+(\.\d+)?$/), z.describe('Quote-per-base price at fill time, returned as a fixed-decimal string with 5 decimal places. This value is direction-independent and works well for charts.'), z.meta({ examples: ['1.00000'] })),
575
- sourceAmount: ValuedAmount.check(z.describe('Amount the taker sent in this fill.')),
576
- sourceToken: getSwaps.SwapSide.check(z.describe('Token the taker sent in this fill.')),
601
+ sourceAmount: ValuedAmount,
602
+ sourceToken: getSwaps.SwapSide,
577
603
  })
578
- .check(z.describe('One maker-order fill within a swap, described from the taker’s perspective.'));
604
+ .check(z.describe('One maker-order fill within a swap, described from the taker’s perspective.')), 'ExchangeSwapFill');
579
605
  /**
580
606
  * A single logical taker swap on the stablecoin DEX: every maker-order
581
607
  * fill one taker's swap produced in one transaction, assembled into a
@@ -583,13 +609,13 @@ export var schema;
583
609
  * intermediate token, e.g. pathUSD) are one row; the intermediate hops
584
610
  * are visible via `route` and `fills`.
585
611
  */
586
- getSwaps.Swap = z
612
+ getSwaps.Swap = OpenApi.component(z
587
613
  .object({
588
614
  blockNumber: z
589
615
  .number()
590
616
  .check(z.int(), z.nonnegative(), z.describe('Block number where the swap was included.'), z.meta({ examples: [23456789] })),
591
- destinationAmount: ValuedAmount.check(z.describe('Total amount the taker received in this swap.')),
592
- destinationToken: getSwaps.SwapSide.check(z.describe('Destination token for the final hop.')),
617
+ destinationAmount: ValuedAmount,
618
+ destinationToken: getSwaps.SwapSide,
593
619
  filledAt: z.iso
594
620
  .datetime()
595
621
  .check(z.describe('Block timestamp when the swap was filled onchain.'), z.meta({ examples: ['2024-01-01T00:00:00Z'] })),
@@ -611,12 +637,12 @@ export var schema;
611
637
  route: z
612
638
  .array(Schema.TokenAddress)
613
639
  .check(z.describe('Token path for the swap, from source through any intermediate tokens to destination. `route.length - 1` is the hop count; two entries means a direct swap.')),
614
- sourceAmount: ValuedAmount.check(z.describe('Total amount the taker sent in this swap.')),
615
- sourceToken: getSwaps.SwapSide.check(z.describe('Source token for the first hop.')),
640
+ sourceAmount: ValuedAmount,
641
+ sourceToken: getSwaps.SwapSide,
616
642
  taker: Schema.Address.check(z.describe('Taker address that initiated the swap.')),
617
643
  transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction containing the swap.')),
618
644
  })
619
- .check(z.describe('One logical taker swap on Tempo’s built-in stablecoin exchange.'));
645
+ .check(z.describe('One logical taker swap on Tempo’s built-in stablecoin exchange.')), 'ExchangeSwap');
620
646
  /**
621
647
  * Page of swaps. A row is one logical taker swap — the fills of one
622
648
  * `(transaction, taker)` group chained source → destination — so the
@@ -625,15 +651,15 @@ export var schema;
625
651
  * taker may have its rows split across consecutive pages.
626
652
  */
627
653
  /** Page-level resources: valuation rate provenance. */
628
- getSwaps.Meta = z
654
+ getSwaps.Meta = OpenApi.component(z
629
655
  .object({
630
656
  valuation: z
631
657
  .optional(Valuation.schema.Pricing)
632
658
  .check(z.describe('Rate provenance for amount valuations. Present when conversion rates were ' +
633
659
  'consulted; absent when every value was identity-valued or rates were unavailable.')),
634
660
  })
635
- .check(z.describe('Page-level resources attached to this response.'));
636
- getSwaps.Response = z
661
+ .check(z.describe('Page-level resources attached to this response.')), 'ExchangeSwapListMeta');
662
+ getSwaps.Response = OpenApi.component(z
637
663
  .object({
638
664
  data: z.array(getSwaps.Swap).check(z.describe('Swaps returned on this page.')),
639
665
  meta: z
@@ -641,7 +667,7 @@ export var schema;
641
667
  .check(z.describe('Page-level resources, such as valuation rate provenance.')),
642
668
  nextCursor: Schema.NextCursor,
643
669
  })
644
- .check(z.describe('A paginated list of swaps on Tempo’s built-in stablecoin exchange.'));
670
+ .check(z.describe('A paginated list of swaps on Tempo’s built-in stablecoin exchange.')), 'ExchangeSwapList');
645
671
  })(getSwaps = schema.getSwaps || (schema.getSwaps = {}));
646
672
  /** Schemas for the getPairOhlc operation (candlestick aggregations). */
647
673
  let getPairOhlc;
@@ -695,7 +721,7 @@ export var schema;
695
721
  * and low are the extrema across all fills in the bucket. Volumes are
696
722
  * the sum of per-fill base- and quote-side amounts in base units.
697
723
  */
698
- getPairOhlc.Bucket = z
724
+ getPairOhlc.Bucket = OpenApi.component(z
699
725
  .object({
700
726
  close: z
701
727
  .string()
@@ -727,22 +753,22 @@ export var schema;
727
753
  })
728
754
  .check(z.describe('Total filled volume in this bucket, split by pair side.')),
729
755
  })
730
- .check(z.describe('One OHLC candle bucket for charting a trading pair.'));
756
+ .check(z.describe('One OHLC candle bucket for charting a trading pair.')), 'ExchangeOhlcBucket');
731
757
  /** Page of candlestick buckets for a single trading pair. */
732
- getPairOhlc.Response = z
758
+ getPairOhlc.Response = OpenApi.component(z
733
759
  .object({
734
- base: schema.PairToken.check(z.describe('Base side of the trading pair.')),
760
+ base: schema.PairToken,
735
761
  data: z
736
762
  .array(getPairOhlc.Bucket)
737
763
  .check(z.describe('OHLC candle buckets ordered oldest to newest; empty buckets are omitted.')),
738
764
  interval: getPairOhlc.Interval,
739
- quote: schema.PairToken.check(z.describe('Quote side of the trading pair.')),
765
+ quote: schema.PairToken,
740
766
  truncated: z
741
767
  .boolean()
742
768
  .check(z.describe('`true` when the fill scan hit its hard cap, meaning OHLC values were computed from only the most recent fills.'), z.meta({ examples: [false] })),
743
769
  window: getPairOhlc.Window,
744
770
  })
745
- .check(z.describe('OHLC candle data for one trading pair over a rolling time window.'));
771
+ .check(z.describe('OHLC candle data for one trading pair over a rolling time window.')), 'ExchangePairOhlc');
746
772
  })(getPairOhlc = schema.getPairOhlc || (schema.getPairOhlc = {}));
747
773
  /** Schemas shared by the order detail and order fills handlers. */
748
774
  let order;
@@ -754,11 +780,11 @@ export var schema;
754
780
  })
755
781
  .check(z.describe('Path parameters for routes that look up one order.'));
756
782
  /** The pair the order is placed against. */
757
- order.Pair = Schema.describe(z.object({
758
- base: schema.PairToken.check(z.describe('Base side of the pair; the order trades this token.')),
783
+ order.Pair = OpenApi.component(Schema.describe(z.object({
784
+ base: schema.PairToken,
759
785
  key: Schema.Hash.check(z.describe('On-chain key for this `(base, quote)` trading pair.')),
760
- quote: schema.PairToken.check(z.describe('Quote side of the trading pair.')),
761
- }), 'The trading pair the order belongs to.');
786
+ quote: schema.PairToken,
787
+ }), 'The trading pair the order belongs to.'), 'ExchangeOrderPair');
762
788
  })(order = schema.order || (schema.order = {}));
763
789
  /** Schemas for the getOrder operation. */
764
790
  let getOrder;
@@ -796,7 +822,7 @@ export var schema;
796
822
  * over time and would otherwise force this resource to revalidate on
797
823
  * every new fill.
798
824
  */
799
- getOrder.Response = Schema.describe(z.object({
825
+ getOrder.Response = OpenApi.component(Schema.describe(z.object({
800
826
  amount: Schema.DecimalString.check(z.describe('Initial order size, returned as a decimal integer string in base-token smallest units.')),
801
827
  flipTick: z
802
828
  .number()
@@ -824,7 +850,7 @@ export var schema;
824
850
  tick: z
825
851
  .number()
826
852
  .check(z.int(), z.describe('On-chain signed tick, scaled by `1/priceScale`; use `price` for the decoded ratio.'), z.meta({ examples: [0] })),
827
- }), 'A single DEX order with live onchain state.');
853
+ }), 'A single DEX order with live onchain state.'), 'ExchangeOrder');
828
854
  })(getOrder = schema.getOrder || (schema.getOrder = {}));
829
855
  /** Schemas for the getOrders operation (the resting-order feed, optionally pair-scoped). */
830
856
  let getOrders;
@@ -875,8 +901,7 @@ export var schema;
875
901
  * Orders for which `remaining <= 0` or that have an `OrderCancelled`
876
902
  * event are excluded from the response.
877
903
  */
878
- getOrders.RestingOrder = z
879
- .object({
904
+ getOrders.RestingOrder = Schema.describe(z.object({
880
905
  amount: Schema.DecimalString.check(z.describe('Original placed amount, returned as a decimal integer string in base-token smallest units.')),
881
906
  blockNumber: z
882
907
  .number()
@@ -904,27 +929,26 @@ export var schema;
904
929
  .number()
905
930
  .check(z.int(), z.describe('Order tick as a signed offset from peg; one tick equals `1/priceScale`.'), z.meta({ examples: [0] })),
906
931
  transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction that placed the order.')),
907
- })
908
- .check(z.describe('One resting maker order on Tempo’s built-in stablecoin exchange.'));
932
+ }), 'One resting maker order on Tempo’s built-in stablecoin exchange.');
909
933
  /** A resting maker order annotated with the trading pair it belongs to. */
910
- getOrders.Order = z
911
- .extend(getOrders.RestingOrder, {
934
+ getOrders.Order = OpenApi.component(Schema.describe(z.extend(getOrders.RestingOrder, {
912
935
  pair: order.Pair,
913
- })
914
- .check(z.describe('A resting maker order plus its trading pair.'));
936
+ }), 'A resting maker order plus its trading pair.'), 'ExchangeRestingOrder');
937
+ /** Response metadata requested through `include`, such as capped counts. */
938
+ getOrders.Meta = OpenApi.component(Schema.CountMeta, 'ExchangeOrderListMeta');
915
939
  /** Page of resting maker orders, each annotated with its trading pair. */
916
- getOrders.Response = z
940
+ getOrders.Response = OpenApi.component(z
917
941
  .object({
918
942
  data: z.array(getOrders.Order).check(z.describe('Resting orders returned on this page.')),
919
943
  meta: z
920
- .optional(Schema.CountMeta)
944
+ .optional(getOrders.Meta)
921
945
  .check(z.describe('Response-level resources requested with `include`, such as `totalCount`.')),
922
946
  nextCursor: Schema.NextCursor,
923
947
  truncated: z
924
948
  .boolean()
925
949
  .check(z.describe('`true` when the `OrderPlaced` scan hit its hard cap, meaning the resting set was computed from only the most recent placements.'), z.meta({ examples: [false] })),
926
950
  })
927
- .check(z.describe('A paginated list of resting maker orders on Tempo’s built-in stablecoin exchange.'));
951
+ .check(z.describe('A paginated list of resting maker orders on Tempo’s built-in stablecoin exchange.')), 'ExchangeOrderList');
928
952
  })(getOrders = schema.getOrders || (schema.getOrders = {}));
929
953
  /** Schemas for the getOrderFills operation. */
930
954
  let getOrderFills;
@@ -947,7 +971,7 @@ export var schema;
947
971
  * rate are constant across all fills, so they live on the `Order`
948
972
  * resource rather than being repeated per row.
949
973
  */
950
- getOrderFills.Fill = z
974
+ getOrderFills.Fill = OpenApi.component(z
951
975
  .object({
952
976
  amountFilled: Schema.DecimalString.check(z.describe('Base-side amount filled by this event, returned as a decimal integer string in base-token smallest units.')),
953
977
  blockNumber: z
@@ -969,17 +993,19 @@ export var schema;
969
993
  taker: Schema.Address.check(z.describe('Taker address that submitted the incoming order.')),
970
994
  transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction containing the fill.')),
971
995
  })
972
- .check(z.describe('One `OrderFilled` event against this order.'));
996
+ .check(z.describe('One `OrderFilled` event against this order.')), 'ExchangeOrderFill');
997
+ /** Response metadata requested through `include`, such as capped counts. */
998
+ getOrderFills.Meta = OpenApi.component(Schema.CountMeta, 'ExchangeOrderFillListMeta');
973
999
  /** Paginated page of fills for one order. */
974
- getOrderFills.Response = z
1000
+ getOrderFills.Response = OpenApi.component(z
975
1001
  .object({
976
1002
  data: z.array(getOrderFills.Fill).check(z.describe('Fills returned on this page.')),
977
1003
  meta: z
978
- .optional(Schema.CountMeta)
1004
+ .optional(getOrderFills.Meta)
979
1005
  .check(z.describe('Response-level resources requested with `include`.')),
980
1006
  nextCursor: Schema.NextCursor,
981
1007
  })
982
- .check(z.describe('A paginated list of fill events for one DEX order.'));
1008
+ .check(z.describe('A paginated list of fill events for one DEX order.')), 'ExchangeOrderFillList');
983
1009
  })(getOrderFills = schema.getOrderFills || (schema.getOrderFills = {}));
984
1010
  /** Schemas for the getPairDepth operation (orderbook depth aggregation). */
985
1011
  let getPairDepth;
@@ -1023,11 +1049,13 @@ export var schema;
1023
1049
  * side, starting from the best (peg-adjacent) populated tick and walking
1024
1050
  * outward.
1025
1051
  */
1026
- getPairDepth.Level = z
1052
+ getPairDepth.Level = OpenApi.component(z
1027
1053
  .object({
1028
1054
  cumulativeSize: Schema.DecimalString.check(z.describe('Running sum of `size` from the best populated tick outward to this level, in base-token smallest units.')),
1029
1055
  id: z.string().check(z.describe('Stable API id built from the pair key, orderbook side, and tick.'), z.meta({
1030
- examples: ['0x515801d7f9a5ac705e793e85904c9c69b3f1694b465cc8fb6ba3f0298dc82665-bid-0'],
1056
+ examples: [
1057
+ '0x515801d7f9a5ac705e793e85904c9c69b3f1694b465cc8fb6ba3f0298dc82665-bid-0',
1058
+ ],
1031
1059
  })),
1032
1060
  price: z
1033
1061
  .string()
@@ -1037,20 +1065,20 @@ export var schema;
1037
1065
  .number()
1038
1066
  .check(z.int(), z.describe('Signed price tick (`int16`), always a multiple of the DEX tick spacing.'), z.meta({ examples: [0] })),
1039
1067
  })
1040
- .check(z.describe('One price level in the orderbook depth response.'));
1068
+ .check(z.describe('One price level in the orderbook depth response.')), 'ExchangeDepthLevel');
1041
1069
  /** Orderbook depth (cumulative size per tick) for a single trading pair. */
1042
- getPairDepth.Response = z
1070
+ getPairDepth.Response = OpenApi.component(z
1043
1071
  .object({
1044
1072
  asks: z
1045
1073
  .array(getPairDepth.Level)
1046
1074
  .check(z.describe('Ask-side levels, where makers sell base and takers buy it, ordered from best lowest ask outward.')),
1047
- base: schema.PairToken.check(z.describe('Base side of the trading pair.')),
1075
+ base: schema.PairToken,
1048
1076
  bids: z
1049
1077
  .array(getPairDepth.Level)
1050
1078
  .check(z.describe('Bid-side levels, where makers buy base and takers sell it, ordered from best highest bid outward.')),
1051
- quote: schema.PairToken.check(z.describe('Quote side of the trading pair.')),
1079
+ quote: schema.PairToken,
1052
1080
  })
1053
- .check(z.describe('Orderbook depth for one trading pair, with cumulative size at each tick.'));
1081
+ .check(z.describe('Orderbook depth for one trading pair, with cumulative size at each tick.')), 'ExchangePairDepth');
1054
1082
  })(getPairDepth = schema.getPairDepth || (schema.getPairDepth = {}));
1055
1083
  })(schema || (schema = {}));
1056
1084
  /**
@@ -1086,7 +1114,15 @@ export function exchanges(options = {}) {
1086
1114
  operationId: 'createExchangeQuote',
1087
1115
  responses: OpenApi.responses({
1088
1116
  errors: {
1089
- 400: { codes: ['body_invalid', 'query_invalid', 'quote_amount_out_of_range'] },
1117
+ 400: {
1118
+ codes: [
1119
+ 'body_invalid',
1120
+ 'chain_id_invalid',
1121
+ 'chain_id_unsupported',
1122
+ 'query_invalid',
1123
+ 'quote_amount_out_of_range',
1124
+ ],
1125
+ },
1090
1126
  404: {
1091
1127
  codes: ['quote_not_available'],
1092
1128
  description: 'No configured provider can price an executable exchange for these terms.',
@@ -1372,6 +1408,8 @@ export function exchanges(options = {}) {
1372
1408
  400: {
1373
1409
  codes: [
1374
1410
  'body_invalid',
1411
+ 'chain_id_invalid',
1412
+ 'chain_id_unsupported',
1375
1413
  'query_invalid',
1376
1414
  'swap_continuation_invalid',
1377
1415
  'swap_provider_invalid',
@@ -1455,6 +1493,9 @@ export function exchanges(options = {}) {
1455
1493
  operationId: 'getSwaps',
1456
1494
  responses: OpenApi.responses({
1457
1495
  errors: {
1496
+ 400: {
1497
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
1498
+ },
1458
1499
  502: 'The indexer or Tempo RPC could not serve the exchange data right now.',
1459
1500
  },
1460
1501
  success: {
@@ -1600,7 +1641,12 @@ export function exchanges(options = {}) {
1600
1641
  description: 'List trading pairs available on Tempo’s built-in stablecoin exchange.',
1601
1642
  operationId: 'getPairs',
1602
1643
  responses: OpenApi.responses({
1603
- errors: { 502: 'The indexer could not serve the exchange data right now.' },
1644
+ errors: {
1645
+ 400: {
1646
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
1647
+ },
1648
+ 502: 'The indexer could not serve the exchange data right now.',
1649
+ },
1604
1650
  success: {
1605
1651
  description: 'A page of exchange trading pairs.',
1606
1652
  schema: schema.getPairs.Response,
@@ -1700,6 +1746,9 @@ export function exchanges(options = {}) {
1700
1746
  operationId: 'getPair',
1701
1747
  responses: OpenApi.responses({
1702
1748
  errors: {
1749
+ 400: {
1750
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
1751
+ },
1703
1752
  404: {
1704
1753
  description: 'No exchange pair was found for that base token.',
1705
1754
  codes: ['pair_not_found'],
@@ -1781,6 +1830,9 @@ export function exchanges(options = {}) {
1781
1830
  operationId: 'getOrders',
1782
1831
  responses: OpenApi.responses({
1783
1832
  errors: {
1833
+ 400: {
1834
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
1835
+ },
1784
1836
  404: {
1785
1837
  description: 'No exchange pair was found for the requested `base` filter.',
1786
1838
  codes: ['pair_not_found'],
@@ -1897,6 +1949,9 @@ export function exchanges(options = {}) {
1897
1949
  operationId: 'getOrder',
1898
1950
  responses: OpenApi.responses({
1899
1951
  errors: {
1952
+ 400: {
1953
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'order_invalid', 'query_invalid'],
1954
+ },
1900
1955
  404: {
1901
1956
  description: 'No exchange order was found for that id.',
1902
1957
  codes: ['order_not_found'],
@@ -1989,7 +2044,12 @@ export function exchanges(options = {}) {
1989
2044
  description: 'List fills for one order. A fill records an execution against the maker order.',
1990
2045
  operationId: 'getOrderFills',
1991
2046
  responses: OpenApi.responses({
1992
- errors: { 502: 'The indexer could not serve the exchange data right now.' },
2047
+ errors: {
2048
+ 400: {
2049
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'order_invalid', 'query_invalid'],
2050
+ },
2051
+ 502: 'The indexer could not serve the exchange data right now.',
2052
+ },
1993
2053
  success: {
1994
2054
  description: 'A page of fills for one order.',
1995
2055
  schema: schema.getOrderFills.Response,
@@ -2065,6 +2125,9 @@ export function exchanges(options = {}) {
2065
2125
  operationId: 'getPairOhlc',
2066
2126
  responses: OpenApi.responses({
2067
2127
  errors: {
2128
+ 400: {
2129
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
2130
+ },
2068
2131
  404: {
2069
2132
  description: 'No exchange pair was found for that base token.',
2070
2133
  codes: ['pair_not_found'],
@@ -2162,6 +2225,9 @@ export function exchanges(options = {}) {
2162
2225
  operationId: 'getPairDepth',
2163
2226
  responses: OpenApi.responses({
2164
2227
  errors: {
2228
+ 400: {
2229
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
2230
+ },
2165
2231
  404: {
2166
2232
  description: 'No exchange pair was found for that base token.',
2167
2233
  codes: ['pair_not_found'],