tapimo 0.9.0 → 0.10.1

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 (319) hide show
  1. package/dist/ApiKey.d.ts +2 -1
  2. package/dist/ApiKey.d.ts.map +1 -1
  3. package/dist/ApiKeys.d.ts +4 -2
  4. package/dist/ApiKeys.d.ts.map +1 -1
  5. package/dist/ApiKeys.js +26 -1
  6. package/dist/ApiKeys.js.map +1 -1
  7. package/dist/App.d.ts +4292 -3708
  8. package/dist/App.d.ts.map +1 -1
  9. package/dist/App.js +1 -0
  10. package/dist/App.js.map +1 -1
  11. package/dist/Webhooks.d.ts +21 -20
  12. package/dist/Webhooks.d.ts.map +1 -1
  13. package/dist/Webhooks.js +66 -23
  14. package/dist/Webhooks.js.map +1 -1
  15. package/dist/admin/App.d.ts +91 -84
  16. package/dist/admin/App.d.ts.map +1 -1
  17. package/dist/admin/apps/api-keys.d.ts +26 -17
  18. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  19. package/dist/admin/apps/api-keys.js +6 -0
  20. package/dist/admin/apps/api-keys.js.map +1 -1
  21. package/dist/admin/apps/organizations.d.ts +4 -2
  22. package/dist/admin/apps/organizations.d.ts.map +1 -1
  23. package/dist/admin/apps/verified-tokens.d.ts +168 -168
  24. package/dist/admin/ui.generated.d.ts +1 -1
  25. package/dist/admin/ui.generated.js +69 -69
  26. package/dist/admin/ui.generated.js.map +1 -1
  27. package/dist/analytics/Analytics.d.ts.map +1 -1
  28. package/dist/analytics/Analytics.js +26 -0
  29. package/dist/analytics/Analytics.js.map +1 -1
  30. package/dist/apps/Zones.d.ts +4280 -84
  31. package/dist/apps/Zones.d.ts.map +1 -1
  32. package/dist/apps/Zones.js +30 -10
  33. package/dist/apps/Zones.js.map +1 -1
  34. package/dist/apps/data/App.d.ts +5799 -4929
  35. package/dist/apps/data/App.d.ts.map +1 -1
  36. package/dist/apps/data/FxOracle.d.ts +4 -5
  37. package/dist/apps/data/FxOracle.d.ts.map +1 -1
  38. package/dist/apps/data/FxOracle.js +19 -4
  39. package/dist/apps/data/FxOracle.js.map +1 -1
  40. package/dist/apps/data/routes/activities.d.ts +3391 -492
  41. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  42. package/dist/apps/data/routes/activities.js +372 -29
  43. package/dist/apps/data/routes/activities.js.map +1 -1
  44. package/dist/apps/data/routes/addresses.d.ts +853 -339
  45. package/dist/apps/data/routes/addresses.d.ts.map +1 -1
  46. package/dist/apps/data/routes/balances.d.ts +10 -10
  47. package/dist/apps/data/routes/balances.d.ts.map +1 -1
  48. package/dist/apps/data/routes/balances.js +145 -83
  49. package/dist/apps/data/routes/balances.js.map +1 -1
  50. package/dist/apps/data/routes/blocks.d.ts +123 -123
  51. package/dist/apps/data/routes/coingecko.d.ts +169 -169
  52. package/dist/apps/data/routes/earn.d.ts +455 -1
  53. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  54. package/dist/apps/data/routes/earn.js +369 -45
  55. package/dist/apps/data/routes/earn.js.map +1 -1
  56. package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
  57. package/dist/apps/data/routes/exchanges.js +114 -118
  58. package/dist/apps/data/routes/exchanges.js.map +1 -1
  59. package/dist/apps/data/routes/fee-amm.d.ts +24 -24
  60. package/dist/apps/data/routes/indexer.d.ts +35 -34
  61. package/dist/apps/data/routes/indexer.d.ts.map +1 -1
  62. package/dist/apps/data/routes/indexer.js +3 -2
  63. package/dist/apps/data/routes/indexer.js.map +1 -1
  64. package/dist/apps/data/routes/receipts.d.ts.map +1 -1
  65. package/dist/apps/data/routes/receipts.js +68 -47
  66. package/dist/apps/data/routes/receipts.js.map +1 -1
  67. package/dist/apps/data/routes/rpc.d.ts +31 -31
  68. package/dist/apps/data/routes/rpc.d.ts.map +1 -1
  69. package/dist/apps/data/routes/rpc.js +5 -1
  70. package/dist/apps/data/routes/rpc.js.map +1 -1
  71. package/dist/apps/data/routes/tokenlist.d.ts +12 -12
  72. package/dist/apps/data/routes/tokens.d.ts +461 -459
  73. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  74. package/dist/apps/data/routes/transactions.d.ts +313 -305
  75. package/dist/apps/data/routes/transactions.d.ts.map +1 -1
  76. package/dist/apps/data/routes/transactions.js +25 -23
  77. package/dist/apps/data/routes/transactions.js.map +1 -1
  78. package/dist/apps/data/routes/transfers.d.ts +108 -86
  79. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  80. package/dist/apps/data/routes/transfers.js +618 -105
  81. package/dist/apps/data/routes/transfers.js.map +1 -1
  82. package/dist/apps/data/routes/valuation.d.ts +21 -21
  83. package/dist/apps/data/routes/valuation.d.ts.map +1 -1
  84. package/dist/apps/data/routes/valuation.js +2 -2
  85. package/dist/apps/data/routes/valuation.js.map +1 -1
  86. package/dist/apps/data/routes/webhooks.d.ts +519 -868
  87. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  88. package/dist/apps/data/routes/webhooks.js +642 -353
  89. package/dist/apps/data/routes/webhooks.js.map +1 -1
  90. package/dist/apps/data/routes/zones.d.ts +31 -31
  91. package/dist/apps/data/routes/zones.d.ts.map +1 -1
  92. package/dist/apps/data/routes/zones.js +4 -2
  93. package/dist/apps/data/routes/zones.js.map +1 -1
  94. package/dist/apps/funding/routes/deposit-addresses.js +1 -1
  95. package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
  96. package/dist/apps/funding/routes/providers.d.ts +13 -13
  97. package/dist/apps/funding/routes/quotes.d.ts +89 -89
  98. package/dist/apps/funding/routes/transfers.d.ts +36 -36
  99. package/dist/apps/funding/routes/transfers.js +1 -1
  100. package/dist/apps/funding/routes/transfers.js.map +1 -1
  101. package/dist/apps/management/App.d.ts +11 -309
  102. package/dist/apps/management/App.d.ts.map +1 -1
  103. package/dist/apps/management/routes/api-keys.d.ts +74 -74
  104. package/dist/apps/management/routes/billing.js +1 -1
  105. package/dist/apps/management/routes/billing.js.map +1 -1
  106. package/dist/apps/management/routes/faucet.d.ts +35 -35
  107. package/dist/apps/management/routes/faucet.js +2 -2
  108. package/dist/apps/management/routes/faucet.js.map +1 -1
  109. package/dist/apps/management/routes/invitations.d.ts +134 -134
  110. package/dist/apps/management/routes/invite-links.d.ts +80 -80
  111. package/dist/apps/management/routes/members.d.ts +69 -69
  112. package/dist/apps/management/routes/orgs.d.ts +98 -98
  113. package/dist/apps/management/routes/projects.d.ts +60 -60
  114. package/dist/apps/management/routes/usage.d.ts +72 -72
  115. package/dist/apps/management/routes/verified-token-requests.d.ts +83 -83
  116. package/dist/apps/management/routes/webhooks.d.ts +203 -618
  117. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  118. package/dist/apps/mcp.d.ts.map +1 -1
  119. package/dist/apps/mcp.js +4 -1
  120. package/dist/apps/mcp.js.map +1 -1
  121. package/dist/apps/mpp/App.d.ts +56 -44
  122. package/dist/apps/mpp/App.d.ts.map +1 -1
  123. package/dist/apps/mpp/Mpp.d.ts +3 -0
  124. package/dist/apps/mpp/Mpp.d.ts.map +1 -1
  125. package/dist/apps/mpp/Mpp.js +3 -0
  126. package/dist/apps/mpp/Mpp.js.map +1 -1
  127. package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
  128. package/dist/apps/mpp/internal/Adapter.js +9 -2
  129. package/dist/apps/mpp/internal/Adapter.js.map +1 -1
  130. package/dist/db/Db.d.ts +4 -2
  131. package/dist/db/Db.d.ts.map +1 -1
  132. package/dist/db/Db.js +75 -15
  133. package/dist/db/Db.js.map +1 -1
  134. package/dist/db/Schema.d.ts +19 -0
  135. package/dist/db/Schema.d.ts.map +1 -1
  136. package/dist/db/Schema.js +24 -0
  137. package/dist/db/Schema.js.map +1 -1
  138. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
  139. package/dist/db/tables/sponsoredTransactions.js +4 -1
  140. package/dist/db/tables/sponsoredTransactions.js.map +1 -1
  141. package/dist/db/tables/webhookQueueEvents.d.ts +122 -0
  142. package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -0
  143. package/dist/db/tables/webhookQueueEvents.js +160 -0
  144. package/dist/db/tables/webhookQueueEvents.js.map +1 -0
  145. package/dist/db/tables/webhookSubscriptions.d.ts +58 -3
  146. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  147. package/dist/db/tables/webhookSubscriptions.js +86 -3
  148. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  149. package/dist/internal/Auth.d.ts +3 -0
  150. package/dist/internal/Auth.d.ts.map +1 -1
  151. package/dist/internal/Auth.js +6 -4
  152. package/dist/internal/Auth.js.map +1 -1
  153. package/dist/internal/MetricSink.d.ts +139 -3
  154. package/dist/internal/MetricSink.d.ts.map +1 -1
  155. package/dist/internal/MetricSink.js +144 -4
  156. package/dist/internal/MetricSink.js.map +1 -1
  157. package/dist/internal/RateLimit.d.ts +4 -6
  158. package/dist/internal/RateLimit.d.ts.map +1 -1
  159. package/dist/internal/RateLimit.js +15 -14
  160. package/dist/internal/RateLimit.js.map +1 -1
  161. package/dist/internal/Schema.js +1 -1
  162. package/dist/internal/Schema.js.map +1 -1
  163. package/dist/internal/Store.d.ts +2 -1
  164. package/dist/internal/Store.d.ts.map +1 -1
  165. package/dist/internal/Store.js +57 -18
  166. package/dist/internal/Store.js.map +1 -1
  167. package/dist/internal/Tidx.d.ts +1 -3
  168. package/dist/internal/Tidx.d.ts.map +1 -1
  169. package/dist/internal/Tidx.js +1 -3
  170. package/dist/internal/Tidx.js.map +1 -1
  171. package/dist/internal/Value.d.ts +2 -0
  172. package/dist/internal/Value.d.ts.map +1 -1
  173. package/dist/internal/Value.js +25 -0
  174. package/dist/internal/Value.js.map +1 -1
  175. package/dist/internal/Viem.d.ts.map +1 -1
  176. package/dist/internal/Viem.js +2 -1
  177. package/dist/internal/Viem.js.map +1 -1
  178. package/dist/internal/WebhookDestination.d.ts +2 -0
  179. package/dist/internal/WebhookDestination.d.ts.map +1 -1
  180. package/dist/internal/WebhookDestination.js +11 -0
  181. package/dist/internal/WebhookDestination.js.map +1 -1
  182. package/dist/internal/WebhookTransfer.d.ts +75 -0
  183. package/dist/internal/WebhookTransfer.d.ts.map +1 -0
  184. package/dist/internal/WebhookTransfer.js +299 -0
  185. package/dist/internal/WebhookTransfer.js.map +1 -0
  186. package/dist/internal/Webhooks.d.ts +176 -0
  187. package/dist/internal/Webhooks.d.ts.map +1 -1
  188. package/dist/internal/Webhooks.js +216 -20
  189. package/dist/internal/Webhooks.js.map +1 -1
  190. package/dist/internal/funding/Provider.d.ts +4 -0
  191. package/dist/internal/funding/Provider.d.ts.map +1 -1
  192. package/dist/internal/funding/Provider.js +11 -7
  193. package/dist/internal/funding/Provider.js.map +1 -1
  194. package/dist/internal/funding/Reconciliation.d.ts.map +1 -1
  195. package/dist/internal/funding/Reconciliation.js +128 -0
  196. package/dist/internal/funding/Reconciliation.js.map +1 -1
  197. package/dist/internal/funding/providers/relay.d.ts +6 -4
  198. package/dist/internal/funding/providers/relay.d.ts.map +1 -1
  199. package/dist/internal/funding/providers/relay.js +71 -9
  200. package/dist/internal/funding/providers/relay.js.map +1 -1
  201. package/package.json +4 -4
  202. package/src/ApiKeys.test.ts +20 -0
  203. package/src/ApiKeys.ts +28 -1
  204. package/src/App.test.ts +10 -8
  205. package/src/App.ts +1 -0
  206. package/src/Client.test-d.ts +61 -5
  207. package/src/Webhooks.bench.ts +714 -0
  208. package/src/Webhooks.memory.bench.ts +250 -0
  209. package/src/Webhooks.test.ts +77 -6
  210. package/src/Webhooks.ts +85 -29
  211. package/src/admin/apps/api-keys.test.ts +9 -0
  212. package/src/admin/apps/api-keys.ts +15 -0
  213. package/src/admin/ui/src/lib/query-client.ts +3 -2
  214. package/src/admin/ui/src/routes/api-keys.tsx +31 -9
  215. package/src/admin/ui.generated.ts +69 -69
  216. package/src/analytics/Analytics.test.ts +8 -0
  217. package/src/analytics/Analytics.ts +26 -0
  218. package/src/apps/Zones.test.ts +23 -5
  219. package/src/apps/Zones.ts +31 -10
  220. package/src/apps/composition.test.ts +1 -0
  221. package/src/apps/data/App.test.ts +2 -2
  222. package/src/apps/data/FxOracle.test.ts +18 -0
  223. package/src/apps/data/FxOracle.ts +28 -5
  224. package/src/apps/data/routes/activities.bench.ts +41 -0
  225. package/src/apps/data/routes/activities.test.ts +122 -2
  226. package/src/apps/data/routes/activities.ts +435 -32
  227. package/src/apps/data/routes/balances.bench.ts +21 -0
  228. package/src/apps/data/routes/balances.test.ts +119 -10
  229. package/src/apps/data/routes/balances.ts +164 -97
  230. package/src/apps/data/routes/blocks.bench.ts +34 -0
  231. package/src/apps/data/routes/blocks.test.ts +12 -6
  232. package/src/apps/data/routes/coingecko.bench.ts +53 -0
  233. package/src/apps/data/routes/earn.bench.ts +71 -0
  234. package/src/apps/data/routes/earn.test.ts +197 -0
  235. package/src/apps/data/routes/earn.ts +487 -45
  236. package/src/apps/data/routes/exchanges.bench.ts +85 -0
  237. package/src/apps/data/routes/exchanges.test.ts +7 -6
  238. package/src/apps/data/routes/exchanges.ts +124 -117
  239. package/src/apps/data/routes/fee-amm.bench.ts +13 -0
  240. package/src/apps/data/routes/indexer.bench.ts +8 -0
  241. package/src/apps/data/routes/indexer.test.ts +2 -1
  242. package/src/apps/data/routes/indexer.ts +3 -2
  243. package/src/apps/data/routes/receipts.bench.ts +39 -0
  244. package/src/apps/data/routes/receipts.test.ts +24 -7
  245. package/src/apps/data/routes/receipts.ts +67 -50
  246. package/src/apps/data/routes/rpc.bench.ts +14 -0
  247. package/src/apps/data/routes/rpc.test.ts +27 -0
  248. package/src/apps/data/routes/rpc.ts +5 -1
  249. package/src/apps/data/routes/tokenlist.bench.ts +3 -0
  250. package/src/apps/data/routes/tokens.bench.ts +76 -0
  251. package/src/apps/data/routes/tokens.test.ts +51 -0
  252. package/src/apps/data/routes/transactions.bench.ts +40 -0
  253. package/src/apps/data/routes/transactions.test.ts +42 -0
  254. package/src/apps/data/routes/transactions.ts +44 -39
  255. package/src/apps/data/routes/transfers.bench.ts +28 -0
  256. package/src/apps/data/routes/transfers.test.ts +402 -24
  257. package/src/apps/data/routes/transfers.ts +708 -101
  258. package/src/apps/data/routes/valuation.bench.ts +14 -0
  259. package/src/apps/data/routes/valuation.test.ts +26 -0
  260. package/src/apps/data/routes/valuation.ts +6 -2
  261. package/src/apps/data/routes/verified-tokens.bench.ts +8 -0
  262. package/src/apps/data/routes/webhooks.bench.ts +26 -0
  263. package/src/apps/data/routes/webhooks.scan.test.ts +326 -0
  264. package/src/apps/data/routes/webhooks.test.ts +466 -135
  265. package/src/apps/data/routes/webhooks.ts +820 -429
  266. package/src/apps/data/routes/zones.bench.ts +32 -0
  267. package/src/apps/data/routes/zones.test.ts +1 -1
  268. package/src/apps/data/routes/zones.ts +7 -2
  269. package/src/apps/funding/routes/chains.test.ts +1 -1
  270. package/src/apps/funding/routes/deposit-addresses.test.ts +1 -1
  271. package/src/apps/funding/routes/deposit-addresses.ts +1 -1
  272. package/src/apps/funding/routes/providers.test.ts +1 -1
  273. package/src/apps/funding/routes/quotes.test.ts +2 -2
  274. package/src/apps/funding/routes/transfers.test.ts +3 -6
  275. package/src/apps/funding/routes/transfers.ts +1 -1
  276. package/src/apps/management/routes/billing.ts +1 -1
  277. package/src/apps/management/routes/faucet.ts +2 -2
  278. package/src/apps/management/routes/me.test.ts +31 -0
  279. package/src/apps/mcp.ts +4 -1
  280. package/src/apps/mpp/Mpp.test.ts +13 -1
  281. package/src/apps/mpp/Mpp.ts +8 -0
  282. package/src/apps/mpp/internal/Adapter.ts +10 -2
  283. package/src/db/Db.test.ts +40 -6
  284. package/src/db/Db.ts +114 -19
  285. package/src/db/Schema.ts +32 -0
  286. package/src/db/tables/sponsoredTransactions.ts +9 -2
  287. package/src/db/tables/webhookQueueEvents.ts +285 -0
  288. package/src/db/tables/webhookSubscriptions.ts +131 -4
  289. package/src/internal/Auth.test.ts +61 -50
  290. package/src/internal/Auth.ts +9 -4
  291. package/src/internal/EarnVaults.test.ts +2 -2
  292. package/src/internal/MetricSink.test.ts +575 -0
  293. package/src/internal/MetricSink.ts +325 -10
  294. package/src/internal/RateLimit.test.ts +23 -18
  295. package/src/internal/RateLimit.ts +23 -15
  296. package/src/internal/Schema.ts +1 -1
  297. package/src/internal/Store.test.ts +99 -13
  298. package/src/internal/Store.ts +52 -17
  299. package/src/internal/Tidx.test.ts +4 -4
  300. package/src/internal/Tidx.ts +1 -3
  301. package/src/internal/Value.test.ts +25 -0
  302. package/src/internal/Value.ts +29 -0
  303. package/src/internal/Viem.test.ts +8 -0
  304. package/src/internal/Viem.ts +2 -1
  305. package/src/internal/WebhookDestination.test.ts +20 -0
  306. package/src/internal/WebhookDestination.ts +10 -0
  307. package/src/internal/WebhookTransfer.test.ts +89 -0
  308. package/src/internal/WebhookTransfer.ts +430 -0
  309. package/src/internal/Webhooks.test.ts +616 -0
  310. package/src/internal/Webhooks.ts +412 -24
  311. package/src/internal/funding/Provider.test.ts +48 -8
  312. package/src/internal/funding/Provider.ts +12 -7
  313. package/src/internal/funding/Reconciliation.local.test.ts +3 -1
  314. package/src/internal/funding/Reconciliation.test.ts +1240 -0
  315. package/src/internal/funding/Reconciliation.ts +136 -0
  316. package/src/internal/funding/SourceObservation.test.ts +1 -0
  317. package/src/internal/funding/providers/index.test.ts +73 -3
  318. package/src/internal/funding/providers/relay.test.ts +2 -9
  319. package/src/internal/funding/providers/relay.ts +72 -13
@@ -0,0 +1,85 @@
1
+ import * as QueryBench from '../../../../test/QueryBench.js'
2
+
3
+ const fixtures = {
4
+ 4217: {
5
+ base: '0x20c0000000000000000000001a47bebe936d00d7',
6
+ filledOrderId: '3881',
7
+ orderId: '3312',
8
+ },
9
+ 42431: {
10
+ base: '0x20c000000000000000000000746cbc54ce86a3cb',
11
+ filledOrderId: '18047908',
12
+ orderId: '18048313',
13
+ },
14
+ } as const
15
+
16
+ QueryBench.bench({
17
+ name: 'getSwaps',
18
+ path: '/v1/exchange/swaps',
19
+ queries: ['include=token.logoUri', 'include=token.verified', 'valuation.currency=USD'],
20
+ })
21
+
22
+ QueryBench.bench({
23
+ name: 'getPairs',
24
+ path: '/v1/exchange/pairs',
25
+ queries: ['include=tokens', 'include=totalCount', 'sort=liquidity'],
26
+ })
27
+
28
+ QueryBench.bench({
29
+ name: 'getPair',
30
+ path: {
31
+ 4217: `/v1/exchange/pairs/${fixtures[4217].base}`,
32
+ 42431: `/v1/exchange/pairs/${fixtures[42431].base}`,
33
+ },
34
+ queries: ['include=tokens'],
35
+ })
36
+
37
+ QueryBench.bench({
38
+ name: 'getOrders',
39
+ path: '/v1/exchange/orders',
40
+ queries: ['include=tokens', 'include=totalCount'],
41
+ })
42
+
43
+ QueryBench.bench({
44
+ name: 'getOrders?base',
45
+ path: {
46
+ 4217: `/v1/exchange/orders?base=${fixtures[4217].base}`,
47
+ 42431: `/v1/exchange/orders?base=${fixtures[42431].base}`,
48
+ },
49
+ })
50
+
51
+ QueryBench.bench({
52
+ name: 'getOrder',
53
+ path: {
54
+ 4217: `/v1/exchange/orders/${fixtures[4217].orderId}`,
55
+ 42431: `/v1/exchange/orders/${fixtures[42431].orderId}`,
56
+ },
57
+ queries: ['include=tokens'],
58
+ })
59
+
60
+ QueryBench.bench({
61
+ name: 'getOrderFills',
62
+ path: {
63
+ 4217: `/v1/exchange/orders/${fixtures[4217].filledOrderId}/fills`,
64
+ 42431: `/v1/exchange/orders/${fixtures[42431].filledOrderId}/fills`,
65
+ },
66
+ queries: ['include=totalCount'],
67
+ })
68
+
69
+ QueryBench.bench({
70
+ name: 'getPairOhlc',
71
+ path: {
72
+ 4217: `/v1/exchange/pairs/${fixtures[4217].base}/ohlc`,
73
+ 42431: `/v1/exchange/pairs/${fixtures[42431].base}/ohlc`,
74
+ },
75
+ queries: ['include=tokens'],
76
+ })
77
+
78
+ QueryBench.bench({
79
+ name: 'getPairDepth',
80
+ path: {
81
+ 4217: `/v1/exchange/pairs/${fixtures[4217].base}/depth`,
82
+ 42431: `/v1/exchange/pairs/${fixtures[42431].base}/depth`,
83
+ },
84
+ queries: ['include=tokens'],
85
+ })
@@ -690,6 +690,7 @@ describe('GET /exchange/swaps', () => {
690
690
  expect(response.status).toBe(200)
691
691
  const body = await TestApp.json(response, Exchanges.schema.getSwaps.Response)
692
692
  expect(body.data.length).toBeLessThanOrEqual(10)
693
+ expect(response.headers.get('server-timing')).not.toContain('valuation_rates;dur=')
693
694
  if (body.data.length === 0) return
694
695
 
695
696
  for (const swap of body.data) {
@@ -708,6 +709,7 @@ describe('GET /exchange/swaps', () => {
708
709
  expect(swap.sourceAmount.currency).toBe(swap.sourceToken.currency)
709
710
  expect(swap.sourceAmount.decimals).toBe(swap.sourceToken.decimals)
710
711
  expect(swap.sourceAmount.formatted).toMatch(/^\d+(\.\d+)?$/)
712
+ expect('valuation' in swap.sourceAmount).toBe(false)
711
713
  expect(swap.destinationToken.address).toMatch(/^0x[0-9a-f]{40}$/)
712
714
  expect(swap.destinationToken).not.toHaveProperty('amount')
713
715
  expect(typeof swap.destinationToken.currency).toBe('string')
@@ -720,6 +722,7 @@ describe('GET /exchange/swaps', () => {
720
722
  expect(swap.destinationAmount.currency).toBe(swap.destinationToken.currency)
721
723
  expect(swap.destinationAmount.decimals).toBe(swap.destinationToken.decimals)
722
724
  expect(swap.destinationAmount.formatted).toMatch(/^\d+(\.\d+)?$/)
725
+ expect('valuation' in swap.destinationAmount).toBe(false)
723
726
  expect(swap.rate).toMatch(/^\d+(\.\d+)?$/)
724
727
  expect(swap.filledAt).toMatch(/^\d{4}-\d{2}-\d{2}T/)
725
728
  // `route` spans source → destination; its ends mirror the side tokens.
@@ -739,10 +742,12 @@ describe('GET /exchange/swaps', () => {
739
742
  expect(fill.sourceAmount.baseUnits).toMatch(/^\d+$/)
740
743
  expect(fill.sourceAmount.currency).toBe(fill.sourceToken.currency)
741
744
  expect(fill.sourceAmount.decimals).toBe(fill.sourceToken.decimals)
745
+ expect('valuation' in fill.sourceAmount).toBe(false)
742
746
  expect(fill.destinationToken).not.toHaveProperty('amount')
743
747
  expect(fill.destinationAmount.baseUnits).toMatch(/^\d+$/)
744
748
  expect(fill.destinationAmount.currency).toBe(fill.destinationToken.currency)
745
749
  expect(fill.destinationAmount.decimals).toBe(fill.destinationToken.decimals)
750
+ expect('valuation' in fill.destinationAmount).toBe(false)
746
751
  }
747
752
  for (let i = 1; i < swap.fills.length; i++)
748
753
  expect(swap.fills[i]!.logIndex).toBeGreaterThan(swap.fills[i - 1]!.logIndex)
@@ -1033,7 +1038,7 @@ describe('POST /exchange/quotes', () => {
1033
1038
  }, 120_000)
1034
1039
 
1035
1040
  test('quotes exact-source liquidity and returns approval then sell calls', async () => {
1036
- // Pin an empty curated list so both legs deterministically value `null`.
1041
+ // Pin an empty curated list so optional curated fields stay deterministic.
1037
1042
  const db = TestApp.database()
1038
1043
  await TestApp.verifiedSeed(db, Runtime.get().chainId, { tokens: [] })
1039
1044
  const client = TestApp.client({ db })
@@ -1061,7 +1066,6 @@ describe('POST /exchange/quotes', () => {
1061
1066
  currency: 'USD',
1062
1067
  decimals: 6,
1063
1068
  formatted: '0.000001',
1064
- valuation: null,
1065
1069
  })
1066
1070
  expect(body.destinationToken).toMatchObject({
1067
1071
  address: Addresses.pathUsd,
@@ -1076,7 +1080,6 @@ describe('POST /exchange/quotes', () => {
1076
1080
  currency: 'USD',
1077
1081
  decimals: 6,
1078
1082
  formatted: '0.000001',
1079
- valuation: null,
1080
1083
  })
1081
1084
  expect(body.sourceToken).toMatchObject({
1082
1085
  address: baseToken,
@@ -1103,7 +1106,7 @@ describe('POST /exchange/quotes', () => {
1103
1106
  }, 60_000)
1104
1107
 
1105
1108
  test('quotes exact-destination liquidity and returns approval then buy calls', async () => {
1106
- // Pin an empty curated list so both legs deterministically value `null`.
1109
+ // Pin an empty curated list so optional curated fields stay deterministic.
1107
1110
  const db = TestApp.database()
1108
1111
  await TestApp.verifiedSeed(db, Runtime.get().chainId, { tokens: [] })
1109
1112
  const client = TestApp.client({ db })
@@ -1132,7 +1135,6 @@ describe('POST /exchange/quotes', () => {
1132
1135
  currency: 'USD',
1133
1136
  decimals: 6,
1134
1137
  formatted: '0.000001',
1135
- valuation: null,
1136
1138
  })
1137
1139
  expect(body.destinationToken).toMatchObject({
1138
1140
  address: baseToken,
@@ -1147,7 +1149,6 @@ describe('POST /exchange/quotes', () => {
1147
1149
  currency: 'USD',
1148
1150
  decimals: 6,
1149
1151
  formatted: '0.000002',
1150
- valuation: null,
1151
1152
  })
1152
1153
  expect(body.sourceAmount).toEqual(body.destinationAmount)
1153
1154
  expect(body.sourceToken).toMatchObject({
@@ -1776,18 +1776,22 @@ export function exchanges(options: exchanges.Options = {}) {
1776
1776
  try {
1777
1777
  // Value quoted amounts via their curated display currency; snapshot
1778
1778
  // or rate failures degrade the values to `null`, never the quote.
1779
- const denomination = query['valuation.currency'] ?? 'USD'
1780
- const snapshot = await VerifiedTokens.snapshot(c, chainId).catch(() => undefined)
1781
- const rates = await Valuation.ratesFor(c, {
1782
- currencies: snapshot
1783
- ? [request.destinationToken, request.sourceToken].flatMap((address) => {
1784
- const held = snapshot.byAddress.get(address.toLowerCase())?.currency
1785
- return held === undefined ? [] : [held]
1786
- })
1787
- : [],
1788
- denomination,
1789
- oracle,
1790
- })
1779
+ const denomination = query['valuation.currency']
1780
+ const snapshot = denomination
1781
+ ? await VerifiedTokens.snapshot(c, chainId).catch(() => undefined)
1782
+ : undefined
1783
+ const rates = denomination
1784
+ ? await Valuation.ratesFor(c, {
1785
+ currencies: snapshot
1786
+ ? [request.destinationToken, request.sourceToken].flatMap((address) => {
1787
+ const held = snapshot.byAddress.get(address.toLowerCase())?.currency
1788
+ return held === undefined ? [] : [held]
1789
+ })
1790
+ : [],
1791
+ denomination,
1792
+ oracle,
1793
+ })
1794
+ : undefined
1791
1795
  const valued = (
1792
1796
  baseUnits: bigint | string,
1793
1797
  address: string,
@@ -1798,12 +1802,16 @@ export function exchanges(options: exchanges.Options = {}) {
1798
1802
  currency: token.currency,
1799
1803
  decimals: token.decimals,
1800
1804
  }),
1801
- valuation: Valuation.valuationFor({
1802
- amount: BigInt(baseUnits),
1803
- denomination,
1804
- rates,
1805
- token: snapshot?.byAddress.get(address.toLowerCase()),
1806
- }),
1805
+ ...(denomination
1806
+ ? {
1807
+ valuation: Valuation.valuationFor({
1808
+ amount: BigInt(baseUnits),
1809
+ denomination,
1810
+ rates,
1811
+ token: snapshot?.byAddress.get(address.toLowerCase()),
1812
+ }),
1813
+ }
1814
+ : {}),
1807
1815
  })
1808
1816
 
1809
1817
  if (options.nativeDex === false || amount > maxSwapAmount)
@@ -2210,23 +2218,25 @@ export function exchanges(options: exchanges.Options = {}) {
2210
2218
  })
2211
2219
  // Value amounts via their curated display currency; snapshot or rate
2212
2220
  // failures degrade the values to `null`, never the feed.
2213
- const denomination = options['valuation.currency'] ?? 'USD'
2221
+ const denomination = options['valuation.currency']
2214
2222
  const snapshot =
2215
- page.data.length > 0
2223
+ denomination !== undefined && page.data.length > 0
2216
2224
  ? await VerifiedTokens.snapshot(c, chainId).catch(() => undefined)
2217
2225
  : undefined
2218
- const rates = await Valuation.ratesFor(c, {
2219
- currencies: snapshot
2220
- ? page.data.flatMap((swap) =>
2221
- swap.route.flatMap((address) => {
2222
- const held = snapshot.byAddress.get(address.toLowerCase())?.currency
2223
- return held === undefined ? [] : [held]
2224
- }),
2225
- )
2226
- : [],
2227
- denomination,
2228
- oracle,
2229
- })
2226
+ const rates = denomination
2227
+ ? await Valuation.ratesFor(c, {
2228
+ currencies: snapshot
2229
+ ? page.data.flatMap((swap) =>
2230
+ swap.route.flatMap((address) => {
2231
+ const held = snapshot.byAddress.get(address.toLowerCase())?.currency
2232
+ return held === undefined ? [] : [held]
2233
+ }),
2234
+ )
2235
+ : [],
2236
+ denomination,
2237
+ oracle,
2238
+ })
2239
+ : undefined
2230
2240
  const enrichSide = (side: getSwaps.Side) => {
2231
2241
  const token = tokensByAddress.get(side.address)
2232
2242
  if (!token) throw new Error(`Token metadata unavailable for ${side.address}`)
@@ -2237,12 +2247,16 @@ export function exchanges(options: exchanges.Options = {}) {
2237
2247
  currency: token.currency,
2238
2248
  decimals: token.decimals,
2239
2249
  }),
2240
- valuation: Valuation.valuationFor({
2241
- amount: BigInt(side.amount),
2242
- denomination,
2243
- rates,
2244
- token: snapshot?.byAddress.get(side.address.toLowerCase()),
2245
- }),
2250
+ ...(denomination
2251
+ ? {
2252
+ valuation: Valuation.valuationFor({
2253
+ amount: BigInt(side.amount),
2254
+ denomination,
2255
+ rates,
2256
+ token: snapshot?.byAddress.get(side.address.toLowerCase()),
2257
+ }),
2258
+ }
2259
+ : {}),
2246
2260
  },
2247
2261
  token: {
2248
2262
  address: side.address,
@@ -3705,12 +3719,8 @@ async function getSwaps(c: Context<App.Environment>, options: getSwaps.Options)
3705
3719
  }
3706
3720
 
3707
3721
  // A selective row predicate (`taker`/`maker`/`participant`/`transactionHash`)
3708
- // makes matching fills sparse across a wide block range, so enumerate the
3709
- // exact blocks holding a matching fill up front: it is cheap (bloom-indexed,
3710
- // no `GROUP BY`/`groupArray`) and lets the window sweep jump straight to the
3711
- // next populated block instead of paying a full grouped round-trip for every
3712
- // empty `swapWindowBlocks` gap between clusters. The block list also yields
3713
- // the scan bounds, so no separate `min`/`max` query is needed.
3722
+ // makes matching fills sparse across a wide block range. Find the next
3723
+ // populated block before each window so the sweep skips empty gaps.
3714
3724
  //
3715
3725
  // The discovery predicate must be a *superset* of the grouped page query's
3716
3726
  // matches. The page query applies `maker`/`participant` as existential
@@ -3735,24 +3745,35 @@ async function getSwaps(c: Context<App.Environment>, options: getSwaps.Options)
3735
3745
  if (witnesses.length > 0) blockFilters.push(`(${witnesses.join(' OR ')})`)
3736
3746
  }
3737
3747
 
3738
- // Distinct matching blocks, ascending (binary-searched in `windowFrom`).
3739
- // Only populated for selective queries; the unfiltered feed would match
3740
- // nearly every block, so it keeps the `min`/`max` bound + fixed-stride sweep.
3741
- let matchingBlocks: number[] | undefined
3742
- const bounds = await Timing.time(c, 'swap_bounds', async () => {
3748
+ const cursorBlock = cursor !== undefined ? Number(cursor[0]) : undefined
3749
+
3750
+ // Keep discovery bounded so TIDX response limits cannot truncate the scan
3751
+ // head. The predicate stays a superset of the grouped query.
3752
+ const findMatchingBlock = async (anchor: number | undefined) => {
3753
+ const filters = [...blockFilters]
3754
+ if (anchor !== undefined)
3755
+ filters.push(`f.block_num ${order === 'asc' ? '>=' : '<='} ${anchor}`)
3756
+ const result = await tidx.fetch({
3757
+ chainId,
3758
+ engine: 'clickhouse',
3759
+ query:
3760
+ `SELECT f.block_num AS block_num FROM dex_fills f WHERE ${filters.join(' AND ')} ORDER BY block_num ${direction} LIMIT 1` as string,
3761
+ })
3762
+ const row = result.rows[0]
3763
+ return row ? Value.toNumber(row['block_num']) : undefined
3764
+ }
3765
+
3766
+ type ScanBounds = BlockWindow & { firstMatchingBlock?: number | undefined }
3767
+ const bounds: ScanBounds | undefined = await Timing.time(c, 'swap_bounds', async () => {
3743
3768
  if (selective) {
3744
- const result = await tidx.fetch({
3745
- chainId,
3746
- engine: 'clickhouse',
3747
- query:
3748
- `SELECT DISTINCT f.block_num AS block_num FROM dex_fills f WHERE ${blockFilters.join(' AND ')} ORDER BY block_num ASC` as string,
3749
- })
3750
- matchingBlocks = result.rows
3751
- .map((row) => Value.toNumber(row['block_num']))
3752
- .filter((block): block is number => block !== undefined)
3753
- const lo = matchingBlocks[0]
3754
- const hi = matchingBlocks.at(-1)
3755
- return lo !== undefined && hi !== undefined ? { hi, lo } : undefined
3769
+ const firstMatchingBlock = await findMatchingBlock(cursorBlock)
3770
+ return firstMatchingBlock !== undefined
3771
+ ? {
3772
+ firstMatchingBlock,
3773
+ hi: toBlock ?? Number.MAX_SAFE_INTEGER,
3774
+ lo: fromBlock ?? 0,
3775
+ }
3776
+ : undefined
3756
3777
  }
3757
3778
  const result = await tidx.fetch({
3758
3779
  chainId,
@@ -3779,60 +3800,38 @@ async function getSwaps(c: Context<App.Environment>, options: getSwaps.Options)
3779
3800
  // exhausts the window and slides the sweep to the next disjoint range.
3780
3801
  const batchLimit = limit + 1
3781
3802
  let activeCursor = cursor
3782
- const cursorBlock = cursor !== undefined ? Number(cursor[0]) : undefined
3783
-
3784
- // Snap an anchor block onto the matching-block list (selective queries):
3785
- // the largest matching block `<= value` (desc) / smallest `>= value`
3786
- // (asc). This collapses the empty gaps between fill clusters — `slideWindow`
3787
- // jumps straight to the next populated block. `undefined` when no matching
3788
- // block remains in range. `matchingBlocks` is ascending.
3789
- const lastAtMost = (value: number): number | undefined => {
3790
- if (matchingBlocks === undefined) return value
3791
- let lo = 0
3792
- let hi = matchingBlocks.length
3793
- while (lo < hi) {
3794
- const mid = (lo + hi) >> 1
3795
- if (matchingBlocks[mid]! <= value) lo = mid + 1
3796
- else hi = mid
3797
- }
3798
- return lo === 0 ? undefined : matchingBlocks[lo - 1]
3799
- }
3800
- const firstAtLeast = (value: number): number | undefined => {
3801
- if (matchingBlocks === undefined) return value
3802
- let lo = 0
3803
- let hi = matchingBlocks.length
3804
- while (lo < hi) {
3805
- const mid = (lo + hi) >> 1
3806
- if (matchingBlocks[mid]! < value) lo = mid + 1
3807
- else hi = mid
3808
- }
3809
- return lo === matchingBlocks.length ? undefined : matchingBlocks[lo]
3810
- }
3811
3803
 
3812
- const windowFrom = (anchor: number | undefined): BlockWindow | undefined => {
3804
+ // Selective scans jump to the next populated block through a bounded
3805
+ // lookup. Unfiltered scans retain the fixed-stride min/max sweep.
3806
+ const windowFrom = async (
3807
+ anchor: number | undefined,
3808
+ knownMatchingBlock?: number,
3809
+ ): Promise<BlockWindow | undefined> => {
3813
3810
  if (order === 'desc') {
3814
- const hi = lastAtMost(Math.min(upperBound, anchor ?? upperBound))
3811
+ const value = Math.min(upperBound, anchor ?? upperBound)
3812
+ const hi = selective ? (knownMatchingBlock ?? (await findMatchingBlock(value))) : value
3815
3813
  return hi !== undefined && hi >= lowerBound
3816
3814
  ? { hi, lo: Math.max(lowerBound, hi - swapWindowBlocks + 1) }
3817
3815
  : undefined
3818
3816
  }
3819
- const lo = firstAtLeast(Math.max(lowerBound, anchor ?? lowerBound))
3817
+ const value = Math.max(lowerBound, anchor ?? lowerBound)
3818
+ const lo = selective ? (knownMatchingBlock ?? (await findMatchingBlock(value))) : value
3820
3819
  return lo !== undefined && lo <= upperBound
3821
3820
  ? { hi: Math.min(upperBound, lo + swapWindowBlocks - 1), lo }
3822
3821
  : undefined
3823
3822
  }
3824
3823
 
3825
- let window = windowFrom(cursorBlock)
3824
+ let window = await windowFrom(cursorBlock, bounds.firstMatchingBlock)
3826
3825
 
3827
3826
  // Slide to the next disjoint window away from the newest block and reset
3828
3827
  // the cursor: every row in the next window is already past the cursor
3829
3828
  // anchor in the requested order, so no anchor refinement is needed.
3830
- const slideWindow = () => {
3829
+ const slideWindow = async () => {
3831
3830
  activeCursor = undefined
3832
3831
  window =
3833
3832
  window === undefined
3834
3833
  ? undefined
3835
- : windowFrom(order === 'desc' ? window.lo - 1 : window.hi + 1)
3834
+ : await windowFrom(order === 'desc' ? window.lo - 1 : window.hi + 1)
3836
3835
  }
3837
3836
 
3838
3837
  while (accumulated.length <= limit && window !== undefined) {
@@ -3857,14 +3856,14 @@ async function getSwaps(c: Context<App.Environment>, options: getSwaps.Options)
3857
3856
  const tail = groups.at(-1)
3858
3857
  if (tail === undefined) {
3859
3858
  if (fetchedFull) break
3860
- slideWindow()
3859
+ await slideWindow()
3861
3860
  continue
3862
3861
  }
3863
3862
 
3864
3863
  // A short batch exhausts this window; a full one may leave more groups
3865
3864
  // in it, so advance the keyset cursor and re-query the same window.
3866
3865
  if (!fetchedFull) {
3867
- slideWindow()
3866
+ await slideWindow()
3868
3867
  continue
3869
3868
  }
3870
3869
  const next = cursorAfterWholeGroup(tail)
@@ -3875,7 +3874,7 @@ async function getSwaps(c: Context<App.Environment>, options: getSwaps.Options)
3875
3874
  Number(activeCursor[1]) === next[1] &&
3876
3875
  Number(activeCursor[2]) === next[2]
3877
3876
  ) {
3878
- slideWindow()
3877
+ await slideWindow()
3879
3878
  continue
3880
3879
  }
3881
3880
  activeCursor = [next[0], next[1], next[2]]
@@ -5623,30 +5622,38 @@ async function providerQuoteResponse(
5623
5622
  if (!destinationToken || !sourceToken)
5624
5623
  throw new Error('Unable to resolve exchange quote token metadata')
5625
5624
 
5626
- const denomination = query['valuation.currency'] ?? 'USD'
5627
- const snapshot = await VerifiedTokens.snapshot(c, chainId).catch(() => undefined)
5628
- const rates = await Valuation.ratesFor(c, {
5629
- currencies: snapshot
5630
- ? [request.destinationToken, request.sourceToken].flatMap((address) => {
5631
- const held = snapshot.byAddress.get(address.toLowerCase())?.currency
5632
- return held === undefined ? [] : [held]
5633
- })
5634
- : [],
5635
- denomination,
5636
- oracle,
5637
- })
5625
+ const denomination = query['valuation.currency']
5626
+ const snapshot = denomination
5627
+ ? await VerifiedTokens.snapshot(c, chainId).catch(() => undefined)
5628
+ : undefined
5629
+ const rates = denomination
5630
+ ? await Valuation.ratesFor(c, {
5631
+ currencies: snapshot
5632
+ ? [request.destinationToken, request.sourceToken].flatMap((address) => {
5633
+ const held = snapshot.byAddress.get(address.toLowerCase())?.currency
5634
+ return held === undefined ? [] : [held]
5635
+ })
5636
+ : [],
5637
+ denomination,
5638
+ oracle,
5639
+ })
5640
+ : undefined
5638
5641
  const valued = (
5639
5642
  baseUnits: bigint | string,
5640
5643
  address: string,
5641
5644
  token: { currency: string; decimals: number },
5642
5645
  ) => ({
5643
5646
  ...Value.tokenAmount({ baseUnits, currency: token.currency, decimals: token.decimals }),
5644
- valuation: Valuation.valuationFor({
5645
- amount: BigInt(baseUnits),
5646
- denomination,
5647
- rates,
5648
- token: snapshot?.byAddress.get(address.toLowerCase()),
5649
- }),
5647
+ ...(denomination
5648
+ ? {
5649
+ valuation: Valuation.valuationFor({
5650
+ amount: BigInt(baseUnits),
5651
+ denomination,
5652
+ rates,
5653
+ token: snapshot?.byAddress.get(address.toLowerCase()),
5654
+ }),
5655
+ }
5656
+ : {}),
5650
5657
  })
5651
5658
  const execution =
5652
5659
  quote.status === 'ready'
@@ -0,0 +1,13 @@
1
+ import * as QueryBench from '../../../../test/QueryBench.js'
2
+
3
+ QueryBench.bench({
4
+ name: 'getFeeAmmPools',
5
+ path: '/v1/fee-amm/pools',
6
+ queries: ['include=token.logoUri', 'include=token.verified'],
7
+ })
8
+
9
+ QueryBench.bench({
10
+ name: 'getFeeAmmMints',
11
+ path: '/v1/fee-amm/mints',
12
+ queries: ['include=totalCount'],
13
+ })
@@ -0,0 +1,8 @@
1
+ import * as QueryBench from '../../../../test/QueryBench.js'
2
+
3
+ const sql = 'SELECT num, hash FROM blocks ORDER BY num DESC LIMIT 1'
4
+
5
+ QueryBench.bench({
6
+ name: 'indexerQuery',
7
+ path: `/v1/indexer/query?sql=${encodeURIComponent(sql)}`,
8
+ })
@@ -150,7 +150,7 @@ describe('GET /indexer/query', () => {
150
150
  const client = TestApp.client()
151
151
  const response = await client.v1.indexer.query.$get(
152
152
  { query: { sql: 'select 1', chainId } },
153
- TestApp.auth,
153
+ { headers: { 'x-api-key': TestApp.key.token } },
154
154
  )
155
155
 
156
156
  expect(response.status).toMatchInlineSnapshot(`200`)
@@ -161,6 +161,7 @@ describe('GET /indexer/query', () => {
161
161
  // Tempo API enforces the documented execution bounds upstream even when the
162
162
  // caller omits them.
163
163
  const upstream = new URL((fetch.mock.calls[0]![0] as Request).url)
164
+ expect((fetch.mock.calls[0]![0] as Request).headers.get('x-api-key')).toBeNull()
164
165
  expect(upstream.searchParams.get('timeout_ms')).toMatchInlineSnapshot(`"5000"`)
165
166
  expect(upstream.searchParams.get('limit')).toMatchInlineSnapshot(`"10000"`)
166
167
  } finally {
@@ -23,10 +23,11 @@ const strippedHeaders = new Set([
23
23
  'keep-alive',
24
24
  'proxy-authorization',
25
25
  'te',
26
+ 'tempo-api-key',
26
27
  'trailer',
27
28
  'transfer-encoding',
28
29
  'upgrade',
29
- 'tempo-api-key',
30
+ 'x-api-key',
30
31
  ZoneRpcAuthentication.headerName.toLowerCase(),
31
32
  ])
32
33
 
@@ -63,7 +64,7 @@ export namespace schema {
63
64
  z.meta({ examples: [1] }),
64
65
  ),
65
66
  engine: z
66
- .optional(z.enum(['postgres', 'clickhouse']))
67
+ .optional(z.enum(['postgres', 'clickhouse', 'tiered']))
67
68
  .check(
68
69
  z.describe('Indexer engine that ran the query.'),
69
70
  z.meta({ examples: ['postgres'] }),
@@ -0,0 +1,39 @@
1
+ import * as QueryBench from '../../../../test/QueryBench.js'
2
+
3
+ const hash = {
4
+ 4217: '0x7f98e4b2bf4d1444b257526f7dd294ac3480d73cd91f723bf0df6062d1ba1c82',
5
+ 42431: '0x1c8ccebb169f863b72388cc057fcecee240032eb7d2c64aa6f6fb8e5a60d3f9a',
6
+ } as const
7
+
8
+ const address = {
9
+ 4217: '0xc24357119432595a547cb2c1e41c51d753645519',
10
+ 42431: '0x15496d3123afb2cfadc0ac068eadd11d0f8ae799',
11
+ } as const
12
+
13
+ QueryBench.bench({
14
+ name: 'getReceipts',
15
+ path: '/v1/transactions/receipts',
16
+ queries: [
17
+ 'include=feeToken.logoUri',
18
+ 'include=feeToken.verified',
19
+ 'include=totalCount',
20
+ 'valuation.currency=USD',
21
+ ],
22
+ })
23
+
24
+ QueryBench.bench({
25
+ name: 'getReceipts?address&include=totalCount',
26
+ path: {
27
+ 4217: `/v1/transactions/receipts?address=${address[4217]}&include=totalCount`,
28
+ 42431: `/v1/transactions/receipts?address=${address[42431]}&include=totalCount`,
29
+ },
30
+ })
31
+
32
+ QueryBench.bench({
33
+ name: 'getReceipt',
34
+ path: {
35
+ 4217: `/v1/transactions/${hash[4217]}/receipt`,
36
+ 42431: `/v1/transactions/${hash[42431]}/receipt`,
37
+ },
38
+ queries: ['include=feeToken.logoUri', 'include=feeToken.verified', 'valuation.currency=USD'],
39
+ })