tapimo 0.12.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 (257) hide show
  1. package/dist/App.d.ts +5561 -5026
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +38 -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/admin/App.d.ts +123 -74
  10. package/dist/admin/App.d.ts.map +1 -1
  11. package/dist/admin/apps/api-keys.d.ts +80 -0
  12. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  13. package/dist/admin/apps/api-keys.js +54 -0
  14. package/dist/admin/apps/api-keys.js.map +1 -1
  15. package/dist/admin/apps/earn-vaults.d.ts +15 -15
  16. package/dist/admin/apps/earn-vaults.js +1 -1
  17. package/dist/admin/apps/verified-tokens.d.ts +81 -81
  18. package/dist/admin/ui.generated.d.ts +1 -1
  19. package/dist/admin/ui.generated.d.ts.map +1 -1
  20. package/dist/admin/ui.generated.js +151 -151
  21. package/dist/admin/ui.generated.js.map +1 -1
  22. package/dist/apps/Zones.d.ts +16 -16
  23. package/dist/apps/Zones.js +4 -4
  24. package/dist/apps/data/App.js +18 -18
  25. package/dist/apps/data/App.js.map +1 -1
  26. package/dist/apps/data/ZoneSelection.d.ts +8 -8
  27. package/dist/apps/data/ZoneSelection.d.ts.map +1 -1
  28. package/dist/apps/data/ZoneSelection.js +1 -1
  29. package/dist/apps/data/ZoneSelection.js.map +1 -1
  30. package/dist/apps/data/routes/activities.d.ts +588 -584
  31. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  32. package/dist/apps/data/routes/activities.js +1561 -1239
  33. package/dist/apps/data/routes/activities.js.map +1 -1
  34. package/dist/apps/data/routes/balances.d.ts +26 -26
  35. package/dist/apps/data/routes/balances.d.ts.map +1 -1
  36. package/dist/apps/data/routes/balances.js +43 -16
  37. package/dist/apps/data/routes/balances.js.map +1 -1
  38. package/dist/apps/data/routes/blocks.d.ts +44 -44
  39. package/dist/apps/data/routes/blocks.d.ts.map +1 -1
  40. package/dist/apps/data/routes/blocks.js +21 -11
  41. package/dist/apps/data/routes/blocks.js.map +1 -1
  42. package/dist/apps/data/routes/coingecko.d.ts +3 -3
  43. package/dist/apps/data/routes/earn.d.ts +18 -18
  44. package/dist/apps/data/routes/earn.js +13 -13
  45. package/dist/apps/data/routes/exchanges.d.ts +145 -145
  46. package/dist/apps/data/routes/fee-amm.d.ts +2 -2
  47. package/dist/apps/data/routes/receipts.d.ts +155 -55
  48. package/dist/apps/data/routes/receipts.d.ts.map +1 -1
  49. package/dist/apps/data/routes/receipts.js +28 -10
  50. package/dist/apps/data/routes/receipts.js.map +1 -1
  51. package/dist/apps/data/routes/tokenlist.d.ts +13 -13
  52. package/dist/apps/data/routes/tokens.d.ts +98 -98
  53. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  54. package/dist/apps/data/routes/tokens.js +51 -20
  55. package/dist/apps/data/routes/tokens.js.map +1 -1
  56. package/dist/apps/data/routes/transactions.d.ts +7 -2
  57. package/dist/apps/data/routes/transactions.d.ts.map +1 -1
  58. package/dist/apps/data/routes/transactions.js +37 -17
  59. package/dist/apps/data/routes/transactions.js.map +1 -1
  60. package/dist/apps/data/routes/transfers.d.ts +1 -1
  61. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  62. package/dist/apps/data/routes/transfers.js +18 -12
  63. package/dist/apps/data/routes/transfers.js.map +1 -1
  64. package/dist/apps/data/routes/valuation.d.ts +1 -1
  65. package/dist/apps/data/routes/valuation.d.ts.map +1 -1
  66. package/dist/apps/data/routes/valuation.js +12 -7
  67. package/dist/apps/data/routes/valuation.js.map +1 -1
  68. package/dist/apps/data/routes/verified-tokens.d.ts +3 -3
  69. package/dist/apps/data/routes/webhooks.d.ts +11 -11
  70. package/dist/apps/data/routes/zones.d.ts +14 -14
  71. package/dist/apps/data/routes/zones.js +1 -1
  72. package/dist/apps/funding/App.d.ts +11 -0
  73. package/dist/apps/funding/App.d.ts.map +1 -1
  74. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
  75. package/dist/apps/funding/routes/deposit-addresses.js +16 -11
  76. package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
  77. package/dist/apps/funding/routes/transfers.d.ts +60 -48
  78. package/dist/apps/funding/routes/transfers.d.ts.map +1 -1
  79. package/dist/apps/funding/routes/transfers.js +27 -19
  80. package/dist/apps/funding/routes/transfers.js.map +1 -1
  81. package/dist/apps/management/App.d.ts +4487 -3963
  82. package/dist/apps/management/App.d.ts.map +1 -1
  83. package/dist/apps/management/routes/api-keys.d.ts +710 -159
  84. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  85. package/dist/apps/management/routes/api-keys.js +236 -4
  86. package/dist/apps/management/routes/api-keys.js.map +1 -1
  87. package/dist/apps/management/routes/faucet.d.ts +6 -6
  88. package/dist/apps/management/routes/invite-links.d.ts +42 -42
  89. package/dist/apps/management/routes/members.d.ts +30 -30
  90. package/dist/apps/management/routes/projects.d.ts +40 -40
  91. package/dist/apps/management/routes/usage.d.ts +24 -24
  92. package/dist/apps/management/routes/verified-token-requests.d.ts +1 -1
  93. package/dist/apps/management/routes/webhooks.d.ts +55 -55
  94. package/dist/db/Db.d.ts.map +1 -1
  95. package/dist/db/Db.js +12 -1
  96. package/dist/db/Db.js.map +1 -1
  97. package/dist/db/Schema.d.ts +3 -2
  98. package/dist/db/Schema.d.ts.map +1 -1
  99. package/dist/db/Schema.js +5 -2
  100. package/dist/db/Schema.js.map +1 -1
  101. package/dist/db/tables/fundingCatalog.d.ts +4 -2
  102. package/dist/db/tables/fundingCatalog.d.ts.map +1 -1
  103. package/dist/db/tables/fundingCatalog.js +5 -1
  104. package/dist/db/tables/fundingCatalog.js.map +1 -1
  105. package/dist/handlers/internal/utils.d.ts.map +1 -1
  106. package/dist/handlers/internal/utils.js +9 -0
  107. package/dist/handlers/internal/utils.js.map +1 -1
  108. package/dist/internal/Auth.d.ts +3 -1
  109. package/dist/internal/Auth.d.ts.map +1 -1
  110. package/dist/internal/Auth.js +6 -3
  111. package/dist/internal/Auth.js.map +1 -1
  112. package/dist/internal/EarnVaults.d.ts +3 -3
  113. package/dist/internal/EarnVaults.js +3 -3
  114. package/dist/internal/Fetch.d.ts +23 -0
  115. package/dist/internal/Fetch.d.ts.map +1 -0
  116. package/dist/internal/Fetch.js +26 -0
  117. package/dist/internal/Fetch.js.map +1 -0
  118. package/dist/internal/Log.d.ts +3 -1
  119. package/dist/internal/Log.d.ts.map +1 -1
  120. package/dist/internal/Log.js +16 -3
  121. package/dist/internal/Log.js.map +1 -1
  122. package/dist/internal/OpenApi.d.ts +5 -3
  123. package/dist/internal/OpenApi.d.ts.map +1 -1
  124. package/dist/internal/OpenApi.js +13 -3
  125. package/dist/internal/OpenApi.js.map +1 -1
  126. package/dist/internal/Response.d.ts +1 -1
  127. package/dist/internal/Response.d.ts.map +1 -1
  128. package/dist/internal/Schema.d.ts +6 -3
  129. package/dist/internal/Schema.d.ts.map +1 -1
  130. package/dist/internal/Schema.js +8 -2
  131. package/dist/internal/Schema.js.map +1 -1
  132. package/dist/internal/Store.d.ts +16 -3
  133. package/dist/internal/Store.d.ts.map +1 -1
  134. package/dist/internal/Store.js +82 -16
  135. package/dist/internal/Store.js.map +1 -1
  136. package/dist/internal/Tidx.d.ts.map +1 -1
  137. package/dist/internal/Tidx.js +7 -2
  138. package/dist/internal/Tidx.js.map +1 -1
  139. package/dist/internal/Timeout.d.ts +36 -0
  140. package/dist/internal/Timeout.d.ts.map +1 -0
  141. package/dist/internal/Timeout.js +37 -0
  142. package/dist/internal/Timeout.js.map +1 -0
  143. package/dist/internal/Timing.d.ts +9 -0
  144. package/dist/internal/Timing.d.ts.map +1 -1
  145. package/dist/internal/Timing.js +7 -0
  146. package/dist/internal/Timing.js.map +1 -1
  147. package/dist/internal/WebhookDestination.d.ts.map +1 -1
  148. package/dist/internal/WebhookDestination.js +3 -0
  149. package/dist/internal/WebhookDestination.js.map +1 -1
  150. package/dist/internal/funding/Action.d.ts +9 -0
  151. package/dist/internal/funding/Action.d.ts.map +1 -1
  152. package/dist/internal/funding/Action.js +16 -8
  153. package/dist/internal/funding/Action.js.map +1 -1
  154. package/dist/internal/funding/Catalog.d.ts +9 -2
  155. package/dist/internal/funding/Catalog.d.ts.map +1 -1
  156. package/dist/internal/funding/Catalog.js +19 -8
  157. package/dist/internal/funding/Catalog.js.map +1 -1
  158. package/dist/internal/funding/Provider.d.ts +68 -13
  159. package/dist/internal/funding/Provider.d.ts.map +1 -1
  160. package/dist/internal/funding/Provider.js +29 -8
  161. package/dist/internal/funding/Provider.js.map +1 -1
  162. package/dist/internal/funding/Transfer.d.ts +13 -12
  163. package/dist/internal/funding/Transfer.d.ts.map +1 -1
  164. package/dist/internal/funding/Transfer.js +23 -21
  165. package/dist/internal/funding/Transfer.js.map +1 -1
  166. package/dist/internal/funding/providers/stargate.d.ts +28 -9
  167. package/dist/internal/funding/providers/stargate.d.ts.map +1 -1
  168. package/dist/internal/funding/providers/stargate.js +251 -117
  169. package/dist/internal/funding/providers/stargate.js.map +1 -1
  170. package/dist/internal/index.d.ts +1 -0
  171. package/dist/internal/index.d.ts.map +1 -1
  172. package/dist/internal/index.js +1 -0
  173. package/dist/internal/index.js.map +1 -1
  174. package/package.json +2 -2
  175. package/src/App.test.ts +100 -0
  176. package/src/App.ts +42 -3
  177. package/src/Client.test-d.ts +46 -0
  178. package/src/Scope.test.ts +20 -0
  179. package/src/Scope.ts +16 -0
  180. package/src/admin/apps/api-keys.test.ts +75 -0
  181. package/src/admin/apps/api-keys.ts +64 -0
  182. package/src/admin/apps/earn-vaults.test.ts +1 -1
  183. package/src/admin/apps/earn-vaults.ts +1 -1
  184. package/src/admin/ui/src/lib/api-keys.ts +19 -0
  185. package/src/admin/ui/src/routes/api-keys.tsx +89 -2
  186. package/src/admin/ui.generated.ts +189 -151
  187. package/src/apps/Zones.test.ts +4 -4
  188. package/src/apps/Zones.ts +4 -4
  189. package/src/apps/composition.test.ts +1 -1
  190. package/src/apps/data/App.test.ts +41 -0
  191. package/src/apps/data/App.ts +18 -18
  192. package/src/apps/data/ZoneSelection.test.ts +2 -2
  193. package/src/apps/data/ZoneSelection.ts +8 -8
  194. package/src/apps/data/routes/activities.test.ts +1526 -12
  195. package/src/apps/data/routes/activities.ts +1774 -1356
  196. package/src/apps/data/routes/balances.ts +133 -97
  197. package/src/apps/data/routes/blocks.test.ts +533 -0
  198. package/src/apps/data/routes/blocks.ts +35 -16
  199. package/src/apps/data/routes/earn.test.ts +4 -2
  200. package/src/apps/data/routes/earn.ts +13 -13
  201. package/src/apps/data/routes/earn.zone-access.test.ts +6 -6
  202. package/src/apps/data/routes/receipts.ts +47 -16
  203. package/src/apps/data/routes/tokens.test.ts +578 -0
  204. package/src/apps/data/routes/tokens.ts +283 -225
  205. package/src/apps/data/routes/transactions.ts +68 -29
  206. package/src/apps/data/routes/transfers.test.ts +421 -0
  207. package/src/apps/data/routes/transfers.ts +45 -27
  208. package/src/apps/data/routes/valuation.ts +94 -78
  209. package/src/apps/data/routes/zones.test.ts +2 -2
  210. package/src/apps/data/routes/zones.ts +1 -1
  211. package/src/apps/funding/routes/deposit-addresses.test.ts +25 -3
  212. package/src/apps/funding/routes/deposit-addresses.ts +17 -12
  213. package/src/apps/funding/routes/quotes.test.ts +5 -9
  214. package/src/apps/funding/routes/transfers.test.ts +395 -8
  215. package/src/apps/funding/routes/transfers.ts +76 -59
  216. package/src/apps/management/routes/api-keys.test.ts +220 -0
  217. package/src/apps/management/routes/api-keys.ts +280 -3
  218. package/src/db/Db.ts +13 -1
  219. package/src/db/Schema.ts +5 -2
  220. package/src/db/tables/earnVaults.test.ts +9 -9
  221. package/src/db/tables/fundingCatalog.test.ts +16 -2
  222. package/src/db/tables/fundingCatalog.ts +9 -3
  223. package/src/handlers/internal/utils.test.ts +53 -0
  224. package/src/handlers/internal/utils.ts +15 -0
  225. package/src/internal/Auth.ts +12 -4
  226. package/src/internal/EarnVaults.capabilities.test.ts +2 -2
  227. package/src/internal/EarnVaults.test.ts +1 -1
  228. package/src/internal/EarnVaults.ts +3 -3
  229. package/src/internal/Fetch.test.ts +46 -0
  230. package/src/internal/Fetch.ts +56 -0
  231. package/src/internal/Log.test.ts +21 -0
  232. package/src/internal/Log.ts +20 -5
  233. package/src/internal/OpenApi.ts +14 -4
  234. package/src/internal/Response.ts +1 -1
  235. package/src/internal/Schema.test.ts +2 -0
  236. package/src/internal/Schema.ts +12 -2
  237. package/src/internal/Store.test.ts +178 -0
  238. package/src/internal/Store.ts +104 -18
  239. package/src/internal/Tidx.test.ts +2 -1
  240. package/src/internal/Tidx.ts +7 -2
  241. package/src/internal/Timeout.test.ts +35 -0
  242. package/src/internal/Timeout.ts +73 -0
  243. package/src/internal/Timing.ts +16 -0
  244. package/src/internal/WebhookDestination.ts +3 -0
  245. package/src/internal/funding/Action.test.ts +41 -1
  246. package/src/internal/funding/Action.ts +69 -41
  247. package/src/internal/funding/Catalog.test.ts +34 -0
  248. package/src/internal/funding/Catalog.ts +28 -11
  249. package/src/internal/funding/Provider.test.ts +73 -0
  250. package/src/internal/funding/Provider.ts +82 -28
  251. package/src/internal/funding/Transfer.ts +133 -110
  252. package/src/internal/funding/providers/index.test.ts +4 -167
  253. package/src/internal/funding/providers/relay.test.ts +2 -2
  254. package/src/internal/funding/providers/stargate.test.ts +163 -0
  255. package/src/internal/funding/providers/stargate.ts +359 -134
  256. package/src/internal/index.test.ts +1 -0
  257. package/src/internal/index.ts +1 -0
@@ -107,137 +107,140 @@ export namespace schema {
107
107
  .check(z.describe('Query parameters for looking up one token’s metadata.'))
108
108
 
109
109
  /** TIP-20 token metadata returned by token endpoints. */
110
- export const Response = Schema.describe(
111
- z.object({
112
- address: Schema.tokenAddress(tokenExample.address).check(
113
- z.describe('The TIP-20 token contract address on Tempo.'),
114
- ),
115
- admin: z
116
- .optional(Schema.Address)
117
- .check(
118
- z.describe(
119
- 'Token admin from the onchain `TokenCreated` event, present when requested ' +
120
- 'via `include=admin` and indexed data is available.',
121
- ),
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.'),
122
115
  ),
123
- currency: z
124
- .string()
125
- .check(
126
- z.describe(
127
- '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
+ ),
128
123
  ),
129
- z.meta({ examples: [tokenExample.currency] }),
130
- ),
131
- createdAt: z
132
- .optional(z.iso.datetime())
133
- .check(
134
- z.describe(
135
- 'Token creation timestamp, present when requested via `include=createdAt` ' +
136
- '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] }),
137
131
  ),
138
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
139
- ),
140
- decimals: z
141
- .number()
142
- .check(
143
- z.int(),
144
- z.nonnegative(),
145
- z.describe(
146
- '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'] }),
147
140
  ),
148
- z.meta({ examples: [tokenExample.decimals] }),
149
- ),
150
- holderCount: z
151
- .optional(z.number().check(z.int(), z.nonnegative()))
152
- .check(
153
- z.describe(
154
- '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] }),
155
150
  ),
156
- z.meta({ examples: [1234] }),
157
- ),
158
- id: z
159
- .string()
160
- .check(
161
- z.describe('A stable resource ID for this token, equal to its contract address.'),
162
- z.meta({ examples: [tokenExample.id] }),
163
- ),
164
- logoUri: z.optional(z.string()).check(
165
- z.describe('A URL for the token’s logo image, when one is available.'),
166
- z.meta({
167
- examples: [tokenExample.logoUri],
168
- }),
169
- ),
170
- name: z
171
- .string()
172
- .check(
173
- z.describe('The token’s human-readable name.'),
174
- z.meta({ examples: [tokenExample.name] }),
175
- ),
176
- quoteToken: z
177
- .optional(Schema.Address)
178
- .check(
179
- z.describe(
180
- 'Quote token from the onchain `TokenCreated` event, present when requested ' +
181
- '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] }),
182
158
  ),
183
- ),
184
- symbol: z
185
- .string()
186
- .check(
187
- z.describe('The short ticker symbol wallets and apps show for this token.'),
188
- z.meta({ examples: [tokenExample.symbol] }),
189
- ),
190
- totalSupply: z
191
- .optional(z.string().check(z.regex(/^\d+$/)))
192
- .check(
193
- z.describe(
194
- '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] }),
195
164
  ),
196
- z.meta({ examples: [tokenExample.totalSupply] }),
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
+ }),
197
170
  ),
198
- transferStats: z
199
- .optional(
200
- z.object({
201
- count: z
202
- .number()
203
- .check(
204
- z.int(),
205
- z.nonnegative(),
206
- z.describe('The total number of `Transfer` events emitted by this token.'),
207
- z.meta({ examples: [12345] }),
208
- ),
209
- firstAt: z
210
- .nullable(z.iso.datetime())
211
- .check(
212
- z.describe(
213
- '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] }),
214
209
  ),
215
- z.meta({ examples: ['2024-01-01T00:00:00Z'] }),
216
- ),
217
- lastAt: z
218
- .nullable(z.iso.datetime())
219
- .check(
220
- z.describe(
221
- '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'] }),
222
217
  ),
223
- z.meta({ examples: ['2024-06-01T12:00:00Z'] }),
224
- ),
225
- }),
226
- )
227
- .check(
228
- z.describe(
229
- 'Lifetime `Transfer` event statistics, present when requested via ' +
230
- '`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
+ ),
231
233
  ),
232
- ),
233
- verified: z
234
- .boolean()
235
- .check(
236
- z.describe('Whether this token is in Tempo’s curated verified token list.'),
237
- z.meta({ examples: [tokenExample.verified] }),
238
- ),
239
- }),
240
- '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',
241
244
  )
242
245
  }
243
246
 
@@ -247,24 +250,30 @@ export namespace schema {
247
250
  * temporal facts (`totalSupply`, `holderCount`, `createdAt`) belong on the
248
251
  * token detail endpoint, not in feed rows.
249
252
  */
250
- export const Token = Schema.describe(
251
- z.pick(getToken.Response, {
252
- address: true,
253
- currency: true,
254
- decimals: true,
255
- id: true,
256
- logoUri: true,
257
- name: true,
258
- symbol: true,
259
- verified: true,
260
- }),
261
- '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',
262
268
  )
263
269
 
264
270
  /** RPC token metadata embedded in resources, with optional curated fields. */
265
- export const TokenReference = Schema.describe(
266
- z.partial(z.omit(Token, { id: true }), { logoUri: true, verified: true }),
267
- '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',
268
277
  )
269
278
 
270
279
  /** Schemas for the getTokenBySymbol operation. */
@@ -373,12 +382,15 @@ export namespace schema {
373
382
  .check(...Schema.pageChecks(), z.describe('Query parameters for listing TIP-20 tokens.'))
374
383
 
375
384
  /** Page of TIP-20 tokens. */
376
- export const Response = z
377
- .object({
378
- data: z.array(getToken.Response).check(z.describe('The tokens in this page.')),
379
- nextCursor: Schema.NextCursor,
380
- })
381
- .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
+ )
382
394
  }
383
395
 
384
396
  /** Schemas for the getTokenHolders operation. */
@@ -417,64 +429,73 @@ export namespace schema {
417
429
  .check(...Schema.pageChecks(), z.describe('Query parameters for listing a token’s holders.'))
418
430
 
419
431
  /** A single TIP-20 token holder. */
420
- export const Holder = z
421
- .object({
422
- address: Schema.Address.check(z.describe('The account address that holds this token.')),
423
- balance: z
424
- .string()
425
- .check(
426
- z.regex(/^\d+$/),
427
- z.describe(
428
- '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'] }),
429
444
  ),
430
- z.meta({ examples: ['1000000'] }),
431
- ),
432
- id: z
433
- .string()
434
- .check(
435
- z.describe('A stable resource ID for this holder, equal to the holder address.'),
436
- z.meta({ examples: ['0xbe058e1c4df8a4366a387bf595b284246a93039e'] }),
437
- ),
438
- })
439
- .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
+ )
440
455
 
441
456
  /** Resources embedded on demand via `include`. */
442
- export const Meta = z
443
- .object({
444
- totalCountCapped: z
445
- .optional(Schema.TotalCountCapped)
446
- .check(
447
- z.describe(
448
- '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
+ ),
449
466
  ),
450
- ),
451
- token: z
452
- .optional(Token)
453
- .check(
454
- z.describe('A compact token reference, returned when you request `include=token`.'),
455
- ),
456
- totalCount: z
457
- .optional(Schema.TotalCount)
458
- .check(
459
- z.describe(
460
- '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`.'),
461
471
  ),
462
- ),
463
- })
464
- .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
+ )
465
483
 
466
484
  /** Page of TIP-20 token holders, ordered by balance descending. */
467
- export const Response = z
468
- .object({
469
- data: z
470
- .array(Holder)
471
- .check(
472
- z.describe('The holders in this page, ordered by balance from highest to lowest.'),
473
- ),
474
- meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
475
- nextCursor: Schema.NextCursor,
476
- })
477
- .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
+ )
478
499
  }
479
500
 
480
501
  /** Schemas for the getTokenTransactions operation. */
@@ -531,29 +552,32 @@ export namespace schema {
531
552
  )
532
553
 
533
554
  /** Resources embedded on demand via `include`. */
534
- export const Meta = z
535
- .object({
536
- totalCountCapped: z
537
- .optional(Schema.TotalCountCapped)
538
- .check(
539
- z.describe(
540
- '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
+ ),
541
564
  ),
542
- ),
543
- token: z
544
- .optional(Token)
545
- .check(
546
- z.describe('A compact token reference, returned when you request `include=token`.'),
547
- ),
548
- totalCount: z
549
- .optional(Schema.TotalCount)
550
- .check(
551
- z.describe(
552
- '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`.'),
553
569
  ),
554
- ),
555
- })
556
- .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
+ )
557
581
 
558
582
  /**
559
583
  * Page of transactions touching the token contract. Each row is the
@@ -564,15 +588,18 @@ export namespace schema {
564
588
  * already imports `Tokens.schema` at module init; a direct reference
565
589
  * here would close the import cycle and crash during evaluation.
566
590
  */
567
- export const Response = z
568
- .object({
569
- data: z
570
- .array(z.lazy(() => Transactions.schema.getTransaction.Response))
571
- .check(z.describe('The transactions in this page.')),
572
- meta: z.optional(Meta).check(z.describe('Extra resources you requested with `include`.')),
573
- nextCursor: Schema.NextCursor,
574
- })
575
- .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
+ )
576
603
  }
577
604
  }
578
605
 
@@ -591,6 +618,9 @@ export function tokens() {
591
618
  'Lists TIP-20 tokens on Tempo. TIP-20 is Tempo’s payments-focused token standard and a superset of ERC-20.',
592
619
  operationId: 'getTokens',
593
620
  responses: OpenApi.responses({
621
+ errors: {
622
+ 400: { codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'] },
623
+ },
594
624
  success: { description: 'A page of TIP-20 tokens.', schema: schema.getTokens.Response },
595
625
  }),
596
626
  summary: 'List tokens',
@@ -666,6 +696,14 @@ export function tokens() {
666
696
  operationId: 'getTokenBySymbol',
667
697
  responses: OpenApi.responses({
668
698
  errors: {
699
+ 400: {
700
+ codes: [
701
+ 'chain_id_invalid',
702
+ 'chain_id_unsupported',
703
+ 'query_invalid',
704
+ 'symbol_invalid',
705
+ ],
706
+ },
669
707
  404: {
670
708
  description: 'No token was found for this address or symbol.',
671
709
  codes: ['token_not_found'],
@@ -739,6 +777,9 @@ export function tokens() {
739
777
  operationId: 'getToken',
740
778
  responses: OpenApi.responses({
741
779
  errors: {
780
+ 400: {
781
+ codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid', 'token_invalid'],
782
+ },
742
783
  404: {
743
784
  description: 'No token was found for this address or symbol.',
744
785
  codes: ['token_not_found'],
@@ -799,8 +840,15 @@ export function tokens() {
799
840
  description: 'The token logo image.',
800
841
  headers: OpenApi.successHeaders,
801
842
  },
802
- 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
+ ]),
803
850
  401: OpenApi.standardError(401, 'The API key is missing or invalid.'),
851
+ 403: OpenApi.standardError(403, 'The API key cannot access this resource.'),
804
852
  404: OpenApi.standardError(404, 'No logo image was found for this token.', [
805
853
  'token_logo_not_found',
806
854
  ]),
@@ -884,7 +932,12 @@ export function tokens() {
884
932
  'Lists the accounts that hold a TIP-20 token, ordered from largest to smallest balance.',
885
933
  operationId: 'getTokenHolders',
886
934
  responses: OpenApi.responses({
887
- 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
+ },
888
941
  success: {
889
942
  description: 'A page of token holders.',
890
943
  schema: schema.getTokenHolders.Response,
@@ -974,7 +1027,12 @@ export function tokens() {
974
1027
  description: 'Lists transactions that interacted with this token contract.',
975
1028
  operationId: 'getTokenTransactions',
976
1029
  responses: OpenApi.responses({
977
- 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
+ },
978
1036
  success: {
979
1037
  description: 'A page of transactions involving this token contract.',
980
1038
  schema: schema.getTokenTransactions.Response,