tapimo 0.0.0 → 0.0.2
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.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/ApiKey.d.ts +65 -0
- package/dist/ApiKey.d.ts.map +1 -0
- package/dist/ApiKey.js +105 -0
- package/dist/ApiKey.js.map +1 -0
- package/dist/ApiKeySource.d.ts +166 -0
- package/dist/ApiKeySource.d.ts.map +1 -0
- package/dist/ApiKeySource.js +234 -0
- package/dist/ApiKeySource.js.map +1 -0
- package/dist/App.d.ts +19317 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +612 -0
- package/dist/App.js.map +1 -0
- package/dist/Assets.d.ts +44 -0
- package/dist/Assets.d.ts.map +1 -0
- package/dist/Assets.js +23 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Auth.d.ts +2 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +2 -0
- package/dist/Auth.js.map +1 -0
- package/dist/Cli.d.ts +21 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +13 -0
- package/dist/Cli.js.map +1 -0
- package/dist/Client.d.ts +20 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +24 -0
- package/dist/Client.js.map +1 -0
- package/dist/Metrics.d.ts +70 -0
- package/dist/Metrics.d.ts.map +1 -0
- package/dist/Metrics.js +91 -0
- package/dist/Metrics.js.map +1 -0
- package/dist/Scope.d.ts +35 -0
- package/dist/Scope.d.ts.map +1 -0
- package/dist/Scope.js +38 -0
- package/dist/Scope.js.map +1 -0
- package/dist/Webhooks.d.ts +79 -0
- package/dist/Webhooks.d.ts.map +1 -0
- package/dist/Webhooks.js +107 -0
- package/dist/Webhooks.js.map +1 -0
- package/dist/admin/Access.d.ts +41 -0
- package/dist/admin/Access.d.ts.map +1 -0
- package/dist/admin/Access.js +75 -0
- package/dist/admin/Access.js.map +1 -0
- package/dist/admin/App.d.ts +1221 -0
- package/dist/admin/App.d.ts.map +1 -0
- package/dist/admin/App.js +113 -0
- package/dist/admin/App.js.map +1 -0
- package/dist/admin/apps/api-keys.d.ts +209 -0
- package/dist/admin/apps/api-keys.d.ts.map +1 -0
- package/dist/admin/apps/api-keys.js +129 -0
- package/dist/admin/apps/api-keys.js.map +1 -0
- package/dist/admin/apps/scopes.d.ts +46 -0
- package/dist/admin/apps/scopes.d.ts.map +1 -0
- package/dist/admin/apps/scopes.js +41 -0
- package/dist/admin/apps/scopes.js.map +1 -0
- package/dist/admin/apps/verified-tokens.d.ts +1206 -0
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -0
- package/dist/admin/apps/verified-tokens.js +485 -0
- package/dist/admin/apps/verified-tokens.js.map +1 -0
- package/dist/admin/index.d.ts +3 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/ui.generated.d.ts +11 -0
- package/dist/admin/ui.generated.d.ts.map +1 -0
- package/dist/admin/ui.generated.js +43 -0
- package/dist/admin/ui.generated.js.map +1 -0
- package/dist/apps/activities.d.ts +18725 -0
- package/dist/apps/activities.d.ts.map +1 -0
- package/dist/apps/activities.js +3138 -0
- package/dist/apps/activities.js.map +1 -0
- package/dist/apps/addresses.d.ts +3662 -0
- package/dist/apps/addresses.d.ts.map +1 -0
- package/dist/apps/addresses.js +22 -0
- package/dist/apps/addresses.js.map +1 -0
- package/dist/apps/balances.d.ts +342 -0
- package/dist/apps/balances.d.ts.map +1 -0
- package/dist/apps/balances.js +393 -0
- package/dist/apps/balances.js.map +1 -0
- package/dist/apps/blocks.d.ts +931 -0
- package/dist/apps/blocks.d.ts.map +1 -0
- package/dist/apps/blocks.js +689 -0
- package/dist/apps/blocks.js.map +1 -0
- package/dist/apps/coingecko.d.ts +1053 -0
- package/dist/apps/coingecko.d.ts.map +1 -0
- package/dist/apps/coingecko.js +1015 -0
- package/dist/apps/coingecko.js.map +1 -0
- package/dist/apps/exchanges.d.ts +3000 -0
- package/dist/apps/exchanges.d.ts.map +1 -0
- package/dist/apps/exchanges.js +3570 -0
- package/dist/apps/exchanges.js.map +1 -0
- package/dist/apps/fee-amm.d.ts +640 -0
- package/dist/apps/fee-amm.d.ts.map +1 -0
- package/dist/apps/fee-amm.js +815 -0
- package/dist/apps/fee-amm.js.map +1 -0
- package/dist/apps/indexer.d.ts +116 -0
- package/dist/apps/indexer.d.ts.map +1 -0
- package/dist/apps/indexer.js +270 -0
- package/dist/apps/indexer.js.map +1 -0
- package/dist/apps/receipts.d.ts +1438 -0
- package/dist/apps/receipts.d.ts.map +1 -0
- package/dist/apps/receipts.js +874 -0
- package/dist/apps/receipts.js.map +1 -0
- package/dist/apps/rpc.d.ts +173 -0
- package/dist/apps/rpc.d.ts.map +1 -0
- package/dist/apps/rpc.js +191 -0
- package/dist/apps/rpc.js.map +1 -0
- package/dist/apps/tokenlist.d.ts +192 -0
- package/dist/apps/tokenlist.d.ts.map +1 -0
- package/dist/apps/tokenlist.js +153 -0
- package/dist/apps/tokenlist.js.map +1 -0
- package/dist/apps/tokens.d.ts +2246 -0
- package/dist/apps/tokens.d.ts.map +1 -0
- package/dist/apps/tokens.js +1789 -0
- package/dist/apps/tokens.js.map +1 -0
- package/dist/apps/transactions.d.ts +2327 -0
- package/dist/apps/transactions.d.ts.map +1 -0
- package/dist/apps/transactions.js +975 -0
- package/dist/apps/transactions.js.map +1 -0
- package/dist/apps/transfers.d.ts +589 -0
- package/dist/apps/transfers.d.ts.map +1 -0
- package/dist/apps/transfers.js +769 -0
- package/dist/apps/transfers.js.map +1 -0
- package/dist/apps/verified-tokens.d.ts +544 -0
- package/dist/apps/verified-tokens.d.ts.map +1 -0
- package/dist/apps/verified-tokens.js +234 -0
- package/dist/apps/verified-tokens.js.map +1 -0
- package/dist/apps/webhooks.d.ts +7684 -0
- package/dist/apps/webhooks.d.ts.map +1 -0
- package/dist/apps/webhooks.js +2112 -0
- package/dist/apps/webhooks.js.map +1 -0
- package/dist/cloudflare.d.ts +32 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +45 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Auth.d.ts +298 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +618 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Cache.d.ts +74 -0
- package/dist/internal/Cache.d.ts.map +1 -0
- package/dist/internal/Cache.js +215 -0
- package/dist/internal/Cache.js.map +1 -0
- package/dist/internal/Cursor.d.ts +79 -0
- package/dist/internal/Cursor.d.ts.map +1 -0
- package/dist/internal/Cursor.js +116 -0
- package/dist/internal/Cursor.js.map +1 -0
- package/dist/internal/EdgeCache.d.ts +59 -0
- package/dist/internal/EdgeCache.d.ts.map +1 -0
- package/dist/internal/EdgeCache.js +174 -0
- package/dist/internal/EdgeCache.js.map +1 -0
- package/dist/internal/Log.d.ts +104 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +118 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/MetricSink.d.ts +65 -0
- package/dist/internal/MetricSink.d.ts.map +1 -0
- package/dist/internal/MetricSink.js +146 -0
- package/dist/internal/MetricSink.js.map +1 -0
- package/dist/internal/Mpp.d.ts +71 -0
- package/dist/internal/Mpp.d.ts.map +1 -0
- package/dist/internal/Mpp.js +105 -0
- package/dist/internal/Mpp.js.map +1 -0
- package/dist/internal/OpenApi.d.ts +313 -0
- package/dist/internal/OpenApi.d.ts.map +1 -0
- package/dist/internal/OpenApi.fonts.d.ts +2 -0
- package/dist/internal/OpenApi.fonts.d.ts.map +1 -0
- package/dist/internal/OpenApi.fonts.js +39 -0
- package/dist/internal/OpenApi.fonts.js.map +1 -0
- package/dist/internal/OpenApi.js +335 -0
- package/dist/internal/OpenApi.js.map +1 -0
- package/dist/internal/OpenApi.logo.d.ts +6 -0
- package/dist/internal/OpenApi.logo.d.ts.map +1 -0
- package/dist/internal/OpenApi.logo.js +19 -0
- package/dist/internal/OpenApi.logo.js.map +1 -0
- package/dist/internal/Path.d.ts +5 -0
- package/dist/internal/Path.d.ts.map +1 -0
- package/dist/internal/Path.js +16 -0
- package/dist/internal/Path.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +60 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +48 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Response.d.ts +132 -0
- package/dist/internal/Response.d.ts.map +1 -0
- package/dist/internal/Response.js +72 -0
- package/dist/internal/Response.js.map +1 -0
- package/dist/internal/Schema.d.ts +257 -0
- package/dist/internal/Schema.d.ts.map +1 -0
- package/dist/internal/Schema.js +360 -0
- package/dist/internal/Schema.js.map +1 -0
- package/dist/internal/Store.d.ts +204 -0
- package/dist/internal/Store.d.ts.map +1 -0
- package/dist/internal/Store.js +291 -0
- package/dist/internal/Store.js.map +1 -0
- package/dist/internal/Tidx.d.ts +120 -0
- package/dist/internal/Tidx.d.ts.map +1 -0
- package/dist/internal/Tidx.js +156 -0
- package/dist/internal/Tidx.js.map +1 -0
- package/dist/internal/Timing.d.ts +22 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +32 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Ttl.d.ts +25 -0
- package/dist/internal/Ttl.d.ts.map +1 -0
- package/dist/internal/Ttl.js +49 -0
- package/dist/internal/Ttl.js.map +1 -0
- package/dist/internal/Value.d.ts +47 -0
- package/dist/internal/Value.d.ts.map +1 -0
- package/dist/internal/Value.js +122 -0
- package/dist/internal/Value.js.map +1 -0
- package/dist/internal/VerifiedTokens.d.ts +228 -0
- package/dist/internal/VerifiedTokens.d.ts.map +1 -0
- package/dist/internal/VerifiedTokens.js +450 -0
- package/dist/internal/VerifiedTokens.js.map +1 -0
- package/dist/internal/Viem.d.ts +2082 -0
- package/dist/internal/Viem.d.ts.map +1 -0
- package/dist/internal/Viem.js +63 -0
- package/dist/internal/Viem.js.map +1 -0
- package/dist/internal/WebhookDestination.d.ts +198 -0
- package/dist/internal/WebhookDestination.d.ts.map +1 -0
- package/dist/internal/WebhookDestination.js +170 -0
- package/dist/internal/WebhookDestination.js.map +1 -0
- package/dist/internal/Webhooks.d.ts +433 -0
- package/dist/internal/Webhooks.d.ts.map +1 -0
- package/dist/internal/Webhooks.js +489 -0
- package/dist/internal/Webhooks.js.map +1 -0
- package/dist/internal/webhookDestinations/betterStack.d.ts +26 -0
- package/dist/internal/webhookDestinations/betterStack.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/betterStack.js +76 -0
- package/dist/internal/webhookDestinations/betterStack.js.map +1 -0
- package/dist/internal/webhookDestinations/slack.d.ts +59 -0
- package/dist/internal/webhookDestinations/slack.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/slack.js +422 -0
- package/dist/internal/webhookDestinations/slack.js.map +1 -0
- package/dist/internal/webhookDestinations/url.d.ts +17 -0
- package/dist/internal/webhookDestinations/url.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/url.js +130 -0
- package/dist/internal/webhookDestinations/url.js.map +1 -0
- package/dist/openrpc.json +5302 -0
- package/package.json +46 -4
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +1 -0
- package/seeds/31318/verified-tokens.json +30 -0
- package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +25 -0
- package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +4 -0
- package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +30 -0
- package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +11 -0
- package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +1 -0
- package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +5 -0
- package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
- package/seeds/4217/verified-tokens.json +177 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +25 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +1 -0
- package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +1 -0
- package/seeds/42431/verified-tokens.json +44 -0
- package/seeds/openrpc/README.md +27 -0
- package/seeds/openrpc/execution-apis.json +8989 -0
- package/src/ApiKey.test.ts +91 -0
- package/src/ApiKey.ts +122 -0
- package/src/ApiKeySource.test-d.ts +11 -0
- package/src/ApiKeySource.test.ts +295 -0
- package/src/ApiKeySource.ts +303 -0
- package/src/App.test-d.ts +38 -0
- package/src/App.test.ts +65927 -0
- package/src/App.ts +855 -0
- package/src/Assets.ts +58 -0
- package/src/Auth.ts +1 -0
- package/src/Cli.test.ts +81 -0
- package/src/Cli.ts +38 -0
- package/src/Client.test-d.ts +1438 -0
- package/src/Client.test.ts +134 -0
- package/src/Client.ts +45 -0
- package/src/Metrics.ts +154 -0
- package/src/Scope.ts +50 -0
- package/src/Webhooks.test.ts +49 -0
- package/src/Webhooks.ts +172 -0
- package/src/admin/Access.test.ts +130 -0
- package/src/admin/Access.ts +87 -0
- package/src/admin/App.test.ts +225 -0
- package/src/admin/App.ts +216 -0
- package/src/admin/apps/api-keys.test.ts +156 -0
- package/src/admin/apps/api-keys.ts +157 -0
- package/src/admin/apps/scopes.test.ts +52 -0
- package/src/admin/apps/scopes.ts +47 -0
- package/src/admin/apps/verified-tokens.test.ts +415 -0
- package/src/admin/apps/verified-tokens.ts +566 -0
- package/src/admin/index.ts +2 -0
- package/src/admin/ui/plugin.ts +135 -0
- package/src/admin/ui/src/components/Checkbox.tsx +22 -0
- package/src/admin/ui/src/components/Dialog.tsx +32 -0
- package/src/admin/ui/src/components/MobileProfile.tsx +31 -0
- package/src/admin/ui/src/components/Page.tsx +53 -0
- package/src/admin/ui/src/components/TempoLogo.tsx +37 -0
- package/src/admin/ui/src/fonts/Pilat-Demi.woff2 +0 -0
- package/src/admin/ui/src/fonts/Pilat-Regular.woff2 +0 -0
- package/src/admin/ui/src/lib/api-keys.ts +63 -0
- package/src/admin/ui/src/lib/client.ts +15 -0
- package/src/admin/ui/src/lib/config.ts +57 -0
- package/src/admin/ui/src/lib/query-client.ts +26 -0
- package/src/admin/ui/src/lib/scopes.ts +25 -0
- package/src/admin/ui/src/lib/verified-tokens.ts +89 -0
- package/src/admin/ui/src/lib/wagmi.ts +18 -0
- package/src/admin/ui/src/routeTree.gen.ts +104 -0
- package/src/admin/ui/src/router.tsx +25 -0
- package/src/admin/ui/src/routes/__root.tsx +219 -0
- package/src/admin/ui/src/routes/api-keys.tsx +329 -0
- package/src/admin/ui/src/routes/index.tsx +7 -0
- package/src/admin/ui/src/routes/verified-tokens.tsx +331 -0
- package/src/admin/ui/src/styles.css +20 -0
- package/src/admin/ui/tsconfig.json +16 -0
- package/src/admin/ui/vite.config.ts +29 -0
- package/src/admin/ui.generated.ts +60 -0
- package/src/apps/activities.test.ts +1020 -0
- package/src/apps/activities.ts +3934 -0
- package/src/apps/addresses.ts +24 -0
- package/src/apps/balances.test.ts +274 -0
- package/src/apps/balances.ts +533 -0
- package/src/apps/blocks.test.ts +385 -0
- package/src/apps/blocks.ts +896 -0
- package/src/apps/coingecko.test.ts +218 -0
- package/src/apps/coingecko.ts +1383 -0
- package/src/apps/exchanges.test.ts +958 -0
- package/src/apps/exchanges.ts +4773 -0
- package/src/apps/fee-amm.test.ts +321 -0
- package/src/apps/fee-amm.ts +1121 -0
- package/src/apps/indexer.test.ts +153 -0
- package/src/apps/indexer.ts +330 -0
- package/src/apps/receipts.test.ts +285 -0
- package/src/apps/receipts.ts +1193 -0
- package/src/apps/rpc.test.ts +302 -0
- package/src/apps/rpc.ts +222 -0
- package/src/apps/tokenlist.test.ts +80 -0
- package/src/apps/tokenlist.ts +207 -0
- package/src/apps/tokens.test.ts +1062 -0
- package/src/apps/tokens.ts +2292 -0
- package/src/apps/transactions.test.ts +408 -0
- package/src/apps/transactions.ts +1363 -0
- package/src/apps/transfers.test.ts +371 -0
- package/src/apps/transfers.ts +1116 -0
- package/src/apps/verified-tokens.test.ts +114 -0
- package/src/apps/verified-tokens.ts +295 -0
- package/src/apps/webhooks.test.ts +1937 -0
- package/src/apps/webhooks.ts +2926 -0
- package/src/cloudflare.ts +55 -0
- package/src/index.ts +15 -0
- package/src/internal/Auth.test.ts +980 -0
- package/src/internal/Auth.ts +1012 -0
- package/src/internal/Cache.test.ts +240 -0
- package/src/internal/Cache.ts +262 -0
- package/src/internal/Cursor.test.ts +100 -0
- package/src/internal/Cursor.ts +149 -0
- package/src/internal/EdgeCache.test.ts +234 -0
- package/src/internal/EdgeCache.ts +224 -0
- package/src/internal/Errors.ts +14 -0
- package/src/internal/Log.test.ts +244 -0
- package/src/internal/Log.ts +216 -0
- package/src/internal/MetricSink.ts +220 -0
- package/src/internal/Mpp.test.ts +64 -0
- package/src/internal/Mpp.ts +141 -0
- package/src/internal/OpenApi.fonts.ts +38 -0
- package/src/internal/OpenApi.logo.ts +18 -0
- package/src/internal/OpenApi.ts +488 -0
- package/src/internal/Path.test.ts +14 -0
- package/src/internal/Path.ts +15 -0
- package/src/internal/RateLimit.test.ts +93 -0
- package/src/internal/RateLimit.ts +93 -0
- package/src/internal/Response.ts +131 -0
- package/src/internal/Schema.test.ts +34 -0
- package/src/internal/Schema.ts +523 -0
- package/src/internal/Store.test.ts +545 -0
- package/src/internal/Store.ts +526 -0
- package/src/internal/Tidx.local.test.ts +33 -0
- package/src/internal/Tidx.test.ts +294 -0
- package/src/internal/Tidx.ts +238 -0
- package/src/internal/Timing.test.ts +22 -0
- package/src/internal/Timing.ts +62 -0
- package/src/internal/Ttl.test.ts +18 -0
- package/src/internal/Ttl.ts +59 -0
- package/src/internal/Value.ts +114 -0
- package/src/internal/VerifiedTokens.test.ts +333 -0
- package/src/internal/VerifiedTokens.ts +645 -0
- package/src/internal/Viem.test.ts +115 -0
- package/src/internal/Viem.ts +165 -0
- package/src/internal/WebhookDestination.test.ts +648 -0
- package/src/internal/WebhookDestination.ts +331 -0
- package/src/internal/Webhooks.test.ts +668 -0
- package/src/internal/Webhooks.ts +940 -0
- package/src/internal/webhookDestinations/betterStack.ts +91 -0
- package/src/internal/webhookDestinations/slack.ts +496 -0
- package/src/internal/webhookDestinations/url.ts +128 -0
- package/src/openrpc.json +5302 -0
|
@@ -0,0 +1,931 @@
|
|
|
1
|
+
import { type Context } from 'hono';
|
|
2
|
+
import { Hex } from 'ox';
|
|
3
|
+
import * as z from 'zod/mini';
|
|
4
|
+
import type * as App from '../App.js';
|
|
5
|
+
import * as Response from '../internal/Response.js';
|
|
6
|
+
import * as Schema from '../internal/Schema.js';
|
|
7
|
+
/** The EVM block tags accepted by the `:block` selector. */
|
|
8
|
+
declare const blockTags: readonly ['latest', 'finalized'];
|
|
9
|
+
/** Zod schemas owned by the block handlers. */
|
|
10
|
+
export declare namespace schema {
|
|
11
|
+
/** The verbatim JSON-RPC payloads, surfaced under each resource's `rpc` field. */
|
|
12
|
+
namespace Rpc {
|
|
13
|
+
/** A JSON-RPC block, passed through verbatim. */
|
|
14
|
+
const Block: z.ZodMiniObject<{
|
|
15
|
+
baseFeePerGas: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>>;
|
|
16
|
+
difficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
17
|
+
extraData: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
18
|
+
gasLimit: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
19
|
+
gasUsed: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
20
|
+
hash: z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
21
|
+
logsBloom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
22
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
23
|
+
mixHash: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
24
|
+
nonce: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
25
|
+
number: z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
26
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
27
|
+
receiptsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
28
|
+
sha3Uncles: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
29
|
+
size: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
30
|
+
stateRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
31
|
+
timestamp: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
32
|
+
totalDifficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
33
|
+
transactions: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
34
|
+
transactionsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
35
|
+
uncles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>>;
|
|
36
|
+
withdrawals: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{}, z.core.$loose>>>;
|
|
37
|
+
withdrawalsRoot: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
38
|
+
}, z.core.$loose>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Metadata for a block: the verbatim JSON-RPC block (always present). Held in
|
|
42
|
+
* a `meta` envelope so future opt-in `include` resources (e.g. embedded
|
|
43
|
+
* transactions) can layer in without breaking the response shape.
|
|
44
|
+
*/
|
|
45
|
+
const BlockMeta: z.ZodMiniObject<{
|
|
46
|
+
rpc: z.ZodMiniObject<{
|
|
47
|
+
baseFeePerGas: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>>;
|
|
48
|
+
difficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
49
|
+
extraData: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
50
|
+
gasLimit: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
51
|
+
gasUsed: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
52
|
+
hash: z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
53
|
+
logsBloom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
54
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
55
|
+
mixHash: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
56
|
+
nonce: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
57
|
+
number: z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
58
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
59
|
+
receiptsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
60
|
+
sha3Uncles: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
61
|
+
size: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
62
|
+
stateRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
63
|
+
timestamp: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
64
|
+
totalDifficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
65
|
+
transactions: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
66
|
+
transactionsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
67
|
+
uncles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>>;
|
|
68
|
+
withdrawals: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{}, z.core.$loose>>>;
|
|
69
|
+
withdrawalsRoot: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
70
|
+
}, z.core.$loose>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
/**
|
|
73
|
+
* A humanized block: decimal-string amounts, ISO 8601 timestamps, and plain
|
|
74
|
+
* numbers for block fields. The verbatim JSON-RPC payload is always
|
|
75
|
+
* available under `meta.rpc`. Transactions are omitted from the response —
|
|
76
|
+
* clients fetch them via `GET /blocks/:block/transactions`.
|
|
77
|
+
*/
|
|
78
|
+
const Block: z.ZodMiniObject<{
|
|
79
|
+
baseFeePerGas: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
80
|
+
gasLimit: z.ZodMiniNumber<number>;
|
|
81
|
+
gasUsed: z.ZodMiniNumber<number>;
|
|
82
|
+
hash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
83
|
+
id: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
84
|
+
meta: z.ZodMiniObject<{
|
|
85
|
+
rpc: z.ZodMiniObject<{
|
|
86
|
+
baseFeePerGas: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>>;
|
|
87
|
+
difficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
88
|
+
extraData: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
89
|
+
gasLimit: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
90
|
+
gasUsed: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
91
|
+
hash: z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
92
|
+
logsBloom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
93
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
94
|
+
mixHash: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
95
|
+
nonce: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
96
|
+
number: z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
97
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
98
|
+
receiptsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
99
|
+
sha3Uncles: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
100
|
+
size: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
101
|
+
stateRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
102
|
+
timestamp: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
103
|
+
totalDifficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
104
|
+
transactions: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
105
|
+
transactionsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
106
|
+
uncles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>>;
|
|
107
|
+
withdrawals: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{}, z.core.$loose>>>;
|
|
108
|
+
withdrawalsRoot: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
109
|
+
}, z.core.$loose>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
112
|
+
number: z.ZodMiniNumber<number>;
|
|
113
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
114
|
+
size: z.ZodMiniNumber<number>;
|
|
115
|
+
timestamp: z.ZodMiniISODateTime;
|
|
116
|
+
transactionCount: z.ZodMiniNumber<number>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
/**
|
|
119
|
+
* A lightweight block row, returned by the `/blocks` list endpoint. Full
|
|
120
|
+
* fields (parentHash, miner, gasUsed/gasLimit, …) would require one RPC
|
|
121
|
+
* roundtrip per row; the list endpoint stays cheap and clients fetch
|
|
122
|
+
* `/blocks/:block` for individual blocks they care about. The block hash is
|
|
123
|
+
* selected from the index so `id` stays tied to the resolved block identity.
|
|
124
|
+
*/
|
|
125
|
+
const BlockSummary: z.ZodMiniObject<{
|
|
126
|
+
hash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
127
|
+
id: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
128
|
+
number: z.ZodMiniNumber<number>;
|
|
129
|
+
timestamp: z.ZodMiniISODateTime;
|
|
130
|
+
transactionCount: z.ZodMiniNumber<number>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
/** Schemas for the getBlocks operation. */
|
|
133
|
+
namespace getBlocks {
|
|
134
|
+
/** Query parameters for `GET /blocks`. */
|
|
135
|
+
const Query: z.ZodMiniObject<{
|
|
136
|
+
chainId: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
137
|
+
mainnet: "mainnet";
|
|
138
|
+
testnet: "testnet";
|
|
139
|
+
}>, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniNumber<unknown>]>, z.ZodMiniNumber<number>>>;
|
|
140
|
+
cursor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
141
|
+
limit: z.ZodMiniDefault<z.ZodMiniNumber<unknown>>;
|
|
142
|
+
order: z.ZodMiniDefault<z.ZodMiniEnum<{
|
|
143
|
+
asc: "asc";
|
|
144
|
+
desc: "desc";
|
|
145
|
+
}>>;
|
|
146
|
+
page: z.ZodMiniOptional<z.ZodMiniNumber<unknown>>;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
/** Page of lightweight block rows, including empty blocks. */
|
|
149
|
+
const Response: z.ZodMiniObject<{
|
|
150
|
+
data: z.ZodMiniArray<z.ZodMiniObject<{
|
|
151
|
+
hash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
152
|
+
id: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
153
|
+
number: z.ZodMiniNumber<number>;
|
|
154
|
+
timestamp: z.ZodMiniISODateTime;
|
|
155
|
+
transactionCount: z.ZodMiniNumber<number>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
nextCursor: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
}
|
|
160
|
+
/** Schemas for the getBlock operation. */
|
|
161
|
+
namespace getBlock {
|
|
162
|
+
/**
|
|
163
|
+
* Path parameter for block requests. Resolves a single block from any of:
|
|
164
|
+
* a block tag (`latest`, `finalized`); a decimal or `0x`-prefixed hex block
|
|
165
|
+
* number; a `0x`-prefixed 32-byte block hash; or an ISO 8601 timestamp
|
|
166
|
+
* (`2023-11-14T22:13:20Z`), which resolves to the first block at or after
|
|
167
|
+
* that instant.
|
|
168
|
+
*/
|
|
169
|
+
const Params: z.ZodMiniObject<{
|
|
170
|
+
block: z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
|
|
171
|
+
finalized: "finalized";
|
|
172
|
+
latest: "latest";
|
|
173
|
+
}>, z.ZodMiniString<string>, z.ZodMiniISODateTime]>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
/** Query parameters for `GET /blocks/:block`. */
|
|
176
|
+
const Query: z.ZodMiniObject<{
|
|
177
|
+
chainId: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
178
|
+
mainnet: "mainnet";
|
|
179
|
+
testnet: "testnet";
|
|
180
|
+
}>, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniNumber<unknown>]>, z.ZodMiniNumber<number>>>;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
/** A humanized block, with the verbatim JSON-RPC payload under `meta.rpc`. */
|
|
183
|
+
const Response: z.ZodMiniObject<{
|
|
184
|
+
baseFeePerGas: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
185
|
+
gasLimit: z.ZodMiniNumber<number>;
|
|
186
|
+
gasUsed: z.ZodMiniNumber<number>;
|
|
187
|
+
hash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
188
|
+
id: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
189
|
+
meta: z.ZodMiniObject<{
|
|
190
|
+
rpc: z.ZodMiniObject<{
|
|
191
|
+
baseFeePerGas: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>>;
|
|
192
|
+
difficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
193
|
+
extraData: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>;
|
|
194
|
+
gasLimit: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
195
|
+
gasUsed: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
196
|
+
hash: z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
197
|
+
logsBloom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
198
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
199
|
+
mixHash: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
200
|
+
nonce: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>>>;
|
|
201
|
+
number: z.ZodMiniNullable<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
202
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
203
|
+
receiptsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
204
|
+
sha3Uncles: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
205
|
+
size: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
206
|
+
stateRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
207
|
+
timestamp: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
208
|
+
totalDifficulty: z.ZodMiniOptional<z.ZodMiniTemplateLiteral<`0x${string}`>>;
|
|
209
|
+
transactions: z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
210
|
+
transactionsRoot: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
211
|
+
uncles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>>;
|
|
212
|
+
withdrawals: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{}, z.core.$loose>>>;
|
|
213
|
+
withdrawalsRoot: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>;
|
|
214
|
+
}, z.core.$loose>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
miner: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
217
|
+
number: z.ZodMiniNumber<number>;
|
|
218
|
+
parentHash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
219
|
+
size: z.ZodMiniNumber<number>;
|
|
220
|
+
timestamp: z.ZodMiniISODateTime;
|
|
221
|
+
transactionCount: z.ZodMiniNumber<number>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Schemas for the legacy `getBlockByTimestamp` compatibility operation
|
|
226
|
+
* (`GET /chains/:chainId/blocks/by-timestamp`). Hidden from the docs; kept to
|
|
227
|
+
* keep pre-existing clients of the prior Tempo API working unchanged.
|
|
228
|
+
*/
|
|
229
|
+
namespace getBlockByTimestamp {
|
|
230
|
+
/** Path parameters: the numeric Tempo chain id. */
|
|
231
|
+
const Params: z.ZodMiniObject<{
|
|
232
|
+
chainId: z.ZodMiniPipe<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
233
|
+
mainnet: "mainnet";
|
|
234
|
+
testnet: "testnet";
|
|
235
|
+
}>, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniNumber<unknown>]>, z.ZodMiniNumber<number>>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
/** Query parameters: a required unix timestamp and the search direction. */
|
|
238
|
+
const Query: z.ZodMiniObject<{
|
|
239
|
+
closest: z.ZodMiniDefault<z.ZodMiniEnum<{
|
|
240
|
+
after: "after";
|
|
241
|
+
before: "before";
|
|
242
|
+
}>>;
|
|
243
|
+
timestamp: z.ZodMiniNumber<unknown>;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
/** The legacy response envelope: `{ block: { blockNumber, blockTimestamp } }`. */
|
|
246
|
+
const Response: z.ZodMiniObject<{
|
|
247
|
+
block: z.ZodMiniObject<{
|
|
248
|
+
blockNumber: z.ZodMiniNumber<number>;
|
|
249
|
+
blockTimestamp: z.ZodMiniNumber<number>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** Creates block handlers. */
|
|
255
|
+
export declare function blocks(): import("hono/hono-base").HonoBase<App.Environment, {
|
|
256
|
+
"/": {
|
|
257
|
+
$get: {
|
|
258
|
+
output: null;
|
|
259
|
+
outputFormat: "body";
|
|
260
|
+
status: 402;
|
|
261
|
+
input: {
|
|
262
|
+
query?: {
|
|
263
|
+
chainId?: string | string[];
|
|
264
|
+
cursor?: string | string[];
|
|
265
|
+
limit?: string | string[];
|
|
266
|
+
order?: string | string[];
|
|
267
|
+
page?: string | string[];
|
|
268
|
+
} | undefined;
|
|
269
|
+
};
|
|
270
|
+
} | {
|
|
271
|
+
output: {
|
|
272
|
+
error: {
|
|
273
|
+
code: "api_key_malformed";
|
|
274
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
275
|
+
message: string;
|
|
276
|
+
};
|
|
277
|
+
requestId: string;
|
|
278
|
+
};
|
|
279
|
+
outputFormat: "json";
|
|
280
|
+
status: 400;
|
|
281
|
+
input: {
|
|
282
|
+
query?: {
|
|
283
|
+
chainId?: string | string[];
|
|
284
|
+
cursor?: string | string[];
|
|
285
|
+
limit?: string | string[];
|
|
286
|
+
order?: string | string[];
|
|
287
|
+
page?: string | string[];
|
|
288
|
+
} | undefined;
|
|
289
|
+
};
|
|
290
|
+
} | {
|
|
291
|
+
output: {
|
|
292
|
+
error: {
|
|
293
|
+
code: "api_key_invalid" | "api_key_missing";
|
|
294
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
295
|
+
message: string;
|
|
296
|
+
};
|
|
297
|
+
requestId: string;
|
|
298
|
+
};
|
|
299
|
+
outputFormat: "json";
|
|
300
|
+
status: 401;
|
|
301
|
+
input: {
|
|
302
|
+
query?: {
|
|
303
|
+
chainId?: string | string[];
|
|
304
|
+
cursor?: string | string[];
|
|
305
|
+
limit?: string | string[];
|
|
306
|
+
order?: string | string[];
|
|
307
|
+
page?: string | string[];
|
|
308
|
+
} | undefined;
|
|
309
|
+
};
|
|
310
|
+
} | {
|
|
311
|
+
output: {
|
|
312
|
+
error: {
|
|
313
|
+
code: "api_key_forbidden";
|
|
314
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
315
|
+
message: string;
|
|
316
|
+
};
|
|
317
|
+
requestId: string;
|
|
318
|
+
};
|
|
319
|
+
outputFormat: "json";
|
|
320
|
+
status: 403;
|
|
321
|
+
input: {
|
|
322
|
+
query?: {
|
|
323
|
+
chainId?: string | string[];
|
|
324
|
+
cursor?: string | string[];
|
|
325
|
+
limit?: string | string[];
|
|
326
|
+
order?: string | string[];
|
|
327
|
+
page?: string | string[];
|
|
328
|
+
} | undefined;
|
|
329
|
+
};
|
|
330
|
+
} | {
|
|
331
|
+
output: {
|
|
332
|
+
error: {
|
|
333
|
+
code: "payment_required" | "rate_limit_exceeded";
|
|
334
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
335
|
+
message: string;
|
|
336
|
+
};
|
|
337
|
+
requestId: string;
|
|
338
|
+
};
|
|
339
|
+
outputFormat: "json";
|
|
340
|
+
status: 429;
|
|
341
|
+
input: {
|
|
342
|
+
query?: {
|
|
343
|
+
chainId?: string | string[];
|
|
344
|
+
cursor?: string | string[];
|
|
345
|
+
limit?: string | string[];
|
|
346
|
+
order?: string | string[];
|
|
347
|
+
page?: string | string[];
|
|
348
|
+
} | undefined;
|
|
349
|
+
};
|
|
350
|
+
} | {
|
|
351
|
+
output: {
|
|
352
|
+
error: {
|
|
353
|
+
code: "query_invalid";
|
|
354
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
355
|
+
message: string;
|
|
356
|
+
};
|
|
357
|
+
requestId: string;
|
|
358
|
+
};
|
|
359
|
+
outputFormat: "json";
|
|
360
|
+
status: 400;
|
|
361
|
+
input: {
|
|
362
|
+
query?: {
|
|
363
|
+
chainId?: string | string[];
|
|
364
|
+
cursor?: string | string[];
|
|
365
|
+
limit?: string | string[];
|
|
366
|
+
order?: string | string[];
|
|
367
|
+
page?: string | string[];
|
|
368
|
+
} | undefined;
|
|
369
|
+
};
|
|
370
|
+
} | {
|
|
371
|
+
output: {
|
|
372
|
+
error: {
|
|
373
|
+
code: "upstream_error";
|
|
374
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
375
|
+
message: string;
|
|
376
|
+
};
|
|
377
|
+
requestId: string;
|
|
378
|
+
};
|
|
379
|
+
outputFormat: "json";
|
|
380
|
+
status: 502;
|
|
381
|
+
input: {
|
|
382
|
+
query?: {
|
|
383
|
+
chainId?: string | string[];
|
|
384
|
+
cursor?: string | string[];
|
|
385
|
+
limit?: string | string[];
|
|
386
|
+
order?: string | string[];
|
|
387
|
+
page?: string | string[];
|
|
388
|
+
} | undefined;
|
|
389
|
+
};
|
|
390
|
+
} | {
|
|
391
|
+
output: {
|
|
392
|
+
data: {
|
|
393
|
+
hash: `0x${string}`;
|
|
394
|
+
id: `0x${string}`;
|
|
395
|
+
number: number;
|
|
396
|
+
timestamp: string;
|
|
397
|
+
transactionCount: number;
|
|
398
|
+
}[];
|
|
399
|
+
nextCursor: string | null;
|
|
400
|
+
};
|
|
401
|
+
outputFormat: "json";
|
|
402
|
+
status: 200;
|
|
403
|
+
input: {
|
|
404
|
+
query?: {
|
|
405
|
+
chainId?: string | string[];
|
|
406
|
+
cursor?: string | string[];
|
|
407
|
+
limit?: string | string[];
|
|
408
|
+
order?: string | string[];
|
|
409
|
+
page?: string | string[];
|
|
410
|
+
} | undefined;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
} & {
|
|
415
|
+
"/:block": {
|
|
416
|
+
$get: {
|
|
417
|
+
output: null;
|
|
418
|
+
outputFormat: "body";
|
|
419
|
+
status: 402;
|
|
420
|
+
input: {
|
|
421
|
+
param: {
|
|
422
|
+
block: string;
|
|
423
|
+
};
|
|
424
|
+
} & {
|
|
425
|
+
query?: {
|
|
426
|
+
chainId?: string | string[];
|
|
427
|
+
} | undefined;
|
|
428
|
+
};
|
|
429
|
+
} | {
|
|
430
|
+
output: {
|
|
431
|
+
error: {
|
|
432
|
+
code: "api_key_malformed";
|
|
433
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
434
|
+
message: string;
|
|
435
|
+
};
|
|
436
|
+
requestId: string;
|
|
437
|
+
};
|
|
438
|
+
outputFormat: "json";
|
|
439
|
+
status: 400;
|
|
440
|
+
input: {
|
|
441
|
+
param: {
|
|
442
|
+
block: string;
|
|
443
|
+
};
|
|
444
|
+
} & {
|
|
445
|
+
query?: {
|
|
446
|
+
chainId?: string | string[];
|
|
447
|
+
} | undefined;
|
|
448
|
+
};
|
|
449
|
+
} | {
|
|
450
|
+
output: {
|
|
451
|
+
error: {
|
|
452
|
+
code: "api_key_invalid" | "api_key_missing";
|
|
453
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
454
|
+
message: string;
|
|
455
|
+
};
|
|
456
|
+
requestId: string;
|
|
457
|
+
};
|
|
458
|
+
outputFormat: "json";
|
|
459
|
+
status: 401;
|
|
460
|
+
input: {
|
|
461
|
+
param: {
|
|
462
|
+
block: string;
|
|
463
|
+
};
|
|
464
|
+
} & {
|
|
465
|
+
query?: {
|
|
466
|
+
chainId?: string | string[];
|
|
467
|
+
} | undefined;
|
|
468
|
+
};
|
|
469
|
+
} | {
|
|
470
|
+
output: {
|
|
471
|
+
error: {
|
|
472
|
+
code: "api_key_forbidden";
|
|
473
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
474
|
+
message: string;
|
|
475
|
+
};
|
|
476
|
+
requestId: string;
|
|
477
|
+
};
|
|
478
|
+
outputFormat: "json";
|
|
479
|
+
status: 403;
|
|
480
|
+
input: {
|
|
481
|
+
param: {
|
|
482
|
+
block: string;
|
|
483
|
+
};
|
|
484
|
+
} & {
|
|
485
|
+
query?: {
|
|
486
|
+
chainId?: string | string[];
|
|
487
|
+
} | undefined;
|
|
488
|
+
};
|
|
489
|
+
} | {
|
|
490
|
+
output: {
|
|
491
|
+
error: {
|
|
492
|
+
code: "payment_required" | "rate_limit_exceeded";
|
|
493
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
494
|
+
message: string;
|
|
495
|
+
};
|
|
496
|
+
requestId: string;
|
|
497
|
+
};
|
|
498
|
+
outputFormat: "json";
|
|
499
|
+
status: 429;
|
|
500
|
+
input: {
|
|
501
|
+
param: {
|
|
502
|
+
block: string;
|
|
503
|
+
};
|
|
504
|
+
} & {
|
|
505
|
+
query?: {
|
|
506
|
+
chainId?: string | string[];
|
|
507
|
+
} | undefined;
|
|
508
|
+
};
|
|
509
|
+
} | {
|
|
510
|
+
output: {
|
|
511
|
+
error: {
|
|
512
|
+
code: "query_invalid";
|
|
513
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
514
|
+
message: string;
|
|
515
|
+
};
|
|
516
|
+
requestId: string;
|
|
517
|
+
};
|
|
518
|
+
outputFormat: "json";
|
|
519
|
+
status: 400;
|
|
520
|
+
input: {
|
|
521
|
+
param: {
|
|
522
|
+
block: string;
|
|
523
|
+
};
|
|
524
|
+
} & {
|
|
525
|
+
query?: {
|
|
526
|
+
chainId?: string | string[];
|
|
527
|
+
} | undefined;
|
|
528
|
+
};
|
|
529
|
+
} | {
|
|
530
|
+
output: {
|
|
531
|
+
error: {
|
|
532
|
+
code: "upstream_error";
|
|
533
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
534
|
+
message: string;
|
|
535
|
+
};
|
|
536
|
+
requestId: string;
|
|
537
|
+
};
|
|
538
|
+
outputFormat: "json";
|
|
539
|
+
status: 502;
|
|
540
|
+
input: {
|
|
541
|
+
param: {
|
|
542
|
+
block: string;
|
|
543
|
+
};
|
|
544
|
+
} & {
|
|
545
|
+
query?: {
|
|
546
|
+
chainId?: string | string[];
|
|
547
|
+
} | undefined;
|
|
548
|
+
};
|
|
549
|
+
} | {
|
|
550
|
+
output: {
|
|
551
|
+
error: {
|
|
552
|
+
code: "block_invalid";
|
|
553
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
554
|
+
message: string;
|
|
555
|
+
};
|
|
556
|
+
requestId: string;
|
|
557
|
+
};
|
|
558
|
+
outputFormat: "json";
|
|
559
|
+
status: 400;
|
|
560
|
+
input: {
|
|
561
|
+
param: {
|
|
562
|
+
block: string;
|
|
563
|
+
};
|
|
564
|
+
} & {
|
|
565
|
+
query?: {
|
|
566
|
+
chainId?: string | string[];
|
|
567
|
+
} | undefined;
|
|
568
|
+
};
|
|
569
|
+
} | {
|
|
570
|
+
output: {
|
|
571
|
+
error: {
|
|
572
|
+
code: "block_not_found";
|
|
573
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
574
|
+
message: string;
|
|
575
|
+
};
|
|
576
|
+
requestId: string;
|
|
577
|
+
};
|
|
578
|
+
outputFormat: "json";
|
|
579
|
+
status: 404;
|
|
580
|
+
input: {
|
|
581
|
+
param: {
|
|
582
|
+
block: string;
|
|
583
|
+
};
|
|
584
|
+
} & {
|
|
585
|
+
query?: {
|
|
586
|
+
chainId?: string | string[];
|
|
587
|
+
} | undefined;
|
|
588
|
+
};
|
|
589
|
+
} | {
|
|
590
|
+
output: {
|
|
591
|
+
baseFeePerGas: string | null;
|
|
592
|
+
gasLimit: number;
|
|
593
|
+
gasUsed: number;
|
|
594
|
+
hash: `0x${string}`;
|
|
595
|
+
id: `0x${string}`;
|
|
596
|
+
meta: {
|
|
597
|
+
rpc: {
|
|
598
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
599
|
+
baseFeePerGas?: `0x${string}` | null | undefined;
|
|
600
|
+
difficulty?: `0x${string}` | undefined;
|
|
601
|
+
extraData?: `0x${string}` | undefined;
|
|
602
|
+
gasLimit: `0x${string}`;
|
|
603
|
+
gasUsed: `0x${string}`;
|
|
604
|
+
hash: `0x${string}` | null;
|
|
605
|
+
logsBloom?: `0x${string}` | null | undefined;
|
|
606
|
+
miner: `0x${string}`;
|
|
607
|
+
mixHash?: `0x${string}` | undefined;
|
|
608
|
+
nonce?: `0x${string}` | null | undefined;
|
|
609
|
+
number: `0x${string}` | null;
|
|
610
|
+
parentHash: `0x${string}`;
|
|
611
|
+
receiptsRoot: `0x${string}`;
|
|
612
|
+
sha3Uncles?: `0x${string}` | undefined;
|
|
613
|
+
size: `0x${string}`;
|
|
614
|
+
stateRoot: `0x${string}`;
|
|
615
|
+
timestamp: `0x${string}`;
|
|
616
|
+
totalDifficulty?: `0x${string}` | undefined;
|
|
617
|
+
transactions: `0x${string}`[];
|
|
618
|
+
transactionsRoot: `0x${string}`;
|
|
619
|
+
uncles?: `0x${string}`[] | undefined;
|
|
620
|
+
withdrawals?: {
|
|
621
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
622
|
+
}[] | undefined;
|
|
623
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
miner: `0x${string}`;
|
|
627
|
+
number: number;
|
|
628
|
+
parentHash: `0x${string}`;
|
|
629
|
+
size: number;
|
|
630
|
+
timestamp: string;
|
|
631
|
+
transactionCount: number;
|
|
632
|
+
};
|
|
633
|
+
outputFormat: "json";
|
|
634
|
+
status: 200;
|
|
635
|
+
input: {
|
|
636
|
+
param: {
|
|
637
|
+
block: string;
|
|
638
|
+
};
|
|
639
|
+
} & {
|
|
640
|
+
query?: {
|
|
641
|
+
chainId?: string | string[];
|
|
642
|
+
} | undefined;
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
}, "/", "/:block">;
|
|
647
|
+
/**
|
|
648
|
+
* Mounts the hidden legacy `GET /chains/:chainId/blocks/by-timestamp`
|
|
649
|
+
* compatibility route at the app root. The prior Tempo API exposed this shape
|
|
650
|
+
* (chain id in the path, a required unix `timestamp`, and a `closest` direction)
|
|
651
|
+
* and returned `{ block: { blockNumber, blockTimestamp } }`; this preserves it
|
|
652
|
+
* so existing clients keep working while the canonical surface is
|
|
653
|
+
* `GET /v1/blocks/:block` with an ISO 8601 selector.
|
|
654
|
+
*
|
|
655
|
+
* Like the original it searches a ±{@link byTimestampWindowSeconds}s window and
|
|
656
|
+
* returns `404` when no indexed block falls within it. Because the chain id is a
|
|
657
|
+
* path parameter (not the `chainId` query the global guard inspects), this
|
|
658
|
+
* validates it against the deployment's supported chains itself.
|
|
659
|
+
*/
|
|
660
|
+
export declare function blocksByTimestampCompat(): import("hono/hono-base").HonoBase<App.Environment, {
|
|
661
|
+
"/:chainId/blocks/by-timestamp": {
|
|
662
|
+
$get: {
|
|
663
|
+
output: null;
|
|
664
|
+
outputFormat: "body";
|
|
665
|
+
status: 402;
|
|
666
|
+
input: {
|
|
667
|
+
param: {
|
|
668
|
+
chainId: string;
|
|
669
|
+
};
|
|
670
|
+
} & {
|
|
671
|
+
query: {
|
|
672
|
+
closest?: string | string[];
|
|
673
|
+
timestamp: string | string[];
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
} | {
|
|
677
|
+
output: {
|
|
678
|
+
error: {
|
|
679
|
+
code: "api_key_malformed";
|
|
680
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
681
|
+
message: string;
|
|
682
|
+
};
|
|
683
|
+
requestId: string;
|
|
684
|
+
};
|
|
685
|
+
outputFormat: "json";
|
|
686
|
+
status: 400;
|
|
687
|
+
input: {
|
|
688
|
+
param: {
|
|
689
|
+
chainId: string;
|
|
690
|
+
};
|
|
691
|
+
} & {
|
|
692
|
+
query: {
|
|
693
|
+
closest?: string | string[];
|
|
694
|
+
timestamp: string | string[];
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
} | {
|
|
698
|
+
output: {
|
|
699
|
+
error: {
|
|
700
|
+
code: "api_key_invalid" | "api_key_missing";
|
|
701
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
702
|
+
message: string;
|
|
703
|
+
};
|
|
704
|
+
requestId: string;
|
|
705
|
+
};
|
|
706
|
+
outputFormat: "json";
|
|
707
|
+
status: 401;
|
|
708
|
+
input: {
|
|
709
|
+
param: {
|
|
710
|
+
chainId: string;
|
|
711
|
+
};
|
|
712
|
+
} & {
|
|
713
|
+
query: {
|
|
714
|
+
closest?: string | string[];
|
|
715
|
+
timestamp: string | string[];
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
} | {
|
|
719
|
+
output: {
|
|
720
|
+
error: {
|
|
721
|
+
code: "api_key_forbidden";
|
|
722
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
723
|
+
message: string;
|
|
724
|
+
};
|
|
725
|
+
requestId: string;
|
|
726
|
+
};
|
|
727
|
+
outputFormat: "json";
|
|
728
|
+
status: 403;
|
|
729
|
+
input: {
|
|
730
|
+
param: {
|
|
731
|
+
chainId: string;
|
|
732
|
+
};
|
|
733
|
+
} & {
|
|
734
|
+
query: {
|
|
735
|
+
closest?: string | string[];
|
|
736
|
+
timestamp: string | string[];
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
} | {
|
|
740
|
+
output: {
|
|
741
|
+
error: {
|
|
742
|
+
code: "payment_required" | "rate_limit_exceeded";
|
|
743
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
744
|
+
message: string;
|
|
745
|
+
};
|
|
746
|
+
requestId: string;
|
|
747
|
+
};
|
|
748
|
+
outputFormat: "json";
|
|
749
|
+
status: 429;
|
|
750
|
+
input: {
|
|
751
|
+
param: {
|
|
752
|
+
chainId: string;
|
|
753
|
+
};
|
|
754
|
+
} & {
|
|
755
|
+
query: {
|
|
756
|
+
closest?: string | string[];
|
|
757
|
+
timestamp: string | string[];
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
} | {
|
|
761
|
+
output: {
|
|
762
|
+
error: {
|
|
763
|
+
code: "query_invalid";
|
|
764
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
765
|
+
message: string;
|
|
766
|
+
};
|
|
767
|
+
requestId: string;
|
|
768
|
+
};
|
|
769
|
+
outputFormat: "json";
|
|
770
|
+
status: 400;
|
|
771
|
+
input: {
|
|
772
|
+
param: {
|
|
773
|
+
chainId: string;
|
|
774
|
+
};
|
|
775
|
+
} & {
|
|
776
|
+
query: {
|
|
777
|
+
closest?: string | string[];
|
|
778
|
+
timestamp: string | string[];
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
} | {
|
|
782
|
+
output: {
|
|
783
|
+
error: {
|
|
784
|
+
code: "upstream_error";
|
|
785
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
786
|
+
message: string;
|
|
787
|
+
};
|
|
788
|
+
requestId: string;
|
|
789
|
+
};
|
|
790
|
+
outputFormat: "json";
|
|
791
|
+
status: 502;
|
|
792
|
+
input: {
|
|
793
|
+
param: {
|
|
794
|
+
chainId: string;
|
|
795
|
+
};
|
|
796
|
+
} & {
|
|
797
|
+
query: {
|
|
798
|
+
closest?: string | string[];
|
|
799
|
+
timestamp: string | string[];
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
} | {
|
|
803
|
+
output: {
|
|
804
|
+
error: {
|
|
805
|
+
code: "block_not_found";
|
|
806
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
807
|
+
message: string;
|
|
808
|
+
};
|
|
809
|
+
requestId: string;
|
|
810
|
+
};
|
|
811
|
+
outputFormat: "json";
|
|
812
|
+
status: 404;
|
|
813
|
+
input: {
|
|
814
|
+
param: {
|
|
815
|
+
chainId: string;
|
|
816
|
+
};
|
|
817
|
+
} & {
|
|
818
|
+
query: {
|
|
819
|
+
closest?: string | string[];
|
|
820
|
+
timestamp: string | string[];
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
} | {
|
|
824
|
+
output: {
|
|
825
|
+
error: {
|
|
826
|
+
code: "chain_id_unsupported";
|
|
827
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
828
|
+
message: string;
|
|
829
|
+
};
|
|
830
|
+
requestId: string;
|
|
831
|
+
};
|
|
832
|
+
outputFormat: "json";
|
|
833
|
+
status: 400;
|
|
834
|
+
input: {
|
|
835
|
+
param: {
|
|
836
|
+
chainId: string;
|
|
837
|
+
};
|
|
838
|
+
} & {
|
|
839
|
+
query: {
|
|
840
|
+
closest?: string | string[];
|
|
841
|
+
timestamp: string | string[];
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
} | {
|
|
845
|
+
output: {
|
|
846
|
+
block: {
|
|
847
|
+
blockNumber: number;
|
|
848
|
+
blockTimestamp: number;
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
outputFormat: "json";
|
|
852
|
+
status: 200;
|
|
853
|
+
input: {
|
|
854
|
+
param: {
|
|
855
|
+
chainId: string;
|
|
856
|
+
};
|
|
857
|
+
} & {
|
|
858
|
+
query: {
|
|
859
|
+
closest?: string | string[];
|
|
860
|
+
timestamp: string | string[];
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
}, "/", "/:chainId/blocks/by-timestamp">;
|
|
866
|
+
export declare namespace findBlockByTimestamp {
|
|
867
|
+
type Options = {
|
|
868
|
+
chainId: z.output<typeof Schema.ChainId>;
|
|
869
|
+
closest: 'before' | 'after';
|
|
870
|
+
timestamp: number;
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Parses a `:block` path parameter, dispatching by shape. Returns the
|
|
875
|
+
* discriminated identifier, or `undefined` when the input matches no known
|
|
876
|
+
* shape (the schema should have caught this earlier; this guards the type at
|
|
877
|
+
* the use site).
|
|
878
|
+
*
|
|
879
|
+
* Selectors are unambiguous by shape: a block tag is a fixed keyword; the
|
|
880
|
+
* 66-char `0x`-prefixed length identifies a 32-byte hash; any other
|
|
881
|
+
* `0x`-prefixed hex (or plain decimal) is a block number; and an ISO 8601
|
|
882
|
+
* timestamp (validated with the same {@link blockTimestamp} schema as the
|
|
883
|
+
* route) is resolved to its UTC instant.
|
|
884
|
+
*/
|
|
885
|
+
export declare function parseBlockIdentifier(value: string): parseBlockIdentifier.Result | undefined;
|
|
886
|
+
export declare namespace parseBlockIdentifier {
|
|
887
|
+
/** An EVM block tag accepted by the `:block` selector. */
|
|
888
|
+
type BlockTag = (typeof blockTags)[number];
|
|
889
|
+
/** A parsed block identifier, dispatching by shape. */
|
|
890
|
+
type Result = {
|
|
891
|
+
kind: 'tag';
|
|
892
|
+
tag: BlockTag;
|
|
893
|
+
} | {
|
|
894
|
+
kind: 'hash';
|
|
895
|
+
hash: Hex.Hex;
|
|
896
|
+
} | {
|
|
897
|
+
kind: 'number';
|
|
898
|
+
number: bigint;
|
|
899
|
+
} | {
|
|
900
|
+
kind: 'timestamp';
|
|
901
|
+
iso: string;
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Lists blocks from the indexer. Reads every block from the `blocks` table
|
|
906
|
+
* (so empty blocks are included) and resolves transaction counts via a
|
|
907
|
+
* second narrow `txs` query keyed to the page's block numbers.
|
|
908
|
+
*/
|
|
909
|
+
export declare function listBlocks(c: Context<App.Environment>, options: listBlocks.Options): Promise<{
|
|
910
|
+
data: {
|
|
911
|
+
hash: `0x${string}`;
|
|
912
|
+
id: `0x${string}`;
|
|
913
|
+
number: number;
|
|
914
|
+
timestamp: string;
|
|
915
|
+
transactionCount: number;
|
|
916
|
+
}[];
|
|
917
|
+
nextCursor: string | null;
|
|
918
|
+
}>;
|
|
919
|
+
export declare namespace listBlocks {
|
|
920
|
+
type Options = {
|
|
921
|
+
chainId: z.output<typeof Schema.ChainId>;
|
|
922
|
+
/** Opaque keyset cursor anchoring the page; omit for the head page. */
|
|
923
|
+
cursor?: string | undefined;
|
|
924
|
+
limit: number;
|
|
925
|
+
/** 1-indexed page number (positional pagination; exclusive with `cursor`). */
|
|
926
|
+
page?: number | undefined;
|
|
927
|
+
order: 'asc' | 'desc';
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
export {};
|
|
931
|
+
//# sourceMappingURL=blocks.d.ts.map
|