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,132 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
import type * as z from 'zod/mini';
|
|
3
|
+
/** Creates a JSON error response. */
|
|
4
|
+
export declare function error<const status extends error.Status, const code extends string>(c: Context, options: error.Options<status, code>): Response & import("hono").TypedResponse<{
|
|
5
|
+
error: string | code | readonly error.Detail[] | undefined extends bigint | readonly bigint[] ? never : { [K in keyof {
|
|
6
|
+
code: code;
|
|
7
|
+
details?: readonly error.Detail[] | undefined;
|
|
8
|
+
message: string;
|
|
9
|
+
} as ({
|
|
10
|
+
/** Stable machine-readable error code. */
|
|
11
|
+
code: code;
|
|
12
|
+
/** Detailed validation or upstream error information. */
|
|
13
|
+
details?: readonly error.Detail[] | undefined;
|
|
14
|
+
/** Human-readable error message. */
|
|
15
|
+
message: string;
|
|
16
|
+
}[K] extends infer T ? T extends {
|
|
17
|
+
/** Stable machine-readable error code. */
|
|
18
|
+
code: code;
|
|
19
|
+
/** Detailed validation or upstream error information. */
|
|
20
|
+
details?: readonly error.Detail[] | undefined;
|
|
21
|
+
/** Human-readable error message. */
|
|
22
|
+
message: string;
|
|
23
|
+
}[K] ? T extends import("hono/utils/types").InvalidJSONValue ? true : false : never : never) extends true ? never : K]: boolean extends ({
|
|
24
|
+
/** Stable machine-readable error code. */
|
|
25
|
+
code: code;
|
|
26
|
+
/** Detailed validation or upstream error information. */
|
|
27
|
+
details?: readonly error.Detail[] | undefined;
|
|
28
|
+
/** Human-readable error message. */
|
|
29
|
+
message: string;
|
|
30
|
+
}[K] extends infer T ? T extends {
|
|
31
|
+
/** Stable machine-readable error code. */
|
|
32
|
+
code: code;
|
|
33
|
+
/** Detailed validation or upstream error information. */
|
|
34
|
+
details?: readonly error.Detail[] | undefined;
|
|
35
|
+
/** Human-readable error message. */
|
|
36
|
+
message: string;
|
|
37
|
+
}[K] ? T extends import("hono/utils/types").InvalidJSONValue ? true : false : never : never) ? import("hono/utils/types").JSONParsed<{
|
|
38
|
+
/** Stable machine-readable error code. */
|
|
39
|
+
code: code;
|
|
40
|
+
/** Detailed validation or upstream error information. */
|
|
41
|
+
details?: readonly error.Detail[] | undefined;
|
|
42
|
+
/** Human-readable error message. */
|
|
43
|
+
message: string;
|
|
44
|
+
}[K], bigint | readonly bigint[]> | undefined : import("hono/utils/types").JSONParsed<{
|
|
45
|
+
/** Stable machine-readable error code. */
|
|
46
|
+
code: code;
|
|
47
|
+
/** Detailed validation or upstream error information. */
|
|
48
|
+
details?: readonly error.Detail[] | undefined;
|
|
49
|
+
/** Human-readable error message. */
|
|
50
|
+
message: string;
|
|
51
|
+
}[K], bigint | readonly bigint[]>; };
|
|
52
|
+
requestId: string;
|
|
53
|
+
}, status, "json">;
|
|
54
|
+
/**
|
|
55
|
+
* Rejects a well-formed but unsupported chain id with a clear 400, listing the
|
|
56
|
+
* chain ids this deployment serves. Used to short-circuit before an unknown
|
|
57
|
+
* chain reaches an upstream (which would surface as an opaque `upstream_error`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function unsupportedChainId(c: Context, chainId: number, supported: Iterable<number>): Response & import("hono").TypedResponse<{
|
|
60
|
+
error: {
|
|
61
|
+
code: "chain_id_unsupported";
|
|
62
|
+
details?: readonly error.Detail[] | undefined;
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
requestId: string;
|
|
66
|
+
}, 400, "json">;
|
|
67
|
+
/**
|
|
68
|
+
* Maps an unexpected upstream failure to a 502 JSON error envelope. Rethrows
|
|
69
|
+
* non-`Error` causes so the global handler can convert them.
|
|
70
|
+
*/
|
|
71
|
+
export declare function upstream(c: Context, cause: unknown): Response & import("hono").TypedResponse<{
|
|
72
|
+
error: {
|
|
73
|
+
code: "upstream_error";
|
|
74
|
+
details?: readonly error.Detail[] | undefined;
|
|
75
|
+
message: string;
|
|
76
|
+
};
|
|
77
|
+
requestId: string;
|
|
78
|
+
}, 502, "json">;
|
|
79
|
+
/**
|
|
80
|
+
* Validates `value` against `schema`. Returns the parsed value on success or
|
|
81
|
+
* throws a generic upstream error so the public response body never leaks Zod
|
|
82
|
+
* internals.
|
|
83
|
+
*/
|
|
84
|
+
export declare function validated<schema extends z.ZodMiniType>(schema: schema, value: unknown): z.output<schema>;
|
|
85
|
+
/** Converts standard validation issues into API error details. */
|
|
86
|
+
export declare function validationDetails(issues: readonly validationDetails.Issue[]): error.Detail[];
|
|
87
|
+
export declare namespace error {
|
|
88
|
+
/** Public API error response body. */
|
|
89
|
+
type Body<code extends string = string> = {
|
|
90
|
+
/** Public error envelope. */
|
|
91
|
+
error: {
|
|
92
|
+
/** Stable machine-readable error code. */
|
|
93
|
+
code: code;
|
|
94
|
+
/** Detailed validation or upstream error information. */
|
|
95
|
+
details?: readonly Detail[] | undefined;
|
|
96
|
+
/** Human-readable error message. */
|
|
97
|
+
message: string;
|
|
98
|
+
};
|
|
99
|
+
/** Request id for support/debugging. */
|
|
100
|
+
requestId: string;
|
|
101
|
+
};
|
|
102
|
+
/** One public API error detail. */
|
|
103
|
+
type Detail = {
|
|
104
|
+
/** Human-readable detail message. */
|
|
105
|
+
message: string;
|
|
106
|
+
/** Path to the invalid value. */
|
|
107
|
+
path?: readonly (number | string)[] | undefined;
|
|
108
|
+
};
|
|
109
|
+
/** HTTP status code accepted by the public error helper. */
|
|
110
|
+
type Status = 400 | 401 | 403 | 404 | 409 | 412 | 413 | 415 | 429 | 500 | 502 | 503;
|
|
111
|
+
/** Options for creating a JSON error response. */
|
|
112
|
+
type Options<status extends Status = Status, code extends string = string> = {
|
|
113
|
+
/** Stable machine-readable error code. */
|
|
114
|
+
code: code;
|
|
115
|
+
/** Detailed validation or upstream error information. */
|
|
116
|
+
details?: readonly Detail[] | undefined;
|
|
117
|
+
/** Human-readable error message. */
|
|
118
|
+
message: string;
|
|
119
|
+
/** HTTP status code. */
|
|
120
|
+
status: status;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
export declare namespace validationDetails {
|
|
124
|
+
/** Standard-schema validation issue shape used by Hono validators. */
|
|
125
|
+
type Issue = {
|
|
126
|
+
/** Human-readable validation message. */
|
|
127
|
+
message: string;
|
|
128
|
+
/** Path to the invalid value. */
|
|
129
|
+
path?: readonly unknown[] | undefined;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=Response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../src/internal/Response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,KAAK,CAAC,MAAM,UAAU,CAAA;AAElC,qCAAqC;AACrC,wBAAgB,KAAK,CAAC,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,SAAS,MAAM,EAChF,CAAC,EAAE,OAAO,EACV,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;;;kBA2EtB,SAAS,YAAM,EAAE,GAAG,SAAS;iBAE9B,MAAM;;QALf,0CAA0C;;QAE1C,yDAAyD;kBAC/C,SAAS,YAAM,EAAE,GAAG,SAAS;QACvC,oCAAoC;iBAC3B,MAAM;;QALf,0CAA0C;;QAE1C,yDAAyD;;QAEzD,oCAAoC;;;QAJpC,0CAA0C;;QAE1C,yDAAyD;;QAEzD,oCAAoC;;;QAJpC,0CAA0C;;QAE1C,yDAAyD;;QAEzD,oCAAoC;;;QAJpC,0CAA0C;;QAE1C,yDAAyD;;QAEzD,oCAAoC;;;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AAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;KAChD,CAAA;IAED,4DAA4D;IAC5D,KAAK,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IAEnF,kDAAkD;IAClD,KAAK,OAAO,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI;QAC3E,0CAA0C;QAC1C,IAAI,EAAE,IAAI,CAAA;QACV,yDAAyD;QACzD,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;QACvC,oCAAoC;QACpC,OAAO,EAAE,MAAM,CAAA;QACf,wBAAwB;QACxB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC,sEAAsE;IACtE,KAAK,KAAK,GAAG;QACX,yCAAyC;QACzC,OAAO,EAAE,MAAM,CAAA;QACf,iCAAiC;QACjC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,CAAA;KACtC,CAAA;CACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Creates a JSON error response. */
|
|
2
|
+
export function error(c, options) {
|
|
3
|
+
const { code, details, message, status } = options;
|
|
4
|
+
// Error envelopes embed `requestId` and other per-request state, so they
|
|
5
|
+
// must never be cached by clients, proxies, or CDNs.
|
|
6
|
+
c.header('Cache-Control', 'no-store');
|
|
7
|
+
// Record the stable code so the canonical request log line (`Log.middleware`)
|
|
8
|
+
// can include it without re-parsing the response body.
|
|
9
|
+
c.set('errorCode', code);
|
|
10
|
+
const body = {
|
|
11
|
+
error: {
|
|
12
|
+
code,
|
|
13
|
+
...(details === undefined ? {} : { details }),
|
|
14
|
+
message,
|
|
15
|
+
},
|
|
16
|
+
requestId: c.get('requestId'),
|
|
17
|
+
};
|
|
18
|
+
return c.json(body, status);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Rejects a well-formed but unsupported chain id with a clear 400, listing the
|
|
22
|
+
* chain ids this deployment serves. Used to short-circuit before an unknown
|
|
23
|
+
* chain reaches an upstream (which would surface as an opaque `upstream_error`).
|
|
24
|
+
*/
|
|
25
|
+
export function unsupportedChainId(c, chainId, supported) {
|
|
26
|
+
const ids = [...supported].sort((a, b) => a - b).join(', ');
|
|
27
|
+
return error(c, {
|
|
28
|
+
code: 'chain_id_unsupported',
|
|
29
|
+
message: `Unsupported chain id: ${chainId}. Supported chain ids: ${ids}.`,
|
|
30
|
+
status: 400,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Maps an unexpected upstream failure to a 502 JSON error envelope. Rethrows
|
|
35
|
+
* non-`Error` causes so the global handler can convert them.
|
|
36
|
+
*/
|
|
37
|
+
export function upstream(c, cause) {
|
|
38
|
+
if (cause instanceof Error)
|
|
39
|
+
return error(c, { code: 'upstream_error', message: cause.message, status: 502 });
|
|
40
|
+
throw cause;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validates `value` against `schema`. Returns the parsed value on success or
|
|
44
|
+
* throws a generic upstream error so the public response body never leaks Zod
|
|
45
|
+
* internals.
|
|
46
|
+
*/
|
|
47
|
+
export function validated(schema, value) {
|
|
48
|
+
const result = schema.safeParse(value);
|
|
49
|
+
if (result.success)
|
|
50
|
+
return result.data;
|
|
51
|
+
throw new Error('Upstream returned invalid response data');
|
|
52
|
+
}
|
|
53
|
+
/** Converts standard validation issues into API error details. */
|
|
54
|
+
export function validationDetails(issues) {
|
|
55
|
+
return issues.map((issue) => {
|
|
56
|
+
const path = issue.path?.map(pathSegment).filter((segment) => segment !== undefined);
|
|
57
|
+
if (!path?.length)
|
|
58
|
+
return { message: issue.message };
|
|
59
|
+
return { message: issue.message, path };
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function pathSegment(segment) {
|
|
63
|
+
if (typeof segment === 'string' || typeof segment === 'number')
|
|
64
|
+
return segment;
|
|
65
|
+
if (!segment || typeof segment !== 'object' || !('key' in segment))
|
|
66
|
+
return undefined;
|
|
67
|
+
const { key } = segment;
|
|
68
|
+
if (typeof key === 'string' || typeof key === 'number')
|
|
69
|
+
return key;
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../src/internal/Response.ts"],"names":[],"mappings":"AAGA,qCAAqC;AACrC,MAAM,UAAU,KAAK,CACnB,CAAU,EACV,OAAoC;IAEpC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IAClD,yEAAyE;IACzE,qDAAqD;IACrD,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;IACrC,8EAA8E;IAC9E,uDAAuD;IACvD,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACxB,MAAM,IAAI,GAAqB;QAC7B,KAAK,EAAE;YACL,IAAI;YACJ,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;YAC7C,OAAO;SACR;QACD,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;KAC9B,CAAA;IACD,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAU,EAAE,OAAe,EAAE,SAA2B;IACzF,MAAM,GAAG,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC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CAAC,CAAA;AACJ,CAAC;AAoDD,SAAS,WAAW,CAAC,OAAgB;IACnC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAA;IAC9E,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC;QAAE,OAAO,SAAS,CAAA;IAEpF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAA;IACvB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IAClE,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { Hex as core_Hex } from 'ox';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
/**
|
|
4
|
+
* Attaches an OpenAPI description to an object/array schema that is later
|
|
5
|
+
* derived from via `z.partial`/`z.extend`. `zod/mini` exposes descriptions only
|
|
6
|
+
* through `.check(z.describe(...))`, but that adds a refinement which those
|
|
7
|
+
* derivations reject. Cloning and registering the description directly (as
|
|
8
|
+
* classic zod's `.describe()` does) keeps the schema refinement-free. Plain
|
|
9
|
+
* fields use `.check(z.describe(...))` directly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function describe<const schema extends z.ZodMiniType>(schema: schema, description: string): schema;
|
|
12
|
+
/** Lowercase 0x-prefixed 20-byte account address. */
|
|
13
|
+
export declare const Address: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
14
|
+
/**
|
|
15
|
+
* Lowercase 0x-prefixed 20-byte TIP-20 token contract address. The OpenAPI
|
|
16
|
+
* example must be attached to the inner pre-transform schema (path/query
|
|
17
|
+
* params read examples from the pipe input), so callers that need a different
|
|
18
|
+
* example per field build a fresh `TokenAddress` via `tokenAddress(example)`
|
|
19
|
+
* instead of overriding via an outer `.check(z.meta(...))`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TokenAddress: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
22
|
+
/**
|
|
23
|
+
* Builds a `TokenAddress`-shaped schema with the given OpenAPI example. Use
|
|
24
|
+
* when a path/query param wants a different example than the shared
|
|
25
|
+
* `TokenAddress` default (e.g. the two sides of a trading pair).
|
|
26
|
+
*
|
|
27
|
+
* The example must be a TIP-20 token address (`0x20c` prefix); a non-TIP-20
|
|
28
|
+
* example in the docs would be misleading because the route validates the
|
|
29
|
+
* value as a TIP-20 token contract at runtime.
|
|
30
|
+
*/
|
|
31
|
+
export declare function tokenAddress(example: core_Hex.Hex): z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
32
|
+
/** Maps human-readable chain aliases to their Tempo chain id. */
|
|
33
|
+
export declare const chainIdAlias: {
|
|
34
|
+
readonly mainnet: 4217;
|
|
35
|
+
readonly testnet: 42431;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Tempo chain id. Accepts a chain alias (`mainnet`/`testnet`) or any positive
|
|
39
|
+
* integer chain id (a number or numeric string), normalizing all forms to a
|
|
40
|
+
* numeric chain id. Arbitrary ids are allowed so a self-hosted deployment can
|
|
41
|
+
* serve a localnet (e.g. `31337`); the deployment must configure an `rpc`/`tidx`
|
|
42
|
+
* upstream for any chain beyond the built-in public defaults.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ChainId: z.ZodMiniPipe<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
45
|
+
mainnet: "mainnet";
|
|
46
|
+
testnet: "testnet";
|
|
47
|
+
}>, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniNumber<unknown>]>, z.ZodMiniNumber<number>>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional `chainId` query parameter shared across endpoints. Accepts a chain
|
|
50
|
+
* alias (`mainnet`/`testnet`) or a numeric chain id, normalizing both to a
|
|
51
|
+
* numeric {@link ChainId}.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ChainIdQuery: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
54
|
+
mainnet: "mainnet";
|
|
55
|
+
testnet: "testnet";
|
|
56
|
+
}>, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniNumber<unknown>]>, z.ZodMiniNumber<number>>>;
|
|
57
|
+
declare const booleanQueryBase: z.ZodMiniPipe<z.ZodMiniEnum<{
|
|
58
|
+
false: "false";
|
|
59
|
+
true: "true";
|
|
60
|
+
}>, z.ZodMiniTransform<boolean, "false" | "true">>;
|
|
61
|
+
/**
|
|
62
|
+
* Boolean query parameter. Query values arrive as the literal strings
|
|
63
|
+
* `"true"`/`"false"`, validated strictly and transformed to a real boolean.
|
|
64
|
+
* `z.boolean()` would reject the incoming string outright and
|
|
65
|
+
* `z.coerce.boolean()` is unsafe (`Boolean("false") === true`).
|
|
66
|
+
*
|
|
67
|
+
* The generated JSON Schema is overridden to a plain `boolean` so the parameter
|
|
68
|
+
* renders as a boolean — not a string — in the OpenAPI docs (and the generated
|
|
69
|
+
* CLI coerces it), while the wire format and strict `"true"`/`"false"`
|
|
70
|
+
* validation stay unchanged. The string `enum` that `z.enum` would emit is
|
|
71
|
+
* dropped (`enum: undefined`): left in place it makes consumers — e.g. the
|
|
72
|
+
* generated CLI — build a literal-`boolean` enum that then rejects the incoming
|
|
73
|
+
* string. Wrap with `z.optional(...)` / `z._default(..., value)` and describe
|
|
74
|
+
* with `.check(z.describe('…'))` at the call site — the override survives both.
|
|
75
|
+
* Returns a fresh clone per call so each call site is a distinct schema.
|
|
76
|
+
*/
|
|
77
|
+
export declare function booleanQuery(): typeof booleanQueryBase;
|
|
78
|
+
/** One public API error detail. */
|
|
79
|
+
export declare const ErrorDetail: z.ZodMiniObject<{
|
|
80
|
+
message: z.ZodMiniString<string>;
|
|
81
|
+
path: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
/**
|
|
84
|
+
* Builds the global error envelope, optionally enumerating `error.code` to a
|
|
85
|
+
* fixed set of machine-readable codes. Pass the codes a given status can return
|
|
86
|
+
* (e.g. `['token_not_found']` for a 404) so the reference and generated clients
|
|
87
|
+
* narrow the code to a literal union instead of an open `string`. Omit `codes`
|
|
88
|
+
* for the open-coded envelope.
|
|
89
|
+
*/
|
|
90
|
+
export declare function errorResponse(codes?: readonly [string, ...string[]]): z.ZodMiniObject<{
|
|
91
|
+
error: z.ZodMiniObject<{
|
|
92
|
+
code: z.ZodMiniEnum<{
|
|
93
|
+
[x: string]: string;
|
|
94
|
+
}> | z.ZodMiniString<string>;
|
|
95
|
+
details: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
96
|
+
message: z.ZodMiniString<string>;
|
|
97
|
+
path: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
98
|
+
}, z.core.$strip>>>;
|
|
99
|
+
message: z.ZodMiniString<string>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
requestId: z.ZodMiniString<string>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
/** Global error envelope with an open-coded `error.code`. */
|
|
104
|
+
export declare const ErrorResponse: z.ZodMiniObject<{
|
|
105
|
+
error: z.ZodMiniObject<{
|
|
106
|
+
code: z.ZodMiniEnum<{
|
|
107
|
+
[x: string]: string;
|
|
108
|
+
}> | z.ZodMiniString<string>;
|
|
109
|
+
details: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
110
|
+
message: z.ZodMiniString<string>;
|
|
111
|
+
path: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>]>>>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
message: z.ZodMiniString<string>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
requestId: z.ZodMiniString<string>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
/**
|
|
118
|
+
* Lowercase 0x-prefixed 32-byte hash. The OpenAPI example is attached to the
|
|
119
|
+
* inner pre-transform schema (path/query params read examples from the pipe
|
|
120
|
+
* input), so every hash path param surfaces one without per-route overrides.
|
|
121
|
+
* Callers that need a different example per field build a fresh schema via
|
|
122
|
+
* `hash(example)` instead of overriding through an outer `.check(z.meta(...))`.
|
|
123
|
+
*/
|
|
124
|
+
export declare const Hash: z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
125
|
+
/**
|
|
126
|
+
* Builds a {@link Hash}-shaped schema with the given OpenAPI example. Use when
|
|
127
|
+
* a path/query param wants a different example than the shared {@link Hash}
|
|
128
|
+
* default (e.g. a route that documents a specific real transaction).
|
|
129
|
+
*
|
|
130
|
+
* The example must be attached to the inner pre-transform schema because
|
|
131
|
+
* path/query params read examples from the pipe input.
|
|
132
|
+
*/
|
|
133
|
+
export declare function hash(example: core_Hex.Hex): z.ZodMiniPipe<z.ZodMiniTemplateLiteral<`0x${string}`>, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>;
|
|
134
|
+
/** Lowercase 0x-prefixed hex byte data (may be empty, `0x`). */
|
|
135
|
+
export declare const Hex: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<`0x${string}`, string>>;
|
|
136
|
+
/** Hex-encoded integer quantity (a `0x`-prefixed integer, e.g. `0x1a`). */
|
|
137
|
+
export declare const Quantity: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
138
|
+
/** Non-negative integer as a decimal string (preserves uint256 precision). */
|
|
139
|
+
export declare const DecimalString: z.ZodMiniString<string>;
|
|
140
|
+
/**
|
|
141
|
+
* Minimum page size accepted across list endpoints. Floored at 5 because the
|
|
142
|
+
* indexer rejects signature-decoded `Transfer` queries with `LIMIT < 5`
|
|
143
|
+
* (HTTP 422); applying it globally keeps pagination uniform and removes the need
|
|
144
|
+
* for per-endpoint clamping.
|
|
145
|
+
*/
|
|
146
|
+
export declare const minLimit = 5;
|
|
147
|
+
/** Page-size query parameter shared across list endpoints. */
|
|
148
|
+
export declare const Limit: z.ZodMiniDefault<z.ZodMiniNumber<unknown>>;
|
|
149
|
+
/** Opaque keyset-pagination cursor query parameter shared across list endpoints. */
|
|
150
|
+
export declare const Cursor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
151
|
+
/**
|
|
152
|
+
* Maximum page window (`page × limit` rows) accepted by positional pagination.
|
|
153
|
+
* Mirrors the indexer's own 10k row ceiling, and the bounded-window convention
|
|
154
|
+
* of comparable APIs (Elasticsearch `max_result_window`, Zendesk's 100-page
|
|
155
|
+
* cap): shallow page-numbered access is served positionally, deep traversal
|
|
156
|
+
* must use cursors.
|
|
157
|
+
*/
|
|
158
|
+
export declare const maxPageWindow = 10000;
|
|
159
|
+
/**
|
|
160
|
+
* Page-number query parameter (1-indexed) shared by list endpoints that
|
|
161
|
+
* support shallow positional pagination alongside keyset cursors. Cursors
|
|
162
|
+
* remain the canonical deep-traversal mode; the page lane exists for
|
|
163
|
+
* page-numbered UIs that need random access into the head of a feed.
|
|
164
|
+
*/
|
|
165
|
+
export declare const Page: z.ZodMiniOptional<z.ZodMiniNumber<unknown>>;
|
|
166
|
+
/**
|
|
167
|
+
* Cross-field checks for list query schemas that accept both `cursor` and
|
|
168
|
+
* `page`: the two are mutually exclusive, and the page window is bounded by
|
|
169
|
+
* {@link maxPageWindow}. Spread into the query object's `.check(...)`.
|
|
170
|
+
*/
|
|
171
|
+
export declare function pageChecks(): readonly [z.core.$ZodCheck<{
|
|
172
|
+
cursor?: string | undefined;
|
|
173
|
+
limit: number;
|
|
174
|
+
page?: number | undefined;
|
|
175
|
+
}>, z.core.$ZodCheck<{
|
|
176
|
+
cursor?: string | undefined;
|
|
177
|
+
limit: number;
|
|
178
|
+
page?: number | undefined;
|
|
179
|
+
}>];
|
|
180
|
+
/** Opaque next-page cursor response field shared across list endpoints. */
|
|
181
|
+
export declare const NextCursor: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
182
|
+
/**
|
|
183
|
+
* Upper bound on the matched-row count surfaced by `include=totalCount`. The
|
|
184
|
+
* count is computed by a capped subquery (`… LIMIT countCap`) so it can't blow
|
|
185
|
+
* the indexer's execution budget on the 10⁹-plus row tables; when the bound is
|
|
186
|
+
* hit the count is a lower bound, signalled by `Meta.totalCountCapped`. Mirrors the
|
|
187
|
+
* indexer's own 10k row ceiling (see {@link maxPageWindow}) and the capped-count
|
|
188
|
+
* conventions of comparable APIs (Stripe Search's 10k `total_count`,
|
|
189
|
+
* Elasticsearch `track_total_hits`, Shopify's `Count.precision`).
|
|
190
|
+
*/
|
|
191
|
+
export declare const countCap = 10000;
|
|
192
|
+
/**
|
|
193
|
+
* Total matched-row count response field for list endpoints that support
|
|
194
|
+
* `include=totalCount`. Exact when {@link TotalCountCapped} is `false`; a lower
|
|
195
|
+
* bound ("at least this many") when `true`. Independent of pagination —
|
|
196
|
+
* `nextCursor` remains the only end-of-list signal.
|
|
197
|
+
*/
|
|
198
|
+
export declare const TotalCount: z.ZodMiniNumber<number>;
|
|
199
|
+
/**
|
|
200
|
+
* Whether {@link TotalCount} hit the {@link countCap} bound. `true` means the
|
|
201
|
+
* count is a lower bound ("at least `totalCount` rows match"); `false` means it
|
|
202
|
+
* is exact.
|
|
203
|
+
*/
|
|
204
|
+
export declare const TotalCountCapped: z.ZodMiniBoolean<boolean>;
|
|
205
|
+
/** Sort-direction (`asc`/`desc`) query parameter shared across list endpoints. */
|
|
206
|
+
export declare const Order: z.ZodMiniDefault<z.ZodMiniEnum<{
|
|
207
|
+
asc: "asc";
|
|
208
|
+
desc: "desc";
|
|
209
|
+
}>>;
|
|
210
|
+
/**
|
|
211
|
+
* Optional inclusive block-number bound query parameter (`blockNumber.from` /
|
|
212
|
+
* `blockNumber.to`). `noun` is the resource being listed (e.g. `transfers`) so
|
|
213
|
+
* the description reads naturally across endpoints.
|
|
214
|
+
*/
|
|
215
|
+
export declare function blockNumberBound(noun: string, bound: 'from' | 'to'): z.ZodMiniOptional<z.ZodMiniNumber<unknown>>;
|
|
216
|
+
/**
|
|
217
|
+
* Optional inclusive ISO-8601 timestamp bound query parameter (`timestamp.from`
|
|
218
|
+
* / `timestamp.to`). `noun` is the resource being listed (e.g. `transfers`).
|
|
219
|
+
*/
|
|
220
|
+
export declare function timestampBound(noun: string, bound: 'from' | 'to'): z.ZodMiniOptional<z.ZodMiniISODateTime>;
|
|
221
|
+
/**
|
|
222
|
+
* Builds the schema for a comma-separated opt-in query parameter (e.g.
|
|
223
|
+
* `?include=token,feeToken`), parsed into a validated array of the given enum's
|
|
224
|
+
* members. Absent or empty values yield `[]`. Centralizes the splitting,
|
|
225
|
+
* trimming, and OpenAPI array-enum metadata that every list endpoint otherwise
|
|
226
|
+
* repeats.
|
|
227
|
+
*
|
|
228
|
+
* A repeated parameter (`?include=token&include=feeToken`) arrives from the
|
|
229
|
+
* validator as a `string[]`, so the input accepts both forms and each entry is
|
|
230
|
+
* still comma-split — the two styles compose freely.
|
|
231
|
+
*
|
|
232
|
+
* Pass the endpoint's `Include` enum — kept local so its members drive both the
|
|
233
|
+
* parsed type and the docs — plus the param description.
|
|
234
|
+
*/
|
|
235
|
+
export declare function includeQuery<const T extends Readonly<Record<string, string>>>(member: z.ZodMiniEnum<T>, description: string): z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniUnknown>, z.ZodMiniTransform<string[], unknown>>, z.ZodMiniArray<z.ZodMiniEnum<T>>>;
|
|
236
|
+
/**
|
|
237
|
+
* Ready-made `include` query parameter for list endpoints whose only optional
|
|
238
|
+
* resource is the capped total count (`?include=totalCount`). Endpoints that
|
|
239
|
+
* embed additional resources define their own enum that also lists `totalCount`
|
|
240
|
+
* (e.g. transfers' `memo,token,totalCount`).
|
|
241
|
+
*/
|
|
242
|
+
export declare const totalCountInclude: z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniUnknown>, z.ZodMiniTransform<string[], unknown>>, z.ZodMiniArray<z.ZodMiniEnum<{
|
|
243
|
+
totalCount: "totalCount";
|
|
244
|
+
}>>>;
|
|
245
|
+
/**
|
|
246
|
+
* Response-wide `meta` object for list endpoints whose only embeddable resource
|
|
247
|
+
* is the capped total count. Present only when `include=totalCount` was
|
|
248
|
+
* requested; omitted otherwise. Endpoints that embed additional response-wide
|
|
249
|
+
* resources alongside the count define their own `Meta` that also carries
|
|
250
|
+
* {@link TotalCount}/{@link TotalCountCapped}.
|
|
251
|
+
*/
|
|
252
|
+
export declare const CountMeta: z.ZodMiniObject<{
|
|
253
|
+
totalCountCapped: z.ZodMiniBoolean<boolean>;
|
|
254
|
+
totalCount: z.ZodMiniNumber<number>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
export {};
|
|
257
|
+
//# sourceMappingURL=Schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/internal/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,QAAQ,EAAE,MAAM,IAAI,CAAA;AAEpC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC,WAAW,EACzD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,CAIR;AAYD,qDAAq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