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,285 @@
|
|
|
1
|
+
import { Schema } from 'cadent'
|
|
2
|
+
import { Hex } from 'ox'
|
|
3
|
+
import { zeroHash } from 'viem'
|
|
4
|
+
|
|
5
|
+
import * as TestApp from '../../test/App.js'
|
|
6
|
+
import * as Runtime from '../../test/runtime.js'
|
|
7
|
+
import * as Viem from '../../test/Viem.js'
|
|
8
|
+
import * as Receipts from './receipts.js'
|
|
9
|
+
|
|
10
|
+
/** The decoded `type` names a humanized receipt may report. */
|
|
11
|
+
const transactionTypes = ['legacy', 'eip2930', 'eip1559', 'eip4844', 'eip7702', 'tempo', 'unknown']
|
|
12
|
+
|
|
13
|
+
let transactionHash: Hex.Hex | undefined
|
|
14
|
+
|
|
15
|
+
beforeAll(async () => {
|
|
16
|
+
const runtime = Runtime.get()
|
|
17
|
+
transactionHash =
|
|
18
|
+
runtime.mode === 'localnet'
|
|
19
|
+
? runtime.fixtures!.faucetTransactionHashes[0]
|
|
20
|
+
: await findRecentTransactionHash().catch(() => undefined)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
describe('GET /transactions/:transactionHash/receipt', () => {
|
|
24
|
+
test('humanizes the receipt and keeps the raw RPC under `meta.rpc`', async () => {
|
|
25
|
+
expect(transactionHash).toBeDefined()
|
|
26
|
+
const client = TestApp.client()
|
|
27
|
+
const response = await client.v1.transactions[':transactionHash'].receipt.$get(
|
|
28
|
+
{ param: { transactionHash: transactionHash! }, query: {} },
|
|
29
|
+
TestApp.auth,
|
|
30
|
+
)
|
|
31
|
+
const body = await TestApp.json(response, Receipts.schema.getReceipt.Response)
|
|
32
|
+
expect(response.status).toBe(200)
|
|
33
|
+
expect(response.headers.get('server-timing')?.includes('transaction_receipt;dur=')).toBe(true)
|
|
34
|
+
expect(body.transactionHash).toBe(transactionHash!.toLowerCase())
|
|
35
|
+
expect(body.sender).toMatch(/^0x[0-9a-f]{40}$/)
|
|
36
|
+
// The receipt is humanized: `status` is a decoded name and gas amounts are
|
|
37
|
+
// plain numbers.
|
|
38
|
+
expect(['success', 'reverted']).toContain(body.status)
|
|
39
|
+
expect(transactionTypes).toContain(body.type)
|
|
40
|
+
expect(typeof body.gasUsed).toBe('number')
|
|
41
|
+
expect(Array.isArray(body.logs)).toBe(true)
|
|
42
|
+
// `feeAmount` is the fee charged to the fee payer, derived as
|
|
43
|
+
// ceil(gasUsed * effectiveGasPrice / 1e12), in the fee token base units.
|
|
44
|
+
expect(body.feeAmount).toMatch(/^\d+$/)
|
|
45
|
+
const expectedFee =
|
|
46
|
+
(BigInt(body.gasUsed) * BigInt(body.effectiveGasPrice) + 10n ** 12n - 1n) / 10n ** 12n
|
|
47
|
+
expect(body.feeAmount).toBe(expectedFee.toString())
|
|
48
|
+
// Fee-token metadata is opt-in: the base response must not embed it.
|
|
49
|
+
expect(body.meta.feeToken).toBeUndefined()
|
|
50
|
+
// The verbatim JSON-RPC receipt is always available under `meta.rpc`, where
|
|
51
|
+
// `status` is the raw `0x1`/`0x0` flag and gas values stay hex-encoded.
|
|
52
|
+
expect(['0x0', '0x1']).toContain(body.meta.rpc.status)
|
|
53
|
+
expect(body.meta.rpc.gasUsed).toMatch(/^0x[0-9a-f]+$/)
|
|
54
|
+
|
|
55
|
+
// include=feeToken: resolved metadata is embedded under meta (best-effort).
|
|
56
|
+
const includedResponse = await client.v1.transactions[':transactionHash'].receipt.$get(
|
|
57
|
+
{ param: { transactionHash: transactionHash! }, query: { include: 'feeToken' } },
|
|
58
|
+
TestApp.auth,
|
|
59
|
+
)
|
|
60
|
+
const includedBody = await TestApp.json(includedResponse, Receipts.schema.getReceipt.Response)
|
|
61
|
+
expect(includedResponse.status).toBe(200)
|
|
62
|
+
if (includedBody.feeToken && includedBody.meta?.feeToken) {
|
|
63
|
+
expect(includedBody.meta.feeToken.address).toBe(includedBody.feeToken)
|
|
64
|
+
expect(typeof includedBody.meta.feeToken.symbol).toBe('string')
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('returns 404 for an unknown receipt', async () => {
|
|
69
|
+
const client = TestApp.client()
|
|
70
|
+
const response = await client.v1.transactions[':transactionHash'].receipt.$get(
|
|
71
|
+
{ param: { transactionHash: zeroHash }, query: {} },
|
|
72
|
+
TestApp.auth,
|
|
73
|
+
)
|
|
74
|
+
const body = await TestApp.json(response, Schema.ErrorResponse)
|
|
75
|
+
expect(response.status).toBe(404)
|
|
76
|
+
expect(body.error.code).toBe('receipt_not_found')
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
test('returns 400 for an invalid transaction hash', async () => {
|
|
80
|
+
// The typed client requires `transactionHash: `Hex.Hex`` so a literal
|
|
81
|
+
// non-hash input cannot pass through it; exercise the validator via
|
|
82
|
+
// `app.request` for this negative case.
|
|
83
|
+
const response = await TestApp.create().request('/v1/transactions/not-a-hash/receipt', {
|
|
84
|
+
headers: { authorization: `Bearer ${TestApp.key.token}` },
|
|
85
|
+
})
|
|
86
|
+
const body = await TestApp.json(response, Schema.ErrorResponse)
|
|
87
|
+
expect(response.status).toBe(400)
|
|
88
|
+
expect(body.error.code).toBe('transaction_invalid')
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
describe('GET /transactions/receipts', () => {
|
|
93
|
+
test('returns a humanized receipt page, embedding fee tokens on demand', async () => {
|
|
94
|
+
const client = TestApp.client()
|
|
95
|
+
const response = await client.v1.transactions.receipts.$get(
|
|
96
|
+
{ query: { limit: '5' } },
|
|
97
|
+
TestApp.auth,
|
|
98
|
+
)
|
|
99
|
+
const body = await TestApp.json(response, Receipts.schema.getReceipts.Response)
|
|
100
|
+
expect(response.status).toBe(200)
|
|
101
|
+
expect(response.headers.get('server-timing')?.includes('receipts;dur=')).toBe(true)
|
|
102
|
+
expect(Array.isArray(body.data)).toBe(true)
|
|
103
|
+
// Cursor (keyset) pagination: no `page`, just an opaque `nextCursor`.
|
|
104
|
+
expect('page' in body).toBe(false)
|
|
105
|
+
expect(body.nextCursor === null || typeof body.nextCursor === 'string').toBe(true)
|
|
106
|
+
expect(body.data.length).toBeLessThanOrEqual(5)
|
|
107
|
+
|
|
108
|
+
if (body.data.length > 0) {
|
|
109
|
+
const [receipt] = body.data
|
|
110
|
+
// List rows reuse the detail endpoint's humanized shape: decoded
|
|
111
|
+
// `status`/`type`, decimal gas values, and the verbatim payload under
|
|
112
|
+
// `meta.rpc`. The indexer stores no event logs, so list rows carry none.
|
|
113
|
+
expect(receipt!.transactionHash).toMatch(/^0x[0-9a-f]{64}$/)
|
|
114
|
+
expect(receipt!.sender).toMatch(/^0x[0-9a-f]{40}$/)
|
|
115
|
+
expect(['success', 'reverted']).toContain(receipt!.status)
|
|
116
|
+
expect(transactionTypes).toContain(receipt!.type)
|
|
117
|
+
expect(typeof receipt!.gasUsed).toBe('number')
|
|
118
|
+
expect(receipt!.feeAmount).toMatch(/^\d+$/)
|
|
119
|
+
expect(receipt!.meta.rpc.status).toMatch(/^0x[0-9a-f]+$/)
|
|
120
|
+
// Fee-token metadata is opt-in: the base response must not embed it.
|
|
121
|
+
expect(receipt!.meta.feeToken).toBeUndefined()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const includedResponse = await client.v1.transactions.receipts.$get(
|
|
125
|
+
{ query: { limit: '5', include: 'feeToken' } },
|
|
126
|
+
TestApp.auth,
|
|
127
|
+
)
|
|
128
|
+
const includedBody = await TestApp.json(includedResponse, Receipts.schema.getReceipts.Response)
|
|
129
|
+
expect(includedResponse.status).toBe(200)
|
|
130
|
+
const withFeeToken = includedBody.data.find((receipt) => receipt.meta?.feeToken)
|
|
131
|
+
if (withFeeToken) {
|
|
132
|
+
// When metadata resolves, it must describe the receipt's fee token.
|
|
133
|
+
expect(withFeeToken.meta.feeToken!.address).toBe(withFeeToken.feeToken)
|
|
134
|
+
expect(typeof withFeeToken.meta.feeToken!.symbol).toBe('string')
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
test('returns 400 for an invalid filter address', async () => {
|
|
139
|
+
// The typed client requires `sender: `Hex.Hex`` so an invalid literal
|
|
140
|
+
// cannot pass through it; exercise the validator via `app.request`.
|
|
141
|
+
const response = await TestApp.create().request(
|
|
142
|
+
'/v1/transactions/receipts?sender=not-an-address',
|
|
143
|
+
{
|
|
144
|
+
headers: { authorization: `Bearer ${TestApp.key.token}` },
|
|
145
|
+
},
|
|
146
|
+
)
|
|
147
|
+
const body = await TestApp.json(response, Schema.ErrorResponse)
|
|
148
|
+
expect(response.status).toBe(400)
|
|
149
|
+
expect(body.error.code).toBe('query_invalid')
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
test('rejects the transactions-only include=receipt member', async () => {
|
|
153
|
+
// `receipt` is a transactions-list embed; the receipts endpoints own their
|
|
154
|
+
// own `include` enum (`feeToken` only) and must reject it. The typed client
|
|
155
|
+
// would refuse the literal, so exercise the validator via `app.request`.
|
|
156
|
+
const response = await TestApp.create().request('/v1/transactions/receipts?include=receipt', {
|
|
157
|
+
headers: { authorization: `Bearer ${TestApp.key.token}` },
|
|
158
|
+
})
|
|
159
|
+
const body = await TestApp.json(response, Schema.ErrorResponse)
|
|
160
|
+
expect(response.status).toBe(400)
|
|
161
|
+
expect(body.error.code).toBe('query_invalid')
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
test('narrows receipts by execution status', async () => {
|
|
165
|
+
const client = TestApp.client()
|
|
166
|
+
const response = await client.v1.transactions.receipts.$get(
|
|
167
|
+
{ query: { limit: '10', status: 'success' } },
|
|
168
|
+
TestApp.auth,
|
|
169
|
+
)
|
|
170
|
+
const body = await TestApp.json(response, Receipts.schema.getReceipts.Response)
|
|
171
|
+
expect(response.status).toBe(200)
|
|
172
|
+
for (const receipt of body.data) expect(receipt.status).toBe('success')
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
test('embeds a capped total count on demand via include=totalCount', async () => {
|
|
176
|
+
const client = TestApp.client()
|
|
177
|
+
|
|
178
|
+
// Seed a real account so the count exercises the address-scope `UNION`
|
|
179
|
+
// workaround (`from` branch + `to`-via-`txs` branch).
|
|
180
|
+
const seed = await client.v1.transactions.receipts.$get({ query: { limit: '5' } }, TestApp.auth)
|
|
181
|
+
const seedBody = await TestApp.json(seed, Receipts.schema.getReceipts.Response)
|
|
182
|
+
const account = seedBody.data[0]?.sender
|
|
183
|
+
if (!account) return
|
|
184
|
+
|
|
185
|
+
const response = await client.v1.transactions.receipts.$get(
|
|
186
|
+
{ query: { address: account, include: 'totalCount', limit: '5' } },
|
|
187
|
+
TestApp.auth,
|
|
188
|
+
)
|
|
189
|
+
const body = await TestApp.json(response, Receipts.schema.getReceipts.Response)
|
|
190
|
+
expect(response.status).toBe(200)
|
|
191
|
+
expect(response.headers.get('server-timing')?.includes('receipts_count;dur=')).toBe(true)
|
|
192
|
+
expect(body.meta).toBeDefined()
|
|
193
|
+
expect(Number.isInteger(body.meta?.totalCount)).toBe(true)
|
|
194
|
+
expect(body.meta!.totalCount).toBeGreaterThanOrEqual(body.data.length)
|
|
195
|
+
expect(body.meta!.totalCount).toBeLessThanOrEqual(Schema.countCap)
|
|
196
|
+
expect(body.meta!.totalCountCapped).toBe(body.meta!.totalCount >= Schema.countCap)
|
|
197
|
+
|
|
198
|
+
// Without `include=totalCount`, the same page omits `meta` and the count.
|
|
199
|
+
const bare = await client.v1.transactions.receipts.$get(
|
|
200
|
+
{ query: { address: account, limit: '5' } },
|
|
201
|
+
TestApp.auth,
|
|
202
|
+
)
|
|
203
|
+
const bareBody = await TestApp.json(bare, Receipts.schema.getReceipts.Response)
|
|
204
|
+
expect(bare.status).toBe(200)
|
|
205
|
+
expect(bareBody.meta).toBeUndefined()
|
|
206
|
+
})
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
// Walk back from the chain head to find a recent mined transaction hash. This
|
|
210
|
+
// keeps the fixture stable across runs without hard-coding a hash that the
|
|
211
|
+
// testnet might prune.
|
|
212
|
+
async function findRecentTransactionHash() {
|
|
213
|
+
const client = Viem.getClient()
|
|
214
|
+
const latest = await client.getBlockNumber()
|
|
215
|
+
for (let n = latest; n > latest - 40n && n >= 0n; n--) {
|
|
216
|
+
const block = await client.getBlock({ blockNumber: n, includeTransactions: true })
|
|
217
|
+
const hash = block.transactions[0]?.hash
|
|
218
|
+
if (hash) return hash
|
|
219
|
+
}
|
|
220
|
+
return undefined
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
describe('GET /transactions/receipts?address=…', () => {
|
|
224
|
+
test('returns receipts involving an address', async () => {
|
|
225
|
+
const client = TestApp.client()
|
|
226
|
+
// Seed a real sender from the global receipt feed.
|
|
227
|
+
const seedResponse = await client.v1.transactions.receipts.$get(
|
|
228
|
+
{ query: { limit: '5' } },
|
|
229
|
+
TestApp.auth,
|
|
230
|
+
)
|
|
231
|
+
const seed = await TestApp.json(seedResponse, Receipts.schema.getReceipts.Response)
|
|
232
|
+
expect(seedResponse.status).toBe(200)
|
|
233
|
+
const account = seed.data[0]!.sender
|
|
234
|
+
expect(account).toMatch(/^0x[0-9a-f]{40}$/)
|
|
235
|
+
|
|
236
|
+
const baseResponse = await client.v1.transactions.receipts.$get(
|
|
237
|
+
{ query: { address: account, limit: '5' } },
|
|
238
|
+
TestApp.auth,
|
|
239
|
+
)
|
|
240
|
+
const base = await TestApp.json(baseResponse, Receipts.schema.getReceipts.Response)
|
|
241
|
+
|
|
242
|
+
expect(baseResponse.status).toBe(200)
|
|
243
|
+
expect(baseResponse.headers.get('server-timing')?.includes('receipts;dur=')).toBe(true)
|
|
244
|
+
expect(Array.isArray(base.data)).toBe(true)
|
|
245
|
+
expect(base.data.length).toBeLessThanOrEqual(5)
|
|
246
|
+
expect('page' in base).toBe(false)
|
|
247
|
+
expect(base.nextCursor === null || typeof base.nextCursor === 'string').toBe(true)
|
|
248
|
+
// Each item is the humanized receipt shape with a decoded `status` and the
|
|
249
|
+
// verbatim RPC payload under `meta.rpc`.
|
|
250
|
+
expect(
|
|
251
|
+
base.data.every(
|
|
252
|
+
(entry) =>
|
|
253
|
+
/^0x[0-9a-f]{64}$/.test(entry.transactionHash) &&
|
|
254
|
+
/^0x[0-9a-f]{40}$/.test(entry.sender) &&
|
|
255
|
+
(entry.recipient === null || /^0x[0-9a-f]{40}$/.test(entry.recipient)) &&
|
|
256
|
+
['success', 'reverted'].includes(entry.status) &&
|
|
257
|
+
typeof entry.meta.rpc === 'object',
|
|
258
|
+
),
|
|
259
|
+
).toBe(true)
|
|
260
|
+
// Every row touches the subject address on one side or the other.
|
|
261
|
+
expect(
|
|
262
|
+
base.data.every((entry) => entry.sender === account || entry.recipient === account),
|
|
263
|
+
).toBe(true)
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
test('narrows receipts by execution status', async () => {
|
|
267
|
+
const client = TestApp.client()
|
|
268
|
+
const seedResponse = await client.v1.transactions.receipts.$get(
|
|
269
|
+
{ query: { limit: '5' } },
|
|
270
|
+
TestApp.auth,
|
|
271
|
+
)
|
|
272
|
+
const seed = await TestApp.json(seedResponse, Receipts.schema.getReceipts.Response)
|
|
273
|
+
expect(seedResponse.status).toBe(200)
|
|
274
|
+
const account = seed.data[0]!.sender
|
|
275
|
+
expect(account).toMatch(/^0x[0-9a-f]{40}$/)
|
|
276
|
+
|
|
277
|
+
const response = await client.v1.transactions.receipts.$get(
|
|
278
|
+
{ query: { address: account, limit: '5', status: 'success' } },
|
|
279
|
+
TestApp.auth,
|
|
280
|
+
)
|
|
281
|
+
const body = await TestApp.json(response, Receipts.schema.getReceipts.Response)
|
|
282
|
+
expect(response.status).toBe(200)
|
|
283
|
+
for (const receipt of body.data) expect(receipt.status).toBe('success')
|
|
284
|
+
})
|
|
285
|
+
})
|