tapimo 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -16
- package/dist/ApiKey.d.ts +4 -1
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +6 -2
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +98 -3
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +150 -1
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +7917 -2315
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +141 -329
- package/dist/App.js.map +1 -1
- package/dist/Scope.d.ts +20 -4
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +23 -4
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +2 -2
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +2 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +203 -120
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +111 -6
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +67 -0
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +12 -1
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/scopes.js +3 -0
- package/dist/admin/apps/scopes.js.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +116 -116
- package/dist/admin/apps/verified-tokens.js +1 -1
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +13 -13
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/analytics/Analytics.d.ts +151 -0
- package/dist/analytics/Analytics.d.ts.map +1 -0
- package/dist/analytics/Analytics.js +212 -0
- package/dist/analytics/Analytics.js.map +1 -0
- package/dist/analytics/tables/requestEvents.d.ts +215 -0
- package/dist/analytics/tables/requestEvents.d.ts.map +1 -0
- package/dist/analytics/tables/requestEvents.js +264 -0
- package/dist/analytics/tables/requestEvents.js.map +1 -0
- package/dist/apps/data/App.d.ts +19576 -0
- package/dist/apps/data/App.d.ts.map +1 -0
- package/dist/apps/data/App.js +272 -0
- package/dist/apps/data/App.js.map +1 -0
- package/dist/apps/data/index.d.ts +3 -0
- package/dist/apps/data/index.d.ts.map +1 -0
- package/dist/apps/data/index.js +3 -0
- package/dist/apps/data/index.js.map +1 -0
- package/dist/apps/{activities.d.ts → data/routes/activities.d.ts} +32 -32
- package/dist/apps/{activities.d.ts.map → data/routes/activities.d.ts.map} +1 -1
- package/dist/apps/{activities.js → data/routes/activities.js} +13 -13
- package/dist/apps/data/routes/activities.js.map +1 -0
- package/dist/apps/{addresses.d.ts → data/routes/addresses.d.ts} +22 -22
- package/dist/apps/{addresses.d.ts.map → data/routes/addresses.d.ts.map} +1 -1
- package/dist/apps/{addresses.js → data/routes/addresses.js} +5 -5
- package/dist/apps/data/routes/addresses.js.map +1 -0
- package/dist/apps/{balances.d.ts → data/routes/balances.d.ts} +4 -4
- package/dist/apps/data/routes/balances.d.ts.map +1 -0
- package/dist/apps/{balances.js → data/routes/balances.js} +42 -11
- package/dist/apps/data/routes/balances.js.map +1 -0
- package/dist/apps/{blocks.d.ts → data/routes/blocks.d.ts} +47 -47
- package/dist/apps/data/routes/blocks.d.ts.map +1 -0
- package/dist/apps/{blocks.js → data/routes/blocks.js} +13 -13
- package/dist/apps/data/routes/blocks.js.map +1 -0
- package/dist/apps/{coingecko.d.ts → data/routes/coingecko.d.ts} +8 -8
- package/dist/apps/data/routes/coingecko.d.ts.map +1 -0
- package/dist/apps/{coingecko.js → data/routes/coingecko.js} +13 -13
- package/dist/apps/data/routes/coingecko.js.map +1 -0
- package/dist/apps/{exchanges.d.ts → data/routes/exchanges.d.ts} +108 -108
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -0
- package/dist/apps/{exchanges.js → data/routes/exchanges.js} +19 -19
- package/dist/apps/data/routes/exchanges.js.map +1 -0
- package/dist/apps/{fee-amm.d.ts → data/routes/fee-amm.d.ts} +39 -39
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -0
- package/dist/apps/{fee-amm.js → data/routes/fee-amm.js} +17 -17
- package/dist/apps/data/routes/fee-amm.js.map +1 -0
- package/dist/apps/data/routes/funding.d.ts +765 -0
- package/dist/apps/data/routes/funding.d.ts.map +1 -0
- package/dist/apps/data/routes/funding.js +383 -0
- package/dist/apps/data/routes/funding.js.map +1 -0
- package/dist/apps/{indexer.d.ts → data/routes/indexer.d.ts} +4 -4
- package/dist/apps/data/routes/indexer.d.ts.map +1 -0
- package/dist/apps/{indexer.js → data/routes/indexer.js} +13 -9
- package/dist/apps/data/routes/indexer.js.map +1 -0
- package/dist/apps/{receipts.d.ts → data/routes/receipts.d.ts} +49 -49
- package/dist/apps/data/routes/receipts.d.ts.map +1 -0
- package/dist/apps/{receipts.js → data/routes/receipts.js} +14 -20
- package/dist/apps/data/routes/receipts.js.map +1 -0
- package/dist/apps/{rpc.d.ts → data/routes/rpc.d.ts} +33 -40
- package/dist/apps/data/routes/rpc.d.ts.map +1 -0
- package/dist/apps/{rpc.js → data/routes/rpc.js} +35 -7
- package/dist/apps/data/routes/rpc.js.map +1 -0
- package/dist/apps/{tokenlist.d.ts → data/routes/tokenlist.d.ts} +40 -40
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -0
- package/dist/apps/{tokenlist.js → data/routes/tokenlist.js} +8 -8
- package/dist/apps/data/routes/tokenlist.js.map +1 -0
- package/dist/apps/{tokens.d.ts → data/routes/tokens.d.ts} +468 -468
- package/dist/apps/data/routes/tokens.d.ts.map +1 -0
- package/dist/apps/{tokens.js → data/routes/tokens.js} +19 -19
- package/dist/apps/data/routes/tokens.js.map +1 -0
- package/dist/apps/{transactions.d.ts → data/routes/transactions.d.ts} +304 -304
- package/dist/apps/data/routes/transactions.d.ts.map +1 -0
- package/dist/apps/{transactions.js → data/routes/transactions.js} +13 -13
- package/dist/apps/data/routes/transactions.js.map +1 -0
- package/dist/apps/{transfers.d.ts → data/routes/transfers.d.ts} +62 -62
- package/dist/apps/data/routes/transfers.d.ts.map +1 -0
- package/dist/apps/{transfers.js → data/routes/transfers.js} +13 -13
- package/dist/apps/data/routes/transfers.js.map +1 -0
- package/dist/apps/{verified-tokens.d.ts → data/routes/verified-tokens.d.ts} +6 -6
- package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -0
- package/dist/apps/{verified-tokens.js → data/routes/verified-tokens.js} +9 -9
- package/dist/apps/data/routes/verified-tokens.js.map +1 -0
- package/dist/apps/{webhooks.d.ts → data/routes/webhooks.d.ts} +17 -17
- package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
- package/dist/apps/{webhooks.js → data/routes/webhooks.js} +38 -34
- package/dist/apps/data/routes/webhooks.js.map +1 -0
- package/dist/apps/docs/App.d.ts +29 -0
- package/dist/apps/docs/App.d.ts.map +1 -0
- package/dist/apps/docs/App.js +54 -0
- package/dist/apps/docs/App.js.map +1 -0
- package/dist/{internal/OpenApi.fonts.d.ts → apps/docs/fonts.d.ts} +1 -1
- package/dist/apps/docs/fonts.d.ts.map +1 -0
- package/dist/{internal/OpenApi.fonts.js → apps/docs/fonts.js} +1 -1
- package/dist/apps/docs/fonts.js.map +1 -0
- package/dist/apps/docs/index.d.ts +2 -0
- package/dist/apps/docs/index.d.ts.map +1 -0
- package/dist/apps/docs/index.js +2 -0
- package/dist/apps/docs/index.js.map +1 -0
- package/dist/{internal/OpenApi.logo.d.ts → apps/docs/logo.d.ts} +1 -1
- package/dist/apps/docs/logo.d.ts.map +1 -0
- package/dist/{internal/OpenApi.logo.js → apps/docs/logo.js} +1 -1
- package/dist/apps/docs/logo.js.map +1 -0
- package/dist/apps/docs/reference.d.ts +21 -0
- package/dist/apps/docs/reference.d.ts.map +1 -0
- package/dist/apps/docs/reference.js +112 -0
- package/dist/apps/docs/reference.js.map +1 -0
- package/dist/apps/index.d.ts +5 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +5 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/mcp.d.ts +76 -0
- package/dist/apps/mcp.d.ts.map +1 -0
- package/dist/apps/mcp.js +188 -0
- package/dist/apps/mcp.js.map +1 -0
- package/dist/apps/metadata.d.ts +7 -0
- package/dist/apps/metadata.d.ts.map +1 -0
- package/dist/apps/metadata.js +15 -0
- package/dist/apps/metadata.js.map +1 -0
- package/dist/apps/platform/App.d.ts +5262 -0
- package/dist/apps/platform/App.d.ts.map +1 -0
- package/dist/apps/platform/App.js +84 -0
- package/dist/apps/platform/App.js.map +1 -0
- package/dist/apps/platform/Billing.d.ts +279 -0
- package/dist/apps/platform/Billing.d.ts.map +1 -0
- package/dist/apps/platform/Billing.js +477 -0
- package/dist/apps/platform/Billing.js.map +1 -0
- package/dist/apps/platform/index.d.ts +3 -0
- package/dist/apps/platform/index.d.ts.map +1 -0
- package/dist/apps/platform/index.js +3 -0
- package/dist/apps/platform/index.js.map +1 -0
- package/dist/apps/platform/routes/api-keys.d.ts +973 -0
- package/dist/apps/platform/routes/api-keys.d.ts.map +1 -0
- package/dist/apps/platform/routes/api-keys.js +430 -0
- package/dist/apps/platform/routes/api-keys.js.map +1 -0
- package/dist/apps/platform/routes/billing.d.ts +1520 -0
- package/dist/apps/platform/routes/billing.d.ts.map +1 -0
- package/dist/apps/platform/routes/billing.js +795 -0
- package/dist/apps/platform/routes/billing.js.map +1 -0
- package/dist/apps/platform/routes/invitations.d.ts +851 -0
- package/dist/apps/platform/routes/invitations.d.ts.map +1 -0
- package/dist/apps/platform/routes/invitations.js +471 -0
- package/dist/apps/platform/routes/invitations.js.map +1 -0
- package/dist/apps/platform/routes/me.d.ts +95 -0
- package/dist/apps/platform/routes/me.d.ts.map +1 -0
- package/dist/apps/platform/routes/me.js +81 -0
- package/dist/apps/platform/routes/me.js.map +1 -0
- package/dist/apps/platform/routes/members.d.ts +554 -0
- package/dist/apps/platform/routes/members.d.ts.map +1 -0
- package/dist/apps/platform/routes/members.js +251 -0
- package/dist/apps/platform/routes/members.js.map +1 -0
- package/dist/apps/platform/routes/orgs.d.ts +596 -0
- package/dist/apps/platform/routes/orgs.d.ts.map +1 -0
- package/dist/apps/platform/routes/orgs.js +276 -0
- package/dist/apps/platform/routes/orgs.js.map +1 -0
- package/dist/apps/platform/routes/projects.d.ts +740 -0
- package/dist/apps/platform/routes/projects.d.ts.map +1 -0
- package/dist/apps/platform/routes/projects.js +286 -0
- package/dist/apps/platform/routes/projects.js.map +1 -0
- package/dist/apps/platform/routes/scopes.d.ts +107 -0
- package/dist/apps/platform/routes/scopes.d.ts.map +1 -0
- package/dist/apps/platform/routes/scopes.js +66 -0
- package/dist/apps/platform/routes/scopes.js.map +1 -0
- package/dist/apps/platform/routes/usage.d.ts +588 -0
- package/dist/apps/platform/routes/usage.d.ts.map +1 -0
- package/dist/apps/platform/routes/usage.js +391 -0
- package/dist/apps/platform/routes/usage.js.map +1 -0
- package/dist/apps/relay/App.d.ts +44 -0
- package/dist/apps/relay/App.d.ts.map +1 -0
- package/dist/apps/relay/App.js +211 -0
- package/dist/apps/relay/App.js.map +1 -0
- package/dist/apps/relay/Sponsorships.d.ts +107 -0
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -0
- package/dist/apps/relay/Sponsorships.js +194 -0
- package/dist/apps/relay/Sponsorships.js.map +1 -0
- package/dist/apps/relay/index.d.ts +3 -0
- package/dist/apps/relay/index.d.ts.map +1 -0
- package/dist/apps/relay/index.js +3 -0
- package/dist/apps/relay/index.js.map +1 -0
- package/dist/cli/Cli.d.ts +9 -2
- package/dist/cli/Cli.d.ts.map +1 -1
- package/dist/cli/Cli.js +12 -4
- package/dist/cli/Cli.js.map +1 -1
- package/dist/cli/commands/admin.d.ts +5 -1
- package/dist/cli/commands/admin.d.ts.map +1 -1
- package/dist/cli/commands/admin.js +82 -3
- package/dist/cli/commands/admin.js.map +1 -1
- package/dist/db/Db.d.ts +17 -0
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +254 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +159 -0
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +187 -2
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/billingSettings.d.ts +55 -0
- package/dist/db/tables/billingSettings.d.ts.map +1 -0
- package/dist/db/tables/billingSettings.js +70 -0
- package/dist/db/tables/billingSettings.js.map +1 -0
- package/dist/db/tables/invitations.d.ts +84 -0
- package/dist/db/tables/invitations.d.ts.map +1 -0
- package/dist/db/tables/invitations.js +165 -0
- package/dist/db/tables/invitations.js.map +1 -0
- package/dist/db/tables/memberships.d.ts +108 -0
- package/dist/db/tables/memberships.d.ts.map +1 -0
- package/dist/db/tables/memberships.js +153 -0
- package/dist/db/tables/memberships.js.map +1 -0
- package/dist/db/tables/organizations.d.ts +48 -0
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +97 -2
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +65 -0
- package/dist/db/tables/projects.d.ts.map +1 -0
- package/dist/db/tables/projects.js +75 -0
- package/dist/db/tables/projects.js.map +1 -0
- package/dist/db/tables/requestUsage.d.ts +121 -0
- package/dist/db/tables/requestUsage.d.ts.map +1 -0
- package/dist/db/tables/requestUsage.js +150 -0
- package/dist/db/tables/requestUsage.js.map +1 -0
- package/dist/db/tables/sponsoredTransactions.d.ts +239 -0
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -0
- package/dist/db/tables/sponsoredTransactions.js +314 -0
- package/dist/db/tables/sponsoredTransactions.js.map +1 -0
- package/dist/db/tables/stripeCustomers.d.ts +81 -0
- package/dist/db/tables/stripeCustomers.d.ts.map +1 -0
- package/dist/db/tables/stripeCustomers.js +120 -0
- package/dist/db/tables/stripeCustomers.js.map +1 -0
- package/dist/db/tables/users.d.ts +48 -0
- package/dist/db/tables/users.d.ts.map +1 -0
- package/dist/db/tables/users.js +65 -0
- package/dist/db/tables/users.js.map +1 -0
- package/dist/handlers/internal/executionError.d.ts.map +1 -1
- package/dist/handlers/internal/executionError.js +2 -0
- package/dist/handlers/internal/executionError.js.map +1 -1
- package/dist/handlers/internal/multisig.d.ts +2 -6
- package/dist/handlers/internal/multisig.d.ts.map +1 -1
- package/dist/handlers/internal/multisig.js +11 -36
- package/dist/handlers/internal/multisig.js.map +1 -1
- package/dist/handlers/internal/sponsorship.d.ts +35 -2
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
- package/dist/handlers/internal/sponsorship.js +53 -14
- package/dist/handlers/internal/sponsorship.js.map +1 -1
- package/dist/handlers/internal/utils.d.ts +10 -3
- package/dist/handlers/internal/utils.d.ts.map +1 -1
- package/dist/handlers/internal/utils.js +14 -6
- package/dist/handlers/internal/utils.js.map +1 -1
- package/dist/handlers/relay.d.ts +6 -2
- package/dist/handlers/relay.d.ts.map +1 -1
- package/dist/handlers/relay.js +16 -2
- package/dist/handlers/relay.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/Auth.d.ts +222 -6
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +625 -74
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Cache.d.ts.map +1 -1
- package/dist/internal/Cache.js +4 -1
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/EdgeCache.d.ts +10 -0
- package/dist/internal/EdgeCache.d.ts.map +1 -1
- package/dist/internal/EdgeCache.js +39 -8
- package/dist/internal/EdgeCache.js.map +1 -1
- package/dist/internal/Fees.d.ts +27 -0
- package/dist/internal/Fees.d.ts.map +1 -0
- package/dist/internal/Fees.js +48 -0
- package/dist/internal/Fees.js.map +1 -0
- package/dist/internal/FundingRoutes.d.ts +183 -0
- package/dist/internal/FundingRoutes.d.ts.map +1 -0
- package/dist/internal/FundingRoutes.js +490 -0
- package/dist/internal/FundingRoutes.js.map +1 -0
- package/dist/internal/Id.d.ts +15 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +22 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/Log.d.ts +9 -3
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +7 -0
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +10 -20
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +8 -58
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/RateLimit.d.ts +25 -0
- package/dist/internal/RateLimit.d.ts.map +1 -1
- package/dist/internal/RateLimit.js +51 -0
- package/dist/internal/RateLimit.js.map +1 -1
- package/dist/internal/Response.d.ts +1 -1
- package/dist/internal/Response.d.ts.map +1 -1
- package/dist/internal/Schema.d.ts +8 -0
- package/dist/internal/Schema.d.ts.map +1 -1
- package/dist/internal/Schema.js +7 -0
- package/dist/internal/Schema.js.map +1 -1
- package/dist/internal/Store.d.ts +7 -1
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +16 -2
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Viem.d.ts +84 -0
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Webhooks.d.ts +1 -1
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +3 -3
- package/dist/internal/Webhooks.js.map +1 -1
- package/package.json +33 -6
- package/src/ApiKey.ts +10 -2
- package/src/ApiKeys.test.ts +155 -1
- package/src/ApiKeys.ts +203 -1
- package/src/App.test.ts +64 -75741
- package/src/App.ts +218 -420
- package/src/Client.test-d.ts +657 -15
- package/src/Scope.ts +26 -4
- package/src/Webhooks.ts +2 -2
- package/src/admin/apps/api-keys.test.ts +51 -0
- package/src/admin/apps/api-keys.ts +84 -0
- package/src/admin/apps/scopes.test.ts +11 -1
- package/src/admin/apps/scopes.ts +3 -0
- package/src/admin/apps/verified-tokens.ts +1 -1
- package/src/admin/ui/src/components/Page.tsx +2 -3
- package/src/admin/ui/src/routes/__root.tsx +2 -2
- package/src/admin/ui/src/routes/api-keys.tsx +2 -2
- package/src/admin/ui.generated.ts +13 -13
- package/src/analytics/Analytics.test.ts +527 -0
- package/src/analytics/Analytics.ts +318 -0
- package/src/analytics/tables/requestEvents.ts +523 -0
- package/src/apps/composition.test.ts +66 -0
- package/src/apps/data/App.test.ts +72 -0
- package/src/apps/data/App.ts +330 -0
- package/src/apps/data/index.ts +2 -0
- package/src/apps/{activities.test.ts → data/routes/activities.test.ts} +3 -3
- package/src/apps/{activities.ts → data/routes/activities.ts} +15 -15
- package/src/apps/{addresses.ts → data/routes/addresses.ts} +6 -6
- package/src/apps/{balances.test.ts → data/routes/balances.test.ts} +2 -2
- package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
- package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +3 -3
- package/src/apps/{blocks.ts → data/routes/blocks.ts} +14 -14
- package/src/apps/{coingecko.test.ts → data/routes/coingecko.test.ts} +2 -2
- package/src/apps/{coingecko.ts → data/routes/coingecko.ts} +14 -14
- package/src/apps/{exchanges.test.ts → data/routes/exchanges.test.ts} +1 -1
- package/src/apps/{exchanges.ts → data/routes/exchanges.ts} +20 -20
- package/src/apps/{fee-amm.test.ts → data/routes/fee-amm.test.ts} +3 -3
- package/src/apps/{fee-amm.ts → data/routes/fee-amm.ts} +18 -18
- package/src/apps/data/routes/funding.test.ts +214 -0
- package/src/apps/data/routes/funding.ts +584 -0
- package/src/apps/{indexer.test.ts → data/routes/indexer.test.ts} +26 -5
- package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
- package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +3 -3
- package/src/apps/{receipts.ts → data/routes/receipts.ts} +15 -22
- package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +122 -7
- package/src/apps/{rpc.ts → data/routes/rpc.ts} +38 -8
- package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +3 -3
- package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
- package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +2 -2
- package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
- package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +3 -3
- package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
- package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +2 -2
- package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
- package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +3 -3
- package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
- package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +7 -7
- package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +50 -43
- package/src/apps/docs/App.ts +65 -0
- package/src/apps/docs/index.ts +1 -0
- package/src/apps/docs/reference.ts +132 -0
- package/src/apps/index.ts +4 -0
- package/src/apps/mcp.test.ts +206 -0
- package/src/apps/mcp.ts +250 -0
- package/src/apps/metadata.ts +23 -0
- package/src/apps/platform/App.ts +169 -0
- package/src/apps/platform/Billing.test.ts +530 -0
- package/src/apps/platform/Billing.ts +682 -0
- package/src/apps/platform/index.ts +2 -0
- package/src/apps/platform/routes/api-keys.test.ts +493 -0
- package/src/apps/platform/routes/api-keys.ts +543 -0
- package/src/apps/platform/routes/billing.test.ts +1100 -0
- package/src/apps/platform/routes/billing.ts +966 -0
- package/src/apps/platform/routes/invitations.test.ts +409 -0
- package/src/apps/platform/routes/invitations.ts +587 -0
- package/src/apps/platform/routes/me.test.ts +351 -0
- package/src/apps/platform/routes/me.ts +106 -0
- package/src/apps/platform/routes/members.test.ts +195 -0
- package/src/apps/platform/routes/members.ts +313 -0
- package/src/apps/platform/routes/orgs.test.ts +313 -0
- package/src/apps/platform/routes/orgs.ts +365 -0
- package/src/apps/platform/routes/projects.test.ts +181 -0
- package/src/apps/platform/routes/projects.ts +367 -0
- package/src/apps/platform/routes/scopes.test.ts +29 -0
- package/src/apps/platform/routes/scopes.ts +85 -0
- package/src/apps/platform/routes/usage.test.ts +422 -0
- package/src/apps/platform/routes/usage.ts +527 -0
- package/src/apps/relay/App.test.ts +933 -0
- package/src/apps/relay/App.ts +236 -0
- package/src/apps/relay/Sponsorships.test.ts +375 -0
- package/src/apps/relay/Sponsorships.ts +306 -0
- package/src/apps/relay/index.ts +2 -0
- package/src/cli/Cli.test.ts +25 -2
- package/src/cli/Cli.ts +18 -3
- package/src/cli/commands/admin.test.ts +83 -0
- package/src/cli/commands/admin.ts +91 -3
- package/src/db/Db.ts +296 -0
- package/src/db/Schema.ts +241 -2
- package/src/db/tables/billingSettings.test.ts +87 -0
- package/src/db/tables/billingSettings.ts +108 -0
- package/src/db/tables/invitations.ts +198 -0
- package/src/db/tables/memberships.ts +208 -0
- package/src/db/tables/organizations.test.ts +38 -2
- package/src/db/tables/organizations.ts +117 -2
- package/src/db/tables/projects.ts +107 -0
- package/src/db/tables/requestUsage.ts +231 -0
- package/src/db/tables/sponsoredTransactions.test.ts +325 -0
- package/src/db/tables/sponsoredTransactions.ts +464 -0
- package/src/db/tables/stripeCustomers.test.ts +109 -0
- package/src/db/tables/stripeCustomers.ts +162 -0
- package/src/db/tables/users.ts +85 -0
- package/src/handlers/internal/executionError.ts +2 -0
- package/src/handlers/internal/multisig.test.ts +84 -10
- package/src/handlers/internal/multisig.ts +15 -50
- package/src/handlers/internal/sponsorship.ts +106 -20
- package/src/handlers/internal/utils.ts +19 -7
- package/src/handlers/{internal/relay.localnet.test.ts → relay.test.ts} +2 -2
- package/src/handlers/relay.ts +23 -5
- package/src/index.ts +1 -0
- package/src/internal/Auth.test.ts +491 -25
- package/src/internal/Auth.ts +839 -84
- package/src/internal/Cache.ts +5 -1
- package/src/internal/Cursor.test.ts +3 -2
- package/src/internal/EdgeCache.test.ts +27 -4
- package/src/internal/EdgeCache.ts +47 -9
- package/src/internal/Fees.test.ts +32 -0
- package/src/internal/Fees.ts +51 -0
- package/src/internal/FundingRoutes.ts +583 -0
- package/src/internal/Id.test.ts +17 -0
- package/src/internal/Id.ts +24 -0
- package/src/internal/Log.test.ts +2 -1
- package/src/internal/Log.ts +16 -3
- package/src/internal/MetricSink.ts +1 -1
- package/src/internal/OpenApi.ts +12 -60
- package/src/internal/RateLimit.test.ts +84 -0
- package/src/internal/RateLimit.ts +70 -0
- package/src/internal/Response.ts +1 -1
- package/src/internal/Schema.ts +8 -0
- package/src/internal/Store.test.ts +52 -0
- package/src/internal/Store.ts +24 -5
- package/src/internal/Tidx.local.test.ts +1 -1
- package/src/internal/VerifiedTokens.test.ts +1 -1
- package/src/internal/WebhookDestination.test.ts +1 -1
- package/src/internal/Webhooks.test.ts +7 -7
- package/src/internal/Webhooks.ts +4 -4
- package/dist/apps/activities.js.map +0 -1
- package/dist/apps/addresses.js.map +0 -1
- package/dist/apps/balances.d.ts.map +0 -1
- package/dist/apps/balances.js.map +0 -1
- package/dist/apps/blocks.d.ts.map +0 -1
- package/dist/apps/blocks.js.map +0 -1
- package/dist/apps/coingecko.d.ts.map +0 -1
- package/dist/apps/coingecko.js.map +0 -1
- package/dist/apps/exchanges.d.ts.map +0 -1
- package/dist/apps/exchanges.js.map +0 -1
- package/dist/apps/fee-amm.d.ts.map +0 -1
- package/dist/apps/fee-amm.js.map +0 -1
- package/dist/apps/indexer.d.ts.map +0 -1
- package/dist/apps/indexer.js.map +0 -1
- package/dist/apps/receipts.d.ts.map +0 -1
- package/dist/apps/receipts.js.map +0 -1
- package/dist/apps/rpc.d.ts.map +0 -1
- package/dist/apps/rpc.js.map +0 -1
- package/dist/apps/tokenlist.d.ts.map +0 -1
- package/dist/apps/tokenlist.js.map +0 -1
- package/dist/apps/tokens.d.ts.map +0 -1
- package/dist/apps/tokens.js.map +0 -1
- package/dist/apps/transactions.d.ts.map +0 -1
- package/dist/apps/transactions.js.map +0 -1
- package/dist/apps/transfers.d.ts.map +0 -1
- package/dist/apps/transfers.js.map +0 -1
- package/dist/apps/verified-tokens.d.ts.map +0 -1
- package/dist/apps/verified-tokens.js.map +0 -1
- package/dist/apps/webhooks.js.map +0 -1
- package/dist/internal/OpenApi.fonts.d.ts.map +0 -1
- package/dist/internal/OpenApi.fonts.js.map +0 -1
- package/dist/internal/OpenApi.logo.d.ts.map +0 -1
- package/dist/internal/OpenApi.logo.js.map +0 -1
- package/src/handlers/internal/multisig.localnet.test.ts +0 -146
- /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
- /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
|
@@ -2,17 +2,18 @@ import { Hono, type Context } from 'hono'
|
|
|
2
2
|
import { Hex } from 'ox'
|
|
3
3
|
import * as z from 'zod/mini'
|
|
4
4
|
|
|
5
|
-
import type * as App from '
|
|
6
|
-
import * as Auth from '
|
|
7
|
-
import * as Cache from '
|
|
8
|
-
import * as Cursor from '
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
5
|
+
import type * as App from '../../../App.js'
|
|
6
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
7
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
8
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
9
|
+
import * as Fees from '../../../internal/Fees.js'
|
|
10
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
11
|
+
import * as Response from '../../../internal/Response.js'
|
|
12
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
13
|
+
import * as Store from '../../../internal/Store.js'
|
|
14
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
15
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
16
|
+
import * as Value from '../../../internal/Value.js'
|
|
16
17
|
import * as Tokens from './tokens.js'
|
|
17
18
|
|
|
18
19
|
// Receipts and transactions deliberately form an import cycle (receipts reuses
|
|
@@ -25,13 +26,6 @@ import { decodeTransactionType, embedFeeTokens, schema as txSchema } from './tra
|
|
|
25
26
|
/** Example transaction hash surfaced in OpenAPI docs. */
|
|
26
27
|
const exampleHash = '0x515801d7f9a5ac705e793e85904c9c69b3f1694b465cc8fb6ba3f0298dc82665'
|
|
27
28
|
|
|
28
|
-
// Tempo gas prices are denominated in attodollars (10^-18 USD) while fee-token
|
|
29
|
-
// balances use 6 decimals (microdollars, 10^-6 USD), so the fee charged to the
|
|
30
|
-
// fee payer — in the fee token's base units — is
|
|
31
|
-
// `ceil(gasUsed * effectiveGasPrice / 10^12)` (ceiling division). Mirrors
|
|
32
|
-
// `calc_gas_balance_spending` in tempoxyz/tempo.
|
|
33
|
-
const feeScalingFactor = 10n ** 12n
|
|
34
|
-
|
|
35
29
|
/**
|
|
36
30
|
* Computes the fee charged to the fee payer, in the fee token's base units, from
|
|
37
31
|
* the receipt's `gasUsed` and decimal `effectiveGasPrice`. Returns undefined
|
|
@@ -39,8 +33,7 @@ const feeScalingFactor = 10n ** 12n
|
|
|
39
33
|
*/
|
|
40
34
|
function computeFeeAmount(gasUsed: number | undefined, effectiveGasPrice: string | undefined) {
|
|
41
35
|
if (gasUsed === undefined || effectiveGasPrice === undefined) return undefined
|
|
42
|
-
|
|
43
|
-
return ((product + feeScalingFactor - 1n) / feeScalingFactor).toString()
|
|
36
|
+
return Fees.fromGas(BigInt(gasUsed), BigInt(effectiveGasPrice)).toString()
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
/** Zod schemas owned by the receipt handlers. */
|
|
@@ -455,7 +448,7 @@ export namespace schema {
|
|
|
455
448
|
export function receipts() {
|
|
456
449
|
return new Hono<App.Environment>()
|
|
457
450
|
.get(
|
|
458
|
-
'/receipts',
|
|
451
|
+
'/v1/transactions/receipts',
|
|
459
452
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
460
453
|
OpenApi.validate('query', schema.getReceipts.Query, {
|
|
461
454
|
code: 'query_invalid',
|
|
@@ -548,7 +541,7 @@ export function receipts() {
|
|
|
548
541
|
},
|
|
549
542
|
)
|
|
550
543
|
.get(
|
|
551
|
-
'/:transactionHash/receipt',
|
|
544
|
+
'/v1/transactions/:transactionHash/receipt',
|
|
552
545
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
553
546
|
OpenApi.validate('param', schema.getReceipt.Params, {
|
|
554
547
|
code: 'transaction_invalid',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as Viem from '
|
|
2
|
-
import * as TestApp from '
|
|
3
|
-
import * as Runtime from '
|
|
1
|
+
import type * as Viem from '../../../internal/Viem.js'
|
|
2
|
+
import * as TestApp from '../../../../test/App.js'
|
|
3
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
4
4
|
|
|
5
5
|
const runtime = Runtime.get()
|
|
6
6
|
|
|
@@ -96,7 +96,7 @@ describe('POST /rpc', () => {
|
|
|
96
96
|
}
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
test('
|
|
99
|
+
test('allows eth-prefixed methods anonymously', async () => {
|
|
100
100
|
const fetch = mockRpc()
|
|
101
101
|
|
|
102
102
|
try {
|
|
@@ -109,7 +109,7 @@ describe('POST /rpc', () => {
|
|
|
109
109
|
|
|
110
110
|
const response = await app.fetch(
|
|
111
111
|
new Request('http://tempo-api.test/rpc/testnet', {
|
|
112
|
-
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: '
|
|
112
|
+
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: 'eth_fillTransaction' }),
|
|
113
113
|
method: 'POST',
|
|
114
114
|
}),
|
|
115
115
|
)
|
|
@@ -122,6 +122,82 @@ describe('POST /rpc', () => {
|
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
+
test('requires an API key for non-eth methods', async () => {
|
|
126
|
+
const fetch = mockRpc()
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
const app = TestApp.create()
|
|
130
|
+
const response = await app.fetch(
|
|
131
|
+
new Request('http://tempo-api.test/rpc', {
|
|
132
|
+
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: 'tempo_fundAddress' }),
|
|
133
|
+
method: 'POST',
|
|
134
|
+
}),
|
|
135
|
+
)
|
|
136
|
+
const body = (await response.json()) as Record<string, unknown>
|
|
137
|
+
const { requestId, ...stable } = body
|
|
138
|
+
|
|
139
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
140
|
+
expect(typeof requestId).toMatchInlineSnapshot(`"string"`)
|
|
141
|
+
expect(stable).toMatchInlineSnapshot(`
|
|
142
|
+
{
|
|
143
|
+
"error": {
|
|
144
|
+
"code": "api_key_missing",
|
|
145
|
+
"message": "Missing API key",
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
`)
|
|
149
|
+
expect(fetch.calls).toMatchInlineSnapshot(`[]`)
|
|
150
|
+
} finally {
|
|
151
|
+
fetch.restore()
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
test('requires an API key when a batch includes a private method', async () => {
|
|
156
|
+
const fetch = mockRpc()
|
|
157
|
+
|
|
158
|
+
try {
|
|
159
|
+
const app = TestApp.create()
|
|
160
|
+
const response = await app.fetch(
|
|
161
|
+
new Request('http://tempo-api.test/rpc', {
|
|
162
|
+
body: JSON.stringify([
|
|
163
|
+
{ id: 1, jsonrpc: '2.0', method: 'eth_chainId' },
|
|
164
|
+
{ id: 2, jsonrpc: '2.0', method: 'tempo_fundAddress' },
|
|
165
|
+
]),
|
|
166
|
+
method: 'POST',
|
|
167
|
+
}),
|
|
168
|
+
)
|
|
169
|
+
const body = (await response.json()) as { error?: { code?: unknown } }
|
|
170
|
+
|
|
171
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
172
|
+
expect(body.error?.code).toMatchInlineSnapshot(`"api_key_missing"`)
|
|
173
|
+
expect(fetch.calls).toMatchInlineSnapshot(`[]`)
|
|
174
|
+
} finally {
|
|
175
|
+
fetch.restore()
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
test('allows API keys to call private methods', async () => {
|
|
180
|
+
const fetch = mockRpc()
|
|
181
|
+
|
|
182
|
+
try {
|
|
183
|
+
const app = TestApp.create()
|
|
184
|
+
const response = await app.fetch(
|
|
185
|
+
new Request('http://tempo-api.test/rpc', {
|
|
186
|
+
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: 'tempo_fundAddress' }),
|
|
187
|
+
headers: { 'tempo-api-key': TestApp.key.token },
|
|
188
|
+
method: 'POST',
|
|
189
|
+
}),
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
193
|
+
expect(fetch.calls[0]?.body).toMatchInlineSnapshot(
|
|
194
|
+
`"{"id":1,"jsonrpc":"2.0","method":"tempo_fundAddress"}"`,
|
|
195
|
+
)
|
|
196
|
+
} finally {
|
|
197
|
+
fetch.restore()
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
|
|
125
201
|
test('uses the requested chain id for upstream URL resolution', async () => {
|
|
126
202
|
const fetch = mockRpc()
|
|
127
203
|
|
|
@@ -315,7 +391,46 @@ describe('POST /rpc/relay', () => {
|
|
|
315
391
|
`)
|
|
316
392
|
})
|
|
317
393
|
|
|
318
|
-
test('
|
|
394
|
+
test('routes chain-scoped mounts to the relay pipeline', async () => {
|
|
395
|
+
const fetch = mockRpc()
|
|
396
|
+
|
|
397
|
+
try {
|
|
398
|
+
const app = TestApp.create({
|
|
399
|
+
auth: {
|
|
400
|
+
keys: [
|
|
401
|
+
{
|
|
402
|
+
id: 'key_relay',
|
|
403
|
+
orgId: 'org_test',
|
|
404
|
+
scopes: ['rpc-relay:read'],
|
|
405
|
+
token: 'secret_relay_key',
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
},
|
|
409
|
+
rpc: { url: () => 'https://internal.rpc.test/json-rpc' },
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
// Without a fee payer configured the relay pipeline answers this method
|
|
413
|
+
// itself; a proxied request would return the mock upstream's result.
|
|
414
|
+
const response = await app.fetch(
|
|
415
|
+
new Request('http://tempo-api.test/rpc/relay/42431', {
|
|
416
|
+
body: JSON.stringify({ id: 1, jsonrpc: '2.0', method: 'eth_signRawTransaction', params: ['0x76'] }), // prettier-ignore
|
|
417
|
+
headers: { 'tempo-api-key': 'secret_relay_key' },
|
|
418
|
+
method: 'POST',
|
|
419
|
+
}),
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
423
|
+
const body = (await response.json()) as { error?: { message: string } | undefined }
|
|
424
|
+
expect(body.error?.message).toMatchInlineSnapshot(
|
|
425
|
+
`"eth_signRawTransaction requires a fee payer to be configured on the relay. Set the \`feePayer\` option in \`Handler.relay()\` to enable transaction sponsorship."`,
|
|
426
|
+
)
|
|
427
|
+
expect(fetch.calls).toMatchInlineSnapshot(`[]`)
|
|
428
|
+
} finally {
|
|
429
|
+
fetch.restore()
|
|
430
|
+
}
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
test('proxies for keys holding rpc-relay:read', async () => {
|
|
319
434
|
const fetch = mockRpc()
|
|
320
435
|
|
|
321
436
|
try {
|
|
@@ -325,7 +440,7 @@ describe('POST /rpc/relay', () => {
|
|
|
325
440
|
{
|
|
326
441
|
id: 'key_relay',
|
|
327
442
|
orgId: 'org_test',
|
|
328
|
-
scopes: ['rpc-relay'],
|
|
443
|
+
scopes: ['rpc-relay:read'],
|
|
329
444
|
token: 'secret_relay_key',
|
|
330
445
|
},
|
|
331
446
|
],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Hono, type Context, type TypedResponse } from 'hono'
|
|
2
2
|
import * as z from 'zod/mini'
|
|
3
3
|
|
|
4
|
-
import type * as App from '
|
|
5
|
-
import * as Auth from '
|
|
6
|
-
import * as OpenApi from '
|
|
7
|
-
import * as Response from '
|
|
8
|
-
import * as Schema from '
|
|
9
|
-
import * as Viem from '
|
|
4
|
+
import type * as App from '../../../App.js'
|
|
5
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
6
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
7
|
+
import * as Response from '../../../internal/Response.js'
|
|
8
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
9
|
+
import * as Viem from '../../../internal/Viem.js'
|
|
10
10
|
|
|
11
11
|
// Request headers that must not be forwarded upstream: hop-by-hop headers, the
|
|
12
12
|
// inbound host, and any caller auth so the consumer's Tempo API credentials never
|
|
@@ -101,7 +101,7 @@ export namespace schema {
|
|
|
101
101
|
/** Creates the raw Tempo RPC passthrough handler. */
|
|
102
102
|
export function rpc() {
|
|
103
103
|
return new Hono<App.Environment>().post(
|
|
104
|
-
'/:chain{mainnet|testnet|[0-9]+}?',
|
|
104
|
+
'/rpc/:chain{(mainnet|testnet|[0-9]+)}?',
|
|
105
105
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, public: true }),
|
|
106
106
|
OpenApi.describeRoute({
|
|
107
107
|
description:
|
|
@@ -143,9 +143,22 @@ export function rpc() {
|
|
|
143
143
|
summary: 'Call JSON-RPC',
|
|
144
144
|
tags: ['RPC'],
|
|
145
145
|
}),
|
|
146
|
-
(c) => {
|
|
146
|
+
async (c) => {
|
|
147
147
|
if (Auth.narrowAccess) return Auth.accessError(c)
|
|
148
148
|
|
|
149
|
+
if (requiresApiKey(c)) {
|
|
150
|
+
const body = await c.req.raw
|
|
151
|
+
.clone()
|
|
152
|
+
.json()
|
|
153
|
+
.catch(() => undefined)
|
|
154
|
+
if (!isPublicRequest(body))
|
|
155
|
+
return Response.error(c, {
|
|
156
|
+
code: 'api_key_missing',
|
|
157
|
+
message: 'Missing API key',
|
|
158
|
+
status: 401,
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
|
|
149
162
|
const chainId = resolveChainId(c)
|
|
150
163
|
if (!chainId)
|
|
151
164
|
return Response.error(c, {
|
|
@@ -161,6 +174,23 @@ export function rpc() {
|
|
|
161
174
|
)
|
|
162
175
|
}
|
|
163
176
|
|
|
177
|
+
function requiresApiKey(c: Context<App.Environment>) {
|
|
178
|
+
if (!c.get('auth')) return false
|
|
179
|
+
const principal = Auth.getPrincipal(c)
|
|
180
|
+
return principal?.type !== 'api_key' && principal?.type !== 'super_admin'
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function isPublicRequest(body: unknown): boolean {
|
|
184
|
+
const requests = Array.isArray(body) ? body : [body]
|
|
185
|
+
return requests.length > 0 && requests.every((request) => isPublicMethod(request))
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function isPublicMethod(request: unknown): boolean {
|
|
189
|
+
if (!request || typeof request !== 'object') return false
|
|
190
|
+
const method = (request as Record<string, unknown>)['method']
|
|
191
|
+
return typeof method === 'string' && method.startsWith('eth_')
|
|
192
|
+
}
|
|
193
|
+
|
|
164
194
|
async function passthrough(
|
|
165
195
|
c: Context<App.Environment>,
|
|
166
196
|
chainId: z.output<typeof Schema.ChainId>,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as TestApp from '
|
|
2
|
-
import * as Runtime from '
|
|
3
|
-
import * as VerifiedTokens from '
|
|
1
|
+
import * as TestApp from '../../../../test/App.js'
|
|
2
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
3
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
4
4
|
import * as Tokenlist from './tokenlist.js'
|
|
5
5
|
|
|
6
6
|
/** Reader key for the data routes. */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Hono } from 'hono'
|
|
2
2
|
import * as z from 'zod/mini'
|
|
3
3
|
|
|
4
|
-
import type * as App from '
|
|
5
|
-
import * as Auth from '
|
|
6
|
-
import * as Cache from '
|
|
7
|
-
import * as OpenApi from '
|
|
8
|
-
import * as Response from '
|
|
9
|
-
import * as Schema from '
|
|
10
|
-
import * as VerifiedTokens from '
|
|
11
|
-
import * as Viem from '
|
|
4
|
+
import type * as App from '../../../App.js'
|
|
5
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
6
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
7
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
8
|
+
import * as Response from '../../../internal/Response.js'
|
|
9
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
10
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
11
|
+
import * as Viem from '../../../internal/Viem.js'
|
|
12
12
|
import { getTokenLogo } from './tokens.js'
|
|
13
13
|
|
|
14
14
|
/** Zod schemas owned by the tokenlist resource. */
|
|
@@ -124,7 +124,7 @@ export namespace schema {
|
|
|
124
124
|
*/
|
|
125
125
|
export function tokenlist() {
|
|
126
126
|
return new Hono<App.Environment>().get(
|
|
127
|
-
'/',
|
|
127
|
+
'/v1/tokenlist',
|
|
128
128
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
129
129
|
OpenApi.validate('query', schema.getTokenList.Query, {
|
|
130
130
|
code: 'query_invalid',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from 'tapimo'
|
|
2
2
|
|
|
3
|
-
import * as TestApp from '
|
|
4
|
-
import * as Runtime from '
|
|
3
|
+
import * as TestApp from '../../../../test/App.js'
|
|
4
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
5
5
|
import * as Tokens from './tokens.js'
|
|
6
6
|
|
|
7
7
|
// Verified enrichment is store-backed now that the build-time bundle is gone, so
|
|
@@ -3,20 +3,20 @@ import { AbiEvent, AbiParameters } from 'ox'
|
|
|
3
3
|
import { type Address, ContractFunctionExecutionError } from 'viem'
|
|
4
4
|
import * as z from 'zod/mini'
|
|
5
5
|
|
|
6
|
-
import type * as App from '
|
|
7
|
-
import * as Auth from '
|
|
8
|
-
import * as Cache from '
|
|
9
|
-
import * as Cursor from '
|
|
10
|
-
import * as OpenApi from '
|
|
11
|
-
import * as Path from '
|
|
12
|
-
import * as Response from '
|
|
13
|
-
import * as Schema from '
|
|
14
|
-
import * as Store from '
|
|
15
|
-
import * as Tidx from '
|
|
16
|
-
import * as Timing from '
|
|
17
|
-
import * as Ttl from '
|
|
18
|
-
import * as Value from '
|
|
19
|
-
import * as VerifiedTokens from '
|
|
6
|
+
import type * as App from '../../../App.js'
|
|
7
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
8
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
9
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
10
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
11
|
+
import * as Path from '../../../internal/Path.js'
|
|
12
|
+
import * as Response from '../../../internal/Response.js'
|
|
13
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
14
|
+
import * as Store from '../../../internal/Store.js'
|
|
15
|
+
import * as Tidx from '../../../internal/Tidx.js'
|
|
16
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
17
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
18
|
+
import * as Value from '../../../internal/Value.js'
|
|
19
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
20
20
|
import * as Transactions from './transactions.js'
|
|
21
21
|
|
|
22
22
|
const tokenCreatedSignature =
|
|
@@ -552,7 +552,7 @@ export namespace schema {
|
|
|
552
552
|
export function tokens() {
|
|
553
553
|
return new Hono<App.Environment>()
|
|
554
554
|
.get(
|
|
555
|
-
'/',
|
|
555
|
+
'/v1/tokens',
|
|
556
556
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
557
557
|
OpenApi.validate('query', schema.getTokens.Query, {
|
|
558
558
|
code: 'query_invalid',
|
|
@@ -622,7 +622,7 @@ export function tokens() {
|
|
|
622
622
|
},
|
|
623
623
|
)
|
|
624
624
|
.get(
|
|
625
|
-
|
|
625
|
+
`/v1/tokens/:symbol{${schema.getTokenBySymbol.routePattern}}`,
|
|
626
626
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
627
627
|
OpenApi.validate('param', schema.getTokenBySymbol.Params, {
|
|
628
628
|
code: 'symbol_invalid',
|
|
@@ -694,7 +694,7 @@ export function tokens() {
|
|
|
694
694
|
},
|
|
695
695
|
)
|
|
696
696
|
.get(
|
|
697
|
-
'/:token',
|
|
697
|
+
'/v1/tokens/:token',
|
|
698
698
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
699
699
|
OpenApi.validate('param', schema.getToken.Params, {
|
|
700
700
|
code: 'token_invalid',
|
|
@@ -749,7 +749,7 @@ export function tokens() {
|
|
|
749
749
|
},
|
|
750
750
|
)
|
|
751
751
|
.get(
|
|
752
|
-
'/:token/logo',
|
|
752
|
+
'/v1/tokens/:token/logo',
|
|
753
753
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
754
754
|
OpenApi.validate('param', schema.getTokenLogo.Params, {
|
|
755
755
|
code: 'token_invalid',
|
|
@@ -839,7 +839,7 @@ export function tokens() {
|
|
|
839
839
|
},
|
|
840
840
|
)
|
|
841
841
|
.get(
|
|
842
|
-
'/:token/holders',
|
|
842
|
+
'/v1/tokens/:token/holders',
|
|
843
843
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
844
844
|
OpenApi.validate('param', schema.getTokenHolders.Params, {
|
|
845
845
|
code: 'token_invalid',
|
|
@@ -930,7 +930,7 @@ export function tokens() {
|
|
|
930
930
|
},
|
|
931
931
|
)
|
|
932
932
|
.get(
|
|
933
|
-
'/:token/transactions',
|
|
933
|
+
'/v1/tokens/:token/transactions',
|
|
934
934
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
935
935
|
OpenApi.validate('param', schema.getTokenTransactions.Params, {
|
|
936
936
|
code: 'token_invalid',
|
|
@@ -2,9 +2,9 @@ import { Schema } from 'tapimo'
|
|
|
2
2
|
import { Hex } from 'ox'
|
|
3
3
|
import { zeroHash } from 'viem'
|
|
4
4
|
|
|
5
|
-
import * as TestApp from '
|
|
6
|
-
import * as Runtime from '
|
|
7
|
-
import * as Viem from '
|
|
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
8
|
import * as Transactions from './transactions.js'
|
|
9
9
|
|
|
10
10
|
/** The decoded `type` names a humanized transaction may report. */
|
|
@@ -2,19 +2,19 @@ import { Hono, type Context } from 'hono'
|
|
|
2
2
|
import { Hex } from 'ox'
|
|
3
3
|
import * as z from 'zod/mini'
|
|
4
4
|
|
|
5
|
-
import type * as App from '
|
|
6
|
-
import * as Auth from '
|
|
7
|
-
import * as Cache from '
|
|
8
|
-
import * as Cursor from '
|
|
9
|
-
import * as OpenApi from '
|
|
10
|
-
import * as Response from '
|
|
11
|
-
import * as Schema from '
|
|
12
|
-
import * as Store from '
|
|
13
|
-
import type * as Tidx from '
|
|
14
|
-
import * as Timing from '
|
|
15
|
-
import * as Ttl from '
|
|
16
|
-
import * as Value from '
|
|
17
|
-
import * as VerifiedTokens from '
|
|
5
|
+
import type * as App from '../../../App.js'
|
|
6
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
7
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
8
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
9
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
10
|
+
import * as Response from '../../../internal/Response.js'
|
|
11
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
12
|
+
import * as Store from '../../../internal/Store.js'
|
|
13
|
+
import type * as Tidx from '../../../internal/Tidx.js'
|
|
14
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
15
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
16
|
+
import * as Value from '../../../internal/Value.js'
|
|
17
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
18
18
|
import * as Receipts from './receipts.js'
|
|
19
19
|
import * as Tokens from './tokens.js'
|
|
20
20
|
|
|
@@ -595,7 +595,7 @@ export namespace schema {
|
|
|
595
595
|
export function transactions() {
|
|
596
596
|
return new Hono<App.Environment>()
|
|
597
597
|
.get(
|
|
598
|
-
'/',
|
|
598
|
+
'/v1/transactions',
|
|
599
599
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
600
600
|
OpenApi.validate('query', schema.getTransactions.Query, {
|
|
601
601
|
code: 'query_invalid',
|
|
@@ -692,7 +692,7 @@ export function transactions() {
|
|
|
692
692
|
},
|
|
693
693
|
)
|
|
694
694
|
.get(
|
|
695
|
-
'/:transactionHash',
|
|
695
|
+
'/v1/transactions/:transactionHash',
|
|
696
696
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
697
697
|
OpenApi.validate('param', schema.getTransaction.Params, {
|
|
698
698
|
code: 'transaction_invalid',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as z from 'zod/mini'
|
|
2
2
|
import { Schema } from 'tapimo'
|
|
3
3
|
|
|
4
|
-
import * as TestApp from '
|
|
5
|
-
import * as Runtime from '
|
|
4
|
+
import * as TestApp from '../../../../test/App.js'
|
|
5
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
6
6
|
import * as Transfers from './transfers.js'
|
|
7
7
|
|
|
8
8
|
describe('GET /transfers', () => {
|
|
@@ -3,20 +3,20 @@ import { Address, Hex } from 'ox'
|
|
|
3
3
|
import { Addresses } from 'viem/tempo'
|
|
4
4
|
import * as z from 'zod/mini'
|
|
5
5
|
|
|
6
|
-
import type * as App from '
|
|
7
|
-
import * as Auth from '
|
|
8
|
-
import * as Cache from '
|
|
9
|
-
import * as Cursor from '
|
|
10
|
-
import * as Mpp from '
|
|
11
|
-
import * as OpenApi from '
|
|
12
|
-
import * as Response from '
|
|
13
|
-
import * as Schema from '
|
|
14
|
-
import * as Store from '
|
|
15
|
-
import type * as Tidx from '
|
|
16
|
-
import * as Timing from '
|
|
17
|
-
import * as Ttl from '
|
|
18
|
-
import * as Value from '
|
|
19
|
-
import * as VerifiedTokens from '
|
|
6
|
+
import type * as App from '../../../App.js'
|
|
7
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
8
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
9
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
10
|
+
import * as Mpp from '../../../internal/Mpp.js'
|
|
11
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
12
|
+
import * as Response from '../../../internal/Response.js'
|
|
13
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
14
|
+
import * as Store from '../../../internal/Store.js'
|
|
15
|
+
import type * as Tidx from '../../../internal/Tidx.js'
|
|
16
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
17
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
18
|
+
import * as Value from '../../../internal/Value.js'
|
|
19
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
20
20
|
import * as Tokens from './tokens.js'
|
|
21
21
|
|
|
22
22
|
// TIP-20 tokens emit the standard ERC-20 Transfer event. Supplying the
|
|
@@ -285,7 +285,7 @@ export namespace schema {
|
|
|
285
285
|
/** Creates transfer handlers. */
|
|
286
286
|
export function transfers() {
|
|
287
287
|
return new Hono<App.Environment>().get(
|
|
288
|
-
'/',
|
|
288
|
+
'/v1/transfers',
|
|
289
289
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
290
290
|
OpenApi.validate('query', schema.getTransfers.Query, {
|
|
291
291
|
code: 'query_invalid',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as TestApp from '
|
|
2
|
-
import * as Runtime from '
|
|
3
|
-
import * as VerifiedTokens from '
|
|
1
|
+
import * as TestApp from '../../../../test/App.js'
|
|
2
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
3
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
4
4
|
import * as Verified from './verified-tokens.js'
|
|
5
5
|
|
|
6
6
|
/** Reader key for the data routes. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type Context, Hono } from 'hono'
|
|
2
2
|
import * as z from 'zod/mini'
|
|
3
3
|
|
|
4
|
-
import type * as App from '
|
|
5
|
-
import * as Auth from '
|
|
6
|
-
import * as Cache from '
|
|
7
|
-
import * as OpenApi from '
|
|
8
|
-
import * as Response from '
|
|
9
|
-
import * as Schema from '
|
|
10
|
-
import * as VerifiedTokens from '
|
|
4
|
+
import type * as App from '../../../App.js'
|
|
5
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
6
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
7
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
8
|
+
import * as Response from '../../../internal/Response.js'
|
|
9
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
10
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
11
11
|
|
|
12
12
|
/** Zod schemas owned by the verified-tokens resource. */
|
|
13
13
|
export namespace schema {
|
|
@@ -138,7 +138,7 @@ export namespace schema {
|
|
|
138
138
|
export function verifiedTokens() {
|
|
139
139
|
return new Hono<App.Environment>()
|
|
140
140
|
.get(
|
|
141
|
-
'/',
|
|
141
|
+
'/v1/verified-tokens',
|
|
142
142
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
143
143
|
OpenApi.validate('query', schema.listVerifiedTokens.Query, {
|
|
144
144
|
code: 'query_invalid',
|
|
@@ -183,7 +183,7 @@ export function verifiedTokens() {
|
|
|
183
183
|
},
|
|
184
184
|
)
|
|
185
185
|
.get(
|
|
186
|
-
'/currencies',
|
|
186
|
+
'/v1/verified-tokens/currencies',
|
|
187
187
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
188
188
|
OpenApi.validate('query', schema.getVerifiedTokenCurrencies.Query, {
|
|
189
189
|
code: 'query_invalid',
|
|
@@ -230,7 +230,7 @@ export function verifiedTokens() {
|
|
|
230
230
|
},
|
|
231
231
|
)
|
|
232
232
|
.get(
|
|
233
|
-
'/:address',
|
|
233
|
+
'/v1/verified-tokens/:address',
|
|
234
234
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
235
235
|
OpenApi.validate('param', schema.Params, {
|
|
236
236
|
code: 'address_invalid',
|