tapimo 0.11.0 → 0.13.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 (443) hide show
  1. package/dist/App.d.ts +6396 -4575
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +39 -4
  4. package/dist/App.js.map +1 -1
  5. package/dist/Assets.d.ts +15 -0
  6. package/dist/Assets.d.ts.map +1 -1
  7. package/dist/Assets.js +7 -0
  8. package/dist/Assets.js.map +1 -1
  9. package/dist/Scope.d.ts +2 -0
  10. package/dist/Scope.d.ts.map +1 -1
  11. package/dist/Scope.js +17 -0
  12. package/dist/Scope.js.map +1 -1
  13. package/dist/admin/App.d.ts +176 -78
  14. package/dist/admin/App.d.ts.map +1 -1
  15. package/dist/admin/apps/api-keys.d.ts +84 -4
  16. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  17. package/dist/admin/apps/api-keys.js +54 -0
  18. package/dist/admin/apps/api-keys.js.map +1 -1
  19. package/dist/admin/apps/earn-vaults.d.ts +123 -9
  20. package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
  21. package/dist/admin/apps/earn-vaults.js +60 -7
  22. package/dist/admin/apps/earn-vaults.js.map +1 -1
  23. package/dist/admin/apps/organizations.d.ts.map +1 -1
  24. package/dist/admin/apps/organizations.js +4 -2
  25. package/dist/admin/apps/organizations.js.map +1 -1
  26. package/dist/admin/apps/verified-tokens.d.ts +90 -90
  27. package/dist/admin/ui.generated.d.ts +1 -1
  28. package/dist/admin/ui.generated.js +71 -71
  29. package/dist/admin/ui.generated.js.map +1 -1
  30. package/dist/apps/Zones.d.ts +16 -16
  31. package/dist/apps/Zones.js +4 -4
  32. package/dist/apps/data/App.d.ts +1699 -749
  33. package/dist/apps/data/App.d.ts.map +1 -1
  34. package/dist/apps/data/App.js +58 -9
  35. package/dist/apps/data/App.js.map +1 -1
  36. package/dist/apps/data/ZoneSelection.d.ts +62 -0
  37. package/dist/apps/data/ZoneSelection.d.ts.map +1 -0
  38. package/dist/apps/data/ZoneSelection.js +44 -0
  39. package/dist/apps/data/ZoneSelection.js.map +1 -0
  40. package/dist/apps/data/routes/activities.d.ts +2417 -50
  41. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  42. package/dist/apps/data/routes/activities.js +1896 -1293
  43. package/dist/apps/data/routes/activities.js.map +1 -1
  44. package/dist/apps/data/routes/addresses.d.ts +471 -340
  45. package/dist/apps/data/routes/addresses.d.ts.map +1 -1
  46. package/dist/apps/data/routes/balances.d.ts +12 -12
  47. package/dist/apps/data/routes/balances.d.ts.map +1 -1
  48. package/dist/apps/data/routes/balances.js +44 -17
  49. package/dist/apps/data/routes/balances.js.map +1 -1
  50. package/dist/apps/data/routes/blocks.d.ts +42 -42
  51. package/dist/apps/data/routes/blocks.d.ts.map +1 -1
  52. package/dist/apps/data/routes/blocks.js +22 -12
  53. package/dist/apps/data/routes/blocks.js.map +1 -1
  54. package/dist/apps/data/routes/coingecko.d.ts +179 -179
  55. package/dist/apps/data/routes/earn.d.ts +144 -19
  56. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  57. package/dist/apps/data/routes/earn.js +160 -28
  58. package/dist/apps/data/routes/earn.js.map +1 -1
  59. package/dist/apps/data/routes/exchanges.d.ts +719 -13
  60. package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
  61. package/dist/apps/data/routes/exchanges.js +16 -13
  62. package/dist/apps/data/routes/exchanges.js.map +1 -1
  63. package/dist/apps/data/routes/fee-amm.d.ts +2 -2
  64. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
  65. package/dist/apps/data/routes/fee-amm.js +9 -11
  66. package/dist/apps/data/routes/fee-amm.js.map +1 -1
  67. package/dist/apps/data/routes/indexer.d.ts +34 -34
  68. package/dist/apps/data/routes/receipts.d.ts +363 -263
  69. package/dist/apps/data/routes/receipts.d.ts.map +1 -1
  70. package/dist/apps/data/routes/receipts.js +29 -11
  71. package/dist/apps/data/routes/receipts.js.map +1 -1
  72. package/dist/apps/data/routes/rpc.js +24 -10
  73. package/dist/apps/data/routes/rpc.js.map +1 -1
  74. package/dist/apps/data/routes/tokenlist.d.ts +13 -13
  75. package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
  76. package/dist/apps/data/routes/tokenlist.js +16 -15
  77. package/dist/apps/data/routes/tokenlist.js.map +1 -1
  78. package/dist/apps/data/routes/tokens.d.ts +112 -98
  79. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  80. package/dist/apps/data/routes/tokens.js +85 -35
  81. package/dist/apps/data/routes/tokens.js.map +1 -1
  82. package/dist/apps/data/routes/transactions.d.ts +7 -2
  83. package/dist/apps/data/routes/transactions.d.ts.map +1 -1
  84. package/dist/apps/data/routes/transactions.js +38 -18
  85. package/dist/apps/data/routes/transactions.js.map +1 -1
  86. package/dist/apps/data/routes/transfers.d.ts +1 -1
  87. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  88. package/dist/apps/data/routes/transfers.js +25 -21
  89. package/dist/apps/data/routes/transfers.js.map +1 -1
  90. package/dist/apps/data/routes/valuation.d.ts +1 -1
  91. package/dist/apps/data/routes/valuation.d.ts.map +1 -1
  92. package/dist/apps/data/routes/valuation.js +12 -7
  93. package/dist/apps/data/routes/valuation.js.map +1 -1
  94. package/dist/apps/data/routes/verified-tokens.d.ts +3 -3
  95. package/dist/apps/data/routes/webhooks.d.ts +15 -15
  96. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  97. package/dist/apps/data/routes/webhooks.js +2 -2
  98. package/dist/apps/data/routes/webhooks.js.map +1 -1
  99. package/dist/apps/data/routes/zones.d.ts +32 -32
  100. package/dist/apps/data/routes/zones.js +1 -1
  101. package/dist/apps/funding/App.d.ts +38 -27
  102. package/dist/apps/funding/App.d.ts.map +1 -1
  103. package/dist/apps/funding/routes/chains.d.ts.map +1 -1
  104. package/dist/apps/funding/routes/chains.js +5 -4
  105. package/dist/apps/funding/routes/chains.js.map +1 -1
  106. package/dist/apps/funding/routes/deposit-addresses.d.ts +16 -16
  107. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
  108. package/dist/apps/funding/routes/deposit-addresses.js +24 -19
  109. package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
  110. package/dist/apps/funding/routes/providers.d.ts +13 -13
  111. package/dist/apps/funding/routes/providers.d.ts.map +1 -1
  112. package/dist/apps/funding/routes/providers.js +3 -2
  113. package/dist/apps/funding/routes/providers.js.map +1 -1
  114. package/dist/apps/funding/routes/quotes.d.ts.map +1 -1
  115. package/dist/apps/funding/routes/quotes.js +2 -2
  116. package/dist/apps/funding/routes/quotes.js.map +1 -1
  117. package/dist/apps/funding/routes/transfers.d.ts +60 -48
  118. package/dist/apps/funding/routes/transfers.d.ts.map +1 -1
  119. package/dist/apps/funding/routes/transfers.js +27 -19
  120. package/dist/apps/funding/routes/transfers.js.map +1 -1
  121. package/dist/apps/management/App.d.ts +4558 -3700
  122. package/dist/apps/management/App.d.ts.map +1 -1
  123. package/dist/apps/management/Billing.d.ts.map +1 -1
  124. package/dist/apps/management/Billing.js +19 -6
  125. package/dist/apps/management/Billing.js.map +1 -1
  126. package/dist/apps/management/routes/api-keys.d.ts +786 -175
  127. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  128. package/dist/apps/management/routes/api-keys.js +312 -34
  129. package/dist/apps/management/routes/api-keys.js.map +1 -1
  130. package/dist/apps/management/routes/billing.d.ts +103 -30
  131. package/dist/apps/management/routes/billing.d.ts.map +1 -1
  132. package/dist/apps/management/routes/billing.js +91 -32
  133. package/dist/apps/management/routes/billing.js.map +1 -1
  134. package/dist/apps/management/routes/faucet.d.ts +35 -35
  135. package/dist/apps/management/routes/faucet.d.ts.map +1 -1
  136. package/dist/apps/management/routes/faucet.js +23 -12
  137. package/dist/apps/management/routes/faucet.js.map +1 -1
  138. package/dist/apps/management/routes/invitations.d.ts +46 -13
  139. package/dist/apps/management/routes/invitations.d.ts.map +1 -1
  140. package/dist/apps/management/routes/invitations.js +79 -29
  141. package/dist/apps/management/routes/invitations.js.map +1 -1
  142. package/dist/apps/management/routes/invite-links.d.ts +120 -75
  143. package/dist/apps/management/routes/invite-links.d.ts.map +1 -1
  144. package/dist/apps/management/routes/invite-links.js +100 -41
  145. package/dist/apps/management/routes/invite-links.js.map +1 -1
  146. package/dist/apps/management/routes/me.d.ts +5 -5
  147. package/dist/apps/management/routes/me.d.ts.map +1 -1
  148. package/dist/apps/management/routes/me.js +14 -10
  149. package/dist/apps/management/routes/me.js.map +1 -1
  150. package/dist/apps/management/routes/members.d.ts +99 -78
  151. package/dist/apps/management/routes/members.d.ts.map +1 -1
  152. package/dist/apps/management/routes/members.js +37 -18
  153. package/dist/apps/management/routes/members.js.map +1 -1
  154. package/dist/apps/management/routes/orgs.d.ts +48 -8
  155. package/dist/apps/management/routes/orgs.d.ts.map +1 -1
  156. package/dist/apps/management/routes/orgs.js +48 -19
  157. package/dist/apps/management/routes/orgs.js.map +1 -1
  158. package/dist/apps/management/routes/projects.d.ts +108 -46
  159. package/dist/apps/management/routes/projects.d.ts.map +1 -1
  160. package/dist/apps/management/routes/projects.js +72 -21
  161. package/dist/apps/management/routes/projects.js.map +1 -1
  162. package/dist/apps/management/routes/scopes.d.ts.map +1 -1
  163. package/dist/apps/management/routes/scopes.js +8 -5
  164. package/dist/apps/management/routes/scopes.js.map +1 -1
  165. package/dist/apps/management/routes/usage.d.ts +82 -82
  166. package/dist/apps/management/routes/usage.d.ts.map +1 -1
  167. package/dist/apps/management/routes/usage.js +41 -31
  168. package/dist/apps/management/routes/usage.js.map +1 -1
  169. package/dist/apps/management/routes/verified-token-requests.d.ts +35 -7
  170. package/dist/apps/management/routes/verified-token-requests.d.ts.map +1 -1
  171. package/dist/apps/management/routes/verified-token-requests.js +36 -17
  172. package/dist/apps/management/routes/verified-token-requests.js.map +1 -1
  173. package/dist/apps/management/routes/webhooks.d.ts +200 -183
  174. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  175. package/dist/apps/management/routes/webhooks.js +80 -35
  176. package/dist/apps/management/routes/webhooks.js.map +1 -1
  177. package/dist/apps/mpp/internal/Adapter.d.ts +1 -1
  178. package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
  179. package/dist/apps/mpp/internal/Adapter.js +12 -0
  180. package/dist/apps/mpp/internal/Adapter.js.map +1 -1
  181. package/dist/db/Db.d.ts +2 -0
  182. package/dist/db/Db.d.ts.map +1 -1
  183. package/dist/db/Db.js +52 -1
  184. package/dist/db/Db.js.map +1 -1
  185. package/dist/db/Schema.d.ts +26 -3
  186. package/dist/db/Schema.d.ts.map +1 -1
  187. package/dist/db/Schema.js +24 -5
  188. package/dist/db/Schema.js.map +1 -1
  189. package/dist/db/tables/earnVaults.d.ts +5 -1
  190. package/dist/db/tables/earnVaults.d.ts.map +1 -1
  191. package/dist/db/tables/earnVaults.js +5 -0
  192. package/dist/db/tables/earnVaults.js.map +1 -1
  193. package/dist/db/tables/fundingCatalog.d.ts +4 -2
  194. package/dist/db/tables/fundingCatalog.d.ts.map +1 -1
  195. package/dist/db/tables/fundingCatalog.js +5 -1
  196. package/dist/db/tables/fundingCatalog.js.map +1 -1
  197. package/dist/db/tables/webhookDeliveries.d.ts.map +1 -1
  198. package/dist/db/tables/webhookDeliveries.js +10 -0
  199. package/dist/db/tables/webhookDeliveries.js.map +1 -1
  200. package/dist/db/tables/webhookQueueCompletions.d.ts +15 -0
  201. package/dist/db/tables/webhookQueueCompletions.d.ts.map +1 -0
  202. package/dist/db/tables/webhookQueueCompletions.js +32 -0
  203. package/dist/db/tables/webhookQueueCompletions.js.map +1 -0
  204. package/dist/db/tables/webhookQueueEvents.d.ts +14 -20
  205. package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
  206. package/dist/db/tables/webhookQueueEvents.js +68 -47
  207. package/dist/db/tables/webhookQueueEvents.js.map +1 -1
  208. package/dist/db/tables/webhookSubscriptions.d.ts +16 -5
  209. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  210. package/dist/db/tables/webhookSubscriptions.js +29 -5
  211. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  212. package/dist/handlers/internal/utils.d.ts.map +1 -1
  213. package/dist/handlers/internal/utils.js +9 -0
  214. package/dist/handlers/internal/utils.js.map +1 -1
  215. package/dist/internal/Auth.d.ts +11 -2
  216. package/dist/internal/Auth.d.ts.map +1 -1
  217. package/dist/internal/Auth.js +19 -6
  218. package/dist/internal/Auth.js.map +1 -1
  219. package/dist/internal/Cache.d.ts.map +1 -1
  220. package/dist/internal/Cache.js +11 -7
  221. package/dist/internal/Cache.js.map +1 -1
  222. package/dist/internal/EarnVaults.d.ts +43 -4
  223. package/dist/internal/EarnVaults.d.ts.map +1 -1
  224. package/dist/internal/EarnVaults.js +167 -0
  225. package/dist/internal/EarnVaults.js.map +1 -1
  226. package/dist/internal/Fetch.d.ts +23 -0
  227. package/dist/internal/Fetch.d.ts.map +1 -0
  228. package/dist/internal/Fetch.js +26 -0
  229. package/dist/internal/Fetch.js.map +1 -0
  230. package/dist/internal/Log.d.ts +3 -1
  231. package/dist/internal/Log.d.ts.map +1 -1
  232. package/dist/internal/Log.js +16 -3
  233. package/dist/internal/Log.js.map +1 -1
  234. package/dist/internal/OpenApi.d.ts +30 -24
  235. package/dist/internal/OpenApi.d.ts.map +1 -1
  236. package/dist/internal/OpenApi.js +140 -41
  237. package/dist/internal/OpenApi.js.map +1 -1
  238. package/dist/internal/Response.d.ts +14 -9
  239. package/dist/internal/Response.d.ts.map +1 -1
  240. package/dist/internal/Response.js +16 -5
  241. package/dist/internal/Response.js.map +1 -1
  242. package/dist/internal/Schema.d.ts +11 -10
  243. package/dist/internal/Schema.d.ts.map +1 -1
  244. package/dist/internal/Schema.js +14 -9
  245. package/dist/internal/Schema.js.map +1 -1
  246. package/dist/internal/Store.d.ts +28 -6
  247. package/dist/internal/Store.d.ts.map +1 -1
  248. package/dist/internal/Store.js +121 -25
  249. package/dist/internal/Store.js.map +1 -1
  250. package/dist/internal/Tidx.d.ts +2 -0
  251. package/dist/internal/Tidx.d.ts.map +1 -1
  252. package/dist/internal/Tidx.js +23 -6
  253. package/dist/internal/Tidx.js.map +1 -1
  254. package/dist/internal/Timeout.d.ts +36 -0
  255. package/dist/internal/Timeout.d.ts.map +1 -0
  256. package/dist/internal/Timeout.js +37 -0
  257. package/dist/internal/Timeout.js.map +1 -0
  258. package/dist/internal/Timing.d.ts +9 -0
  259. package/dist/internal/Timing.d.ts.map +1 -1
  260. package/dist/internal/Timing.js +7 -0
  261. package/dist/internal/Timing.js.map +1 -1
  262. package/dist/internal/WebhookDestination.d.ts.map +1 -1
  263. package/dist/internal/WebhookDestination.js +3 -0
  264. package/dist/internal/WebhookDestination.js.map +1 -1
  265. package/dist/internal/Webhooks.d.ts +29 -12
  266. package/dist/internal/Webhooks.d.ts.map +1 -1
  267. package/dist/internal/Webhooks.js +37 -20
  268. package/dist/internal/Webhooks.js.map +1 -1
  269. package/dist/internal/funding/Action.d.ts +9 -0
  270. package/dist/internal/funding/Action.d.ts.map +1 -1
  271. package/dist/internal/funding/Action.js +16 -8
  272. package/dist/internal/funding/Action.js.map +1 -1
  273. package/dist/internal/funding/Catalog.d.ts +9 -2
  274. package/dist/internal/funding/Catalog.d.ts.map +1 -1
  275. package/dist/internal/funding/Catalog.js +19 -8
  276. package/dist/internal/funding/Catalog.js.map +1 -1
  277. package/dist/internal/funding/Deposit.d.ts +2 -2
  278. package/dist/internal/funding/Deposit.d.ts.map +1 -1
  279. package/dist/internal/funding/Deposit.js +9 -8
  280. package/dist/internal/funding/Deposit.js.map +1 -1
  281. package/dist/internal/funding/DepositAddress.d.ts +4 -4
  282. package/dist/internal/funding/DepositAddress.d.ts.map +1 -1
  283. package/dist/internal/funding/DepositAddress.js +9 -8
  284. package/dist/internal/funding/DepositAddress.js.map +1 -1
  285. package/dist/internal/funding/Provider.d.ts +68 -13
  286. package/dist/internal/funding/Provider.d.ts.map +1 -1
  287. package/dist/internal/funding/Provider.js +42 -20
  288. package/dist/internal/funding/Provider.js.map +1 -1
  289. package/dist/internal/funding/Transfer.d.ts +13 -12
  290. package/dist/internal/funding/Transfer.d.ts.map +1 -1
  291. package/dist/internal/funding/Transfer.js +23 -21
  292. package/dist/internal/funding/Transfer.js.map +1 -1
  293. package/dist/internal/funding/providers/stargate.d.ts +38 -0
  294. package/dist/internal/funding/providers/stargate.d.ts.map +1 -0
  295. package/dist/internal/funding/providers/stargate.js +277 -0
  296. package/dist/internal/funding/providers/stargate.js.map +1 -0
  297. package/dist/internal/index.d.ts +1 -0
  298. package/dist/internal/index.d.ts.map +1 -1
  299. package/dist/internal/index.js +1 -0
  300. package/dist/internal/index.js.map +1 -1
  301. package/dist/providers/index.d.ts +7 -0
  302. package/dist/providers/index.d.ts.map +1 -1
  303. package/dist/providers/index.js +3 -0
  304. package/dist/providers/index.js.map +1 -1
  305. package/package.json +3 -3
  306. package/src/App.test.ts +148 -0
  307. package/src/App.ts +45 -4
  308. package/src/Assets.test.ts +18 -0
  309. package/src/Assets.ts +22 -0
  310. package/src/Client.test-d.ts +311 -16
  311. package/src/Scope.test.ts +20 -0
  312. package/src/Scope.ts +16 -0
  313. package/src/admin/apps/api-keys.test.ts +75 -0
  314. package/src/admin/apps/api-keys.ts +64 -0
  315. package/src/admin/apps/earn-vaults.test.ts +143 -0
  316. package/src/admin/apps/earn-vaults.ts +84 -7
  317. package/src/admin/apps/organizations.ts +6 -2
  318. package/src/admin/ui/src/lib/api-keys.ts +19 -0
  319. package/src/admin/ui/src/routes/api-keys.tsx +125 -2
  320. package/src/admin/ui.generated.ts +71 -71
  321. package/src/apps/Zones.test.ts +4 -4
  322. package/src/apps/Zones.ts +4 -4
  323. package/src/apps/composition.test.ts +1 -1
  324. package/src/apps/data/App.test.ts +72 -0
  325. package/src/apps/data/App.ts +58 -10
  326. package/src/apps/data/ZoneSelection.test.ts +196 -0
  327. package/src/apps/data/ZoneSelection.ts +108 -0
  328. package/src/apps/data/routes/activities.test.ts +1843 -2
  329. package/src/apps/data/routes/activities.ts +2211 -1388
  330. package/src/apps/data/routes/balances.ts +134 -98
  331. package/src/apps/data/routes/blocks.test.ts +533 -0
  332. package/src/apps/data/routes/blocks.ts +36 -17
  333. package/src/apps/data/routes/earn.test.ts +187 -25
  334. package/src/apps/data/routes/earn.ts +228 -32
  335. package/src/apps/data/routes/earn.zone-access.test.ts +46 -0
  336. package/src/apps/data/routes/exchanges.test.ts +31 -1
  337. package/src/apps/data/routes/exchanges.ts +19 -15
  338. package/src/apps/data/routes/fee-amm.ts +18 -11
  339. package/src/apps/data/routes/receipts.ts +48 -17
  340. package/src/apps/data/routes/rpc.test.ts +75 -0
  341. package/src/apps/data/routes/rpc.ts +23 -9
  342. package/src/apps/data/routes/tokenlist.ts +21 -18
  343. package/src/apps/data/routes/tokens.test.ts +607 -0
  344. package/src/apps/data/routes/tokens.ts +312 -231
  345. package/src/apps/data/routes/transactions.ts +69 -30
  346. package/src/apps/data/routes/transfers.test.ts +424 -3
  347. package/src/apps/data/routes/transfers.ts +57 -36
  348. package/src/apps/data/routes/valuation.ts +94 -78
  349. package/src/apps/data/routes/webhooks.ts +6 -2
  350. package/src/apps/data/routes/zones.test.ts +21 -15
  351. package/src/apps/data/routes/zones.ts +1 -1
  352. package/src/apps/funding/routes/chains.test.ts +211 -7
  353. package/src/apps/funding/routes/chains.ts +19 -12
  354. package/src/apps/funding/routes/deposit-addresses.test.ts +416 -0
  355. package/src/apps/funding/routes/deposit-addresses.ts +101 -84
  356. package/src/apps/funding/routes/providers.ts +9 -5
  357. package/src/apps/funding/routes/quotes.test.ts +42 -0
  358. package/src/apps/funding/routes/quotes.ts +8 -5
  359. package/src/apps/funding/routes/transfers.test.ts +430 -40
  360. package/src/apps/funding/routes/transfers.ts +76 -59
  361. package/src/apps/management/Billing.test.ts +26 -0
  362. package/src/apps/management/Billing.ts +24 -7
  363. package/src/apps/management/routes/api-keys.test.ts +398 -0
  364. package/src/apps/management/routes/api-keys.ts +481 -145
  365. package/src/apps/management/routes/billing.test.ts +209 -0
  366. package/src/apps/management/routes/billing.ts +254 -177
  367. package/src/apps/management/routes/faucet.test.ts +39 -0
  368. package/src/apps/management/routes/faucet.ts +75 -41
  369. package/src/apps/management/routes/invitations.test.ts +216 -0
  370. package/src/apps/management/routes/invitations.ts +186 -109
  371. package/src/apps/management/routes/invite-links.test.ts +263 -1
  372. package/src/apps/management/routes/invite-links.ts +295 -214
  373. package/src/apps/management/routes/me.test.ts +49 -0
  374. package/src/apps/management/routes/me.ts +42 -32
  375. package/src/apps/management/routes/members.test.ts +124 -1
  376. package/src/apps/management/routes/members.ts +81 -51
  377. package/src/apps/management/routes/orgs.test.ts +176 -0
  378. package/src/apps/management/routes/orgs.ts +101 -59
  379. package/src/apps/management/routes/projects.test.ts +183 -0
  380. package/src/apps/management/routes/projects.ts +124 -60
  381. package/src/apps/management/routes/scopes.test.ts +44 -0
  382. package/src/apps/management/routes/scopes.ts +37 -28
  383. package/src/apps/management/routes/usage.test.ts +92 -0
  384. package/src/apps/management/routes/usage.ts +186 -151
  385. package/src/apps/management/routes/verified-token-requests.test.ts +114 -0
  386. package/src/apps/management/routes/verified-token-requests.ts +166 -133
  387. package/src/apps/management/routes/webhooks.test.ts +234 -0
  388. package/src/apps/management/routes/webhooks.ts +191 -78
  389. package/src/apps/mpp/internal/Adapter.ts +13 -1
  390. package/src/db/Db.test.ts +41 -0
  391. package/src/db/Db.ts +75 -1
  392. package/src/db/Schema.ts +33 -5
  393. package/src/db/tables/earnVaults.test.ts +22 -0
  394. package/src/db/tables/earnVaults.ts +11 -1
  395. package/src/db/tables/fundingCatalog.test.ts +16 -2
  396. package/src/db/tables/fundingCatalog.ts +9 -3
  397. package/src/db/tables/webhookDeliveries.ts +13 -0
  398. package/src/db/tables/webhookQueueCompletions.ts +55 -0
  399. package/src/db/tables/webhookQueueEvents.ts +95 -61
  400. package/src/db/tables/webhookSubscriptions.ts +45 -6
  401. package/src/handlers/internal/utils.test.ts +53 -0
  402. package/src/handlers/internal/utils.ts +15 -0
  403. package/src/internal/Auth.ts +35 -9
  404. package/src/internal/Cache.ts +14 -7
  405. package/src/internal/EarnVaults.capabilities.test.ts +33 -0
  406. package/src/internal/EarnVaults.test.ts +79 -0
  407. package/src/internal/EarnVaults.ts +277 -0
  408. package/src/internal/Fetch.test.ts +46 -0
  409. package/src/internal/Fetch.ts +56 -0
  410. package/src/internal/Log.test.ts +21 -0
  411. package/src/internal/Log.ts +20 -5
  412. package/src/internal/OpenApi.ts +177 -51
  413. package/src/internal/Response.test.ts +95 -0
  414. package/src/internal/Response.ts +41 -3
  415. package/src/internal/Schema.test.ts +18 -0
  416. package/src/internal/Schema.ts +19 -9
  417. package/src/internal/Store.test.ts +364 -0
  418. package/src/internal/Store.ts +153 -27
  419. package/src/internal/Tidx.test.ts +21 -1
  420. package/src/internal/Tidx.ts +23 -6
  421. package/src/internal/Timeout.test.ts +35 -0
  422. package/src/internal/Timeout.ts +73 -0
  423. package/src/internal/Timing.ts +16 -0
  424. package/src/internal/WebhookDestination.ts +3 -0
  425. package/src/internal/Webhooks.test.ts +122 -8
  426. package/src/internal/Webhooks.ts +59 -29
  427. package/src/internal/funding/Action.test.ts +41 -1
  428. package/src/internal/funding/Action.ts +69 -41
  429. package/src/internal/funding/Catalog.test.ts +34 -0
  430. package/src/internal/funding/Catalog.ts +28 -11
  431. package/src/internal/funding/Deposit.ts +71 -64
  432. package/src/internal/funding/DepositAddress.ts +50 -43
  433. package/src/internal/funding/Provider.test.ts +73 -0
  434. package/src/internal/funding/Provider.ts +246 -170
  435. package/src/internal/funding/Transfer.ts +133 -110
  436. package/src/internal/funding/providers/index.test.ts +22 -0
  437. package/src/internal/funding/providers/relay.test.ts +2 -2
  438. package/src/internal/funding/providers/stargate.test.ts +163 -0
  439. package/src/internal/funding/providers/stargate.ts +409 -0
  440. package/src/internal/index.test.ts +1 -0
  441. package/src/internal/index.ts +1 -0
  442. package/src/providers/index.test.ts +1 -0
  443. package/src/providers/index.ts +9 -0
@@ -4,6 +4,7 @@ import { type Address, ContractFunctionExecutionError } from 'viem'
4
4
  import { Abis } from 'viem/tempo'
5
5
  import * as z from 'zod/mini'
6
6
 
7
+ import * as Assets from '../../../Assets.js'
7
8
  import type * as App from '../../../App.js'
8
9
  import * as Auth from '../../../internal/Auth.js'
9
10
  import * as Cache from '../../../internal/Cache.js'
@@ -20,6 +21,26 @@ import * as Value from '../../../internal/Value.js'
20
21
  import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
21
22
  import * as Transactions from './transactions.js'
22
23
 
24
+ /** Mainnet chain id used by the coherent token OpenAPI example. */
25
+ export const tokenExampleChainId = 4217
26
+
27
+ /** Coherent mainnet token metadata used by generated OpenAPI examples. */
28
+ export const tokenExample = {
29
+ address: '0x20c000000000000000000000b9537d11c60e8b50',
30
+ currency: 'USD',
31
+ decimals: 6,
32
+ id: '0x20c000000000000000000000b9537d11c60e8b50',
33
+ logoUri: Assets.url({
34
+ chainId: tokenExampleChainId,
35
+ origin: 'https://api.tempo.xyz',
36
+ path: 'icons/0x20c000000000000000000000b9537d11c60e8b50',
37
+ }),
38
+ name: 'Bridged USDC (Stargate)',
39
+ symbol: 'USDC.e',
40
+ totalSupply: '10850791186630',
41
+ verified: true,
42
+ } as const
43
+
23
44
  const tokenCreatedSignature =
24
45
  'event TokenCreated(address indexed token, string name, string symbol, string currency, address quoteToken, address admin, bytes32 salt)'
25
46
 
@@ -53,7 +74,9 @@ export namespace schema {
53
74
  /** Path parameters for token metadata requests. */
54
75
  export const Params = z
55
76
  .object({
56
- token: Schema.TokenAddress.check(z.describe('The TIP-20 token contract address on Tempo.')),
77
+ token: Schema.tokenAddress(tokenExample.address).check(
78
+ z.describe('The TIP-20 token contract address on Tempo.'),
79
+ ),
57
80
  })
58
81
  .check(z.describe('Path parameters for looking up one token’s metadata.'))
59
82
 
@@ -84,139 +107,140 @@ export namespace schema {
84
107
  .check(z.describe('Query parameters for looking up one token’s metadata.'))
85
108
 
86
109
  /** TIP-20 token metadata returned by token endpoints. */
87
- export const Response = Schema.describe(
88
- z.object({
89
- address: Schema.TokenAddress.check(
90
- z.describe('The TIP-20 token contract address on Tempo.'),
91
- ),
92
- admin: z
93
- .optional(Schema.Address)
94
- .check(
95
- z.describe(
96
- 'Token admin from the onchain `TokenCreated` event, present when requested ' +
97
- 'via `include=admin` and indexed data is available.',
98
- ),
110
+ export const Response = OpenApi.component(
111
+ Schema.describe(
112
+ z.object({
113
+ address: Schema.tokenAddress(tokenExample.address).check(
114
+ z.describe('The TIP-20 token contract address on Tempo.'),
99
115
  ),
100
- currency: z
101
- .string()
102
- .check(
103
- z.describe(
104
- 'The currency label for this token, such as `USD` for USD-denominated stablecoins.',
116
+ admin: z
117
+ .optional(Schema.Address)
118
+ .check(
119
+ z.describe(
120
+ 'Token admin from the onchain `TokenCreated` event, present when requested ' +
121
+ 'via `include=admin` and indexed data is available.',
122
+ ),
105
123
  ),
106
- z.meta({ examples: ['USD'] }),
107
- ),
108
- createdAt: z
109
- .optional(z.iso.datetime())
110
- .check(
111
- z.describe(
112
- 'Token creation timestamp, present when requested via `include=createdAt` ' +
113
- 'and indexed data is available.',
124
+ currency: z
125
+ .string()
126
+ .check(
127
+ z.describe(
128
+ 'The currency label for this token, such as `USD` for USD-denominated stablecoins.',
129
+ ),
130
+ z.meta({ examples: [tokenExample.currency] }),
114
131
  ),
115
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
116
- ),
117
- decimals: z
118
- .number()
119
- .check(
120
- z.int(),
121
- z.nonnegative(),
122
- z.describe(
123
- 'The number of decimal places the token uses; Tempo stablecoins typically use 6.',
132
+ createdAt: z
133
+ .optional(z.iso.datetime())
134
+ .check(
135
+ z.describe(
136
+ 'Token creation timestamp, present when requested via `include=createdAt` ' +
137
+ 'and indexed data is available.',
138
+ ),
139
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
124
140
  ),
125
- z.meta({ examples: [6] }),
126
- ),
127
- holderCount: z
128
- .optional(z.number().check(z.int(), z.nonnegative()))
129
- .check(
130
- z.describe(
131
- 'The number of accounts that currently hold a positive balance of this token, when indexed holder data is available.',
141
+ decimals: z
142
+ .number()
143
+ .check(
144
+ z.int(),
145
+ z.nonnegative(),
146
+ z.describe(
147
+ 'The number of decimal places the token uses; Tempo stablecoins typically use 6.',
148
+ ),
149
+ z.meta({ examples: [tokenExample.decimals] }),
132
150
  ),
133
- z.meta({ examples: [1234] }),
134
- ),
135
- id: z
136
- .string()
137
- .check(
138
- z.describe('A stable resource ID for this token, equal to its contract address.'),
139
- z.meta({ examples: ['0x20c0000000000000000000008f5425160ebe5525'] }),
140
- ),
141
- logoUri: z.optional(z.string()).check(
142
- z.describe('A URL for the token’s logo image, when one is available.'),
143
- z.meta({
144
- examples: [
145
- 'https://api.tempo.xyz/data/4217/icons/0x20c0000000000000000000008f5425160ebe5525.svg',
146
- ],
147
- }),
148
- ),
149
- name: z
150
- .string()
151
- .check(
152
- z.describe('The token’s human-readable name.'),
153
- z.meta({ examples: ['USD Coin'] }),
154
- ),
155
- quoteToken: z
156
- .optional(Schema.Address)
157
- .check(
158
- z.describe(
159
- 'Quote token from the onchain `TokenCreated` event, present when requested ' +
160
- 'via `include=quoteToken` and indexed data is available.',
151
+ holderCount: z
152
+ .optional(z.number().check(z.int(), z.nonnegative()))
153
+ .check(
154
+ z.describe(
155
+ 'The number of accounts that currently hold a positive balance of this token, when indexed holder data is available.',
156
+ ),
157
+ z.meta({ examples: [1234] }),
161
158
  ),
162
- ),
163
- symbol: z
164
- .string()
165
- .check(
166
- z.describe('The short ticker symbol wallets and apps show for this token.'),
167
- z.meta({ examples: ['USDC'] }),
168
- ),
169
- totalSupply: z
170
- .optional(z.string().check(z.regex(/^\d+$/)))
171
- .check(
172
- z.describe(
173
- 'The token’s total supply as a decimal string in the smallest unit, so large values keep full precision.',
159
+ id: z
160
+ .string()
161
+ .check(
162
+ z.describe('A stable resource ID for this token, equal to its contract address.'),
163
+ z.meta({ examples: [tokenExample.id] }),
174
164
  ),
175
- z.meta({ examples: ['1000000000000'] }),
165
+ logoUri: z.optional(z.string()).check(
166
+ z.describe('A URL for the token’s logo image, when one is available.'),
167
+ z.meta({
168
+ examples: [tokenExample.logoUri],
169
+ }),
176
170
  ),
177
- transferStats: z
178
- .optional(
179
- z.object({
180
- count: z
181
- .number()
182
- .check(
183
- z.int(),
184
- z.nonnegative(),
185
- z.describe('The total number of `Transfer` events emitted by this token.'),
186
- z.meta({ examples: [12345] }),
187
- ),
188
- firstAt: z
189
- .nullable(z.iso.datetime())
190
- .check(
191
- z.describe(
192
- 'The time of this token’s first `Transfer` event, or `null` if no transfers exist.',
171
+ name: z
172
+ .string()
173
+ .check(
174
+ z.describe('The token’s human-readable name.'),
175
+ z.meta({ examples: [tokenExample.name] }),
176
+ ),
177
+ quoteToken: z
178
+ .optional(Schema.Address)
179
+ .check(
180
+ z.describe(
181
+ 'Quote token from the onchain `TokenCreated` event, present when requested ' +
182
+ 'via `include=quoteToken` and indexed data is available.',
183
+ ),
184
+ ),
185
+ symbol: z
186
+ .string()
187
+ .check(
188
+ z.describe('The short ticker symbol wallets and apps show for this token.'),
189
+ z.meta({ examples: [tokenExample.symbol] }),
190
+ ),
191
+ totalSupply: z
192
+ .optional(z.string().check(z.regex(/^\d+$/)))
193
+ .check(
194
+ z.describe(
195
+ 'The token’s total supply as a decimal string in the smallest unit, so large values keep full precision.',
196
+ ),
197
+ z.meta({ examples: [tokenExample.totalSupply] }),
198
+ ),
199
+ transferStats: z
200
+ .optional(
201
+ z.object({
202
+ count: z
203
+ .number()
204
+ .check(
205
+ z.int(),
206
+ z.nonnegative(),
207
+ z.describe('The total number of `Transfer` events emitted by this token.'),
208
+ z.meta({ examples: [12345] }),
193
209
  ),
194
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
195
- ),
196
- lastAt: z
197
- .nullable(z.iso.datetime())
198
- .check(
199
- z.describe(
200
- 'The time of this token’s most recent `Transfer` event, or `null` if no transfers exist.',
210
+ firstAt: z
211
+ .nullable(z.iso.datetime())
212
+ .check(
213
+ z.describe(
214
+ 'The time of this token’s first `Transfer` event, or `null` if no transfers exist.',
215
+ ),
216
+ z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
201
217
  ),
202
- z.meta({ examples: ['2024-06-01T12:00:00Z'] }),
203
- ),
204
- }),
205
- )
206
- .check(
207
- z.describe(
208
- 'Lifetime `Transfer` event statistics, present when requested via ' +
209
- '`include=transferStats` and indexed data is available.',
218
+ lastAt: z
219
+ .nullable(z.iso.datetime())
220
+ .check(
221
+ z.describe(
222
+ 'The time of this token’s most recent `Transfer` event, or `null` if no transfers exist.',
223
+ ),
224
+ z.meta({ examples: ['2024-06-01T12:00:00Z'] }),
225
+ ),
226
+ }),
227
+ )
228
+ .check(
229
+ z.describe(
230
+ 'Lifetime `Transfer` event statistics, present when requested via ' +
231
+ '`include=transferStats` and indexed data is available.',
232
+ ),
210
233
  ),
211
- ),
212
- verified: z
213
- .boolean()
214
- .check(
215
- z.describe('Whether this token is in Tempo’s curated verified token list.'),
216
- z.meta({ examples: [true] }),
217
- ),
218
- }),
219
- 'Token metadata for a TIP-20 token, including name, symbol, decimals, supply, and optional indexed details.',
234
+ verified: z
235
+ .boolean()
236
+ .check(
237
+ z.describe('Whether this token is in Tempo’s curated verified token list.'),
238
+ z.meta({ examples: [tokenExample.verified] }),
239
+ ),
240
+ }),
241
+ 'Token metadata for a TIP-20 token, including name, symbol, decimals, supply, and optional indexed details.',
242
+ ),
243
+ 'Token',
220
244
  )
221
245
  }
222
246
 
@@ -226,24 +250,30 @@ export namespace schema {
226
250
  * temporal facts (`totalSupply`, `holderCount`, `createdAt`) belong on the
227
251
  * token detail endpoint, not in feed rows.
228
252
  */
229
- export const Token = Schema.describe(
230
- z.pick(getToken.Response, {
231
- address: true,
232
- currency: true,
233
- decimals: true,
234
- id: true,
235
- logoUri: true,
236
- name: true,
237
- symbol: true,
238
- verified: true,
239
- }),
240
- 'A compact TIP-20 token reference with identity and display fields only.',
253
+ export const Token = OpenApi.component(
254
+ Schema.describe(
255
+ z.pick(getToken.Response, {
256
+ address: true,
257
+ currency: true,
258
+ decimals: true,
259
+ id: true,
260
+ logoUri: true,
261
+ name: true,
262
+ symbol: true,
263
+ verified: true,
264
+ }),
265
+ 'A compact TIP-20 token reference with identity and display fields only.',
266
+ ),
267
+ 'TokenReference',
241
268
  )
242
269
 
243
270
  /** RPC token metadata embedded in resources, with optional curated fields. */
244
- export const TokenReference = Schema.describe(
245
- z.partial(z.omit(Token, { id: true }), { logoUri: true, verified: true }),
246
- 'A compact TIP-20 token reference with RPC metadata and optional enrichments.',
271
+ export const TokenReference = OpenApi.component(
272
+ Schema.describe(
273
+ z.partial(z.omit(Token, { id: true }), { logoUri: true, verified: true }),
274
+ 'A compact TIP-20 token reference with RPC metadata and optional enrichments.',
275
+ ),
276
+ 'RpcTokenReference',
247
277
  )
248
278
 
249
279
  /** Schemas for the getTokenBySymbol operation. */
@@ -352,12 +382,15 @@ export namespace schema {
352
382
  .check(...Schema.pageChecks(), z.describe('Query parameters for listing TIP-20 tokens.'))
353
383
 
354
384
  /** Page of TIP-20 tokens. */
355
- export const Response = z
356
- .object({
357
- data: z.array(getToken.Response).check(z.describe('The tokens in this page.')),
358
- nextCursor: Schema.NextCursor,
359
- })
360
- .check(z.describe('A page of TIP-20 tokens on Tempo.'))
385
+ export const Response = OpenApi.component(
386
+ z
387
+ .object({
388
+ data: z.array(getToken.Response).check(z.describe('The tokens in this page.')),
389
+ nextCursor: Schema.NextCursor,
390
+ })
391
+ .check(z.describe('A page of TIP-20 tokens on Tempo.')),
392
+ 'TokenList',
393
+ )
361
394
  }
362
395
 
363
396
  /** Schemas for the getTokenHolders operation. */
@@ -396,64 +429,73 @@ export namespace schema {
396
429
  .check(...Schema.pageChecks(), z.describe('Query parameters for listing a token’s holders.'))
397
430
 
398
431
  /** A single TIP-20 token holder. */
399
- export const Holder = z
400
- .object({
401
- address: Schema.Address.check(z.describe('The account address that holds this token.')),
402
- balance: z
403
- .string()
404
- .check(
405
- z.regex(/^\d+$/),
406
- z.describe(
407
- 'A non-negative whole number, given as a decimal string so very large token amounts keep full precision. Expressed in the smallest unit of the token.',
432
+ export const Holder = OpenApi.component(
433
+ z
434
+ .object({
435
+ address: Schema.Address.check(z.describe('The account address that holds this token.')),
436
+ balance: z
437
+ .string()
438
+ .check(
439
+ z.regex(/^\d+$/),
440
+ z.describe(
441
+ 'A non-negative whole number, given as a decimal string so very large token amounts keep full precision. Expressed in the smallest unit of the token.',
442
+ ),
443
+ z.meta({ examples: ['1000000'] }),
408
444
  ),
409
- z.meta({ examples: ['1000000'] }),
410
- ),
411
- id: z
412
- .string()
413
- .check(
414
- z.describe('A stable resource ID for this holder, equal to the holder address.'),
415
- z.meta({ examples: ['0xbe058e1c4df8a4366a387bf595b284246a93039e'] }),
416
- ),
417
- })
418
- .check(z.describe('One account holding a positive balance of this TIP-20 token.'))
445
+ id: z
446
+ .string()
447
+ .check(
448
+ z.describe('A stable resource ID for this holder, equal to the holder address.'),
449
+ z.meta({ examples: ['0xbe058e1c4df8a4366a387bf595b284246a93039e'] }),
450
+ ),
451
+ })
452
+ .check(z.describe('One account holding a positive balance of this TIP-20 token.')),
453
+ 'TokenHolder',
454
+ )
419
455
 
420
456
  /** Resources embedded on demand via `include`. */
421
- export const Meta = z
422
- .object({
423
- totalCountCapped: z
424
- .optional(Schema.TotalCountCapped)
425
- .check(
426
- z.describe(
427
- 'Whether `totalCount` reached the API count cap; holder counts are exact here.',
457
+ export const Meta = OpenApi.component(
458
+ z
459
+ .object({
460
+ totalCountCapped: z
461
+ .optional(Schema.TotalCountCapped)
462
+ .check(
463
+ z.describe(
464
+ 'Whether `totalCount` reached the API count cap; holder counts are exact here.',
465
+ ),
428
466
  ),
429
- ),
430
- token: z
431
- .optional(Token)
432
- .check(
433
- z.describe('A compact token reference, returned when you request `include=token`.'),
434
- ),
435
- totalCount: z
436
- .optional(Schema.TotalCount)
437
- .check(
438
- z.describe(
439
- 'The total number of token holders, returned when you request `include=totalCount`.',
467
+ token: z
468
+ .optional(Token)
469
+ .check(
470
+ z.describe('A compact token reference, returned when you request `include=token`.'),
440
471
  ),
441
- ),
442
- })
443
- .check(z.describe('Extra resources included because you requested them with `include`.'))
472
+ totalCount: z
473
+ .optional(Schema.TotalCount)
474
+ .check(
475
+ z.describe(
476
+ 'The total number of token holders, returned when you request `include=totalCount`.',
477
+ ),
478
+ ),
479
+ })
480
+ .check(z.describe('Extra resources included because you requested them with `include`.')),
481
+ 'TokenHolderListMeta',
482
+ )
444
483
 
445
484
  /** Page of TIP-20 token holders, ordered by balance descending. */
446
- export const Response = z
447
- .object({
448
- data: z
449
- .array(Holder)
450
- .check(
451
- z.describe('The holders in this page, ordered by balance from highest to lowest.'),
452
- ),
453
- meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
454
- nextCursor: Schema.NextCursor,
455
- })
456
- .check(z.describe('A page of accounts holding this TIP-20 token.'))
485
+ export const Response = OpenApi.component(
486
+ z
487
+ .object({
488
+ data: z
489
+ .array(Holder)
490
+ .check(
491
+ z.describe('The holders in this page, ordered by balance from highest to lowest.'),
492
+ ),
493
+ meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
494
+ nextCursor: Schema.NextCursor,
495
+ })
496
+ .check(z.describe('A page of accounts holding this TIP-20 token.')),
497
+ 'TokenHolderList',
498
+ )
457
499
  }
458
500
 
459
501
  /** Schemas for the getTokenTransactions operation. */
@@ -510,29 +552,32 @@ export namespace schema {
510
552
  )
511
553
 
512
554
  /** Resources embedded on demand via `include`. */
513
- export const Meta = z
514
- .object({
515
- totalCountCapped: z
516
- .optional(Schema.TotalCountCapped)
517
- .check(
518
- z.describe(
519
- 'Whether `totalCount` reached the API count cap; when `true`, treat the count as a lower bound.',
555
+ export const Meta = OpenApi.component(
556
+ z
557
+ .object({
558
+ totalCountCapped: z
559
+ .optional(Schema.TotalCountCapped)
560
+ .check(
561
+ z.describe(
562
+ 'Whether `totalCount` reached the API count cap; when `true`, treat the count as a lower bound.',
563
+ ),
520
564
  ),
521
- ),
522
- token: z
523
- .optional(Token)
524
- .check(
525
- z.describe('A compact token reference, returned when you request `include=token`.'),
526
- ),
527
- totalCount: z
528
- .optional(Schema.TotalCount)
529
- .check(
530
- z.describe(
531
- 'The capped total number of matching transactions, returned when you request `include=totalCount`.',
565
+ token: z
566
+ .optional(Token)
567
+ .check(
568
+ z.describe('A compact token reference, returned when you request `include=token`.'),
532
569
  ),
533
- ),
534
- })
535
- .check(z.describe('Extra resources included because you requested them with `include`.'))
570
+ totalCount: z
571
+ .optional(Schema.TotalCount)
572
+ .check(
573
+ z.describe(
574
+ 'The capped total number of matching transactions, returned when you request `include=totalCount`.',
575
+ ),
576
+ ),
577
+ })
578
+ .check(z.describe('Extra resources included because you requested them with `include`.')),
579
+ 'TokenTransactionListMeta',
580
+ )
536
581
 
537
582
  /**
538
583
  * Page of transactions touching the token contract. Each row is the
@@ -543,15 +588,18 @@ export namespace schema {
543
588
  * already imports `Tokens.schema` at module init; a direct reference
544
589
  * here would close the import cycle and crash during evaluation.
545
590
  */
546
- export const Response = z
547
- .object({
548
- data: z
549
- .array(z.lazy(() => Transactions.schema.getTransaction.Response))
550
- .check(z.describe('The transactions in this page.')),
551
- meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
552
- nextCursor: Schema.NextCursor,
553
- })
554
- .check(z.describe('A page of transactions that interact with this token contract.'))
591
+ export const Response = OpenApi.component(
592
+ z
593
+ .object({
594
+ data: z
595
+ .array(z.lazy(() => Transactions.schema.getTransaction.Response))
596
+ .check(z.describe('The transactions in this page.')),
597
+ meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
598
+ nextCursor: Schema.NextCursor,
599
+ })
600
+ .check(z.describe('A page of transactions that interact with this token contract.')),
601
+ 'TokenTransactionList',
602
+ )
555
603
  }
556
604
  }
557
605
 
@@ -570,6 +618,9 @@ export function tokens() {
570
618
  'Lists TIP-20 tokens on Tempo. TIP-20 is Tempo’s payments-focused token standard and a superset of ERC-20.',
571
619
  operationId: 'getTokens',
572
620
  responses: OpenApi.responses({
621
+ errors: {
622
+ 400: { codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'] },
623
+ },
573
624
  success: { description: 'A page of TIP-20 tokens.', schema: schema.getTokens.Response },
574
625
  }),
575
626
  summary: 'List tokens',
@@ -624,7 +675,7 @@ export function tokens() {
624
675
  200,
625
676
  )
626
677
  } catch (cause) {
627
- return Response.upstream(c, cause)
678
+ return Response.upstream(c, cause, { page: query.page })
628
679
  }
629
680
  },
630
681
  )
@@ -645,6 +696,14 @@ export function tokens() {
645
696
  operationId: 'getTokenBySymbol',
646
697
  responses: OpenApi.responses({
647
698
  errors: {
699
+ 400: {
700
+ codes: [
701
+ 'chain_id_invalid',
702
+ 'chain_id_unsupported',
703
+ 'query_invalid',
704
+ 'symbol_invalid',
705
+ ],
706
+ },
648
707
  404: {
649
708
  description: 'No token was found for this address or symbol.',
650
709
  codes: ['token_not_found'],
@@ -653,6 +712,7 @@ export function tokens() {
653
712
  },
654
713
  success: {
655
714
  description: 'Metadata for one TIP-20 token.',
715
+ example: tokenExample,
656
716
  schema: schema.getToken.Response,
657
717
  },
658
718
  }),
@@ -717,6 +777,9 @@ export function tokens() {
717
777
  operationId: 'getToken',
718
778
  responses: OpenApi.responses({
719
779
  errors: {
780
+ 400: {
781
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid', 'token_invalid'],
782
+ },
720
783
  404: {
721
784
  description: 'No token was found for this address or symbol.',
722
785
  codes: ['token_not_found'],
@@ -725,6 +788,7 @@ export function tokens() {
725
788
  },
726
789
  success: {
727
790
  description: 'Metadata for one TIP-20 token.',
791
+ example: tokenExample,
728
792
  schema: schema.getToken.Response,
729
793
  },
730
794
  }),
@@ -776,8 +840,15 @@ export function tokens() {
776
840
  description: 'The token logo image.',
777
841
  headers: OpenApi.successHeaders,
778
842
  },
779
- 400: OpenApi.standardError(400, 'The request parameters were invalid.'),
843
+ 400: OpenApi.standardError(400, 'The request parameters were invalid.', [
844
+ 'api_key_malformed',
845
+ 'chain_id_invalid',
846
+ 'chain_id_unsupported',
847
+ 'query_invalid',
848
+ 'token_invalid',
849
+ ]),
780
850
  401: OpenApi.standardError(401, 'The API key is missing or invalid.'),
851
+ 403: OpenApi.standardError(403, 'The API key cannot access this resource.'),
781
852
  404: OpenApi.standardError(404, 'No logo image was found for this token.', [
782
853
  'token_logo_not_found',
783
854
  ]),
@@ -861,7 +932,12 @@ export function tokens() {
861
932
  'Lists the accounts that hold a TIP-20 token, ordered from largest to smallest balance.',
862
933
  operationId: 'getTokenHolders',
863
934
  responses: OpenApi.responses({
864
- errors: { 502: 'The upstream indexer could not serve this request.' },
935
+ errors: {
936
+ 400: {
937
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid', 'token_invalid'],
938
+ },
939
+ 502: 'The upstream indexer could not serve this request.',
940
+ },
865
941
  success: {
866
942
  description: 'A page of token holders.',
867
943
  schema: schema.getTokenHolders.Response,
@@ -932,7 +1008,7 @@ export function tokens() {
932
1008
  200,
933
1009
  )
934
1010
  } catch (cause) {
935
- return Response.upstream(c, cause)
1011
+ return Response.upstream(c, cause, { page: query.page })
936
1012
  }
937
1013
  },
938
1014
  )
@@ -951,7 +1027,12 @@ export function tokens() {
951
1027
  description: 'Lists transactions that interacted with this token contract.',
952
1028
  operationId: 'getTokenTransactions',
953
1029
  responses: OpenApi.responses({
954
- errors: { 502: 'The upstream indexer could not serve this request.' },
1030
+ errors: {
1031
+ 400: {
1032
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid', 'token_invalid'],
1033
+ },
1034
+ 502: 'The upstream indexer could not serve this request.',
1035
+ },
955
1036
  success: {
956
1037
  description: 'A page of transactions involving this token contract.',
957
1038
  schema: schema.getTokenTransactions.Response,
@@ -1051,7 +1132,7 @@ export function tokens() {
1051
1132
  200,
1052
1133
  )
1053
1134
  } catch (cause) {
1054
- return Response.upstream(c, cause)
1135
+ return Response.upstream(c, cause, { page: query.page })
1055
1136
  }
1056
1137
  },
1057
1138
  )