tapimo 0.0.2 → 0.2.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 +38 -16
- package/dist/ApiKey.d.ts +14 -11
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +11 -12
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +207 -0
- package/dist/ApiKeys.d.ts.map +1 -0
- package/dist/ApiKeys.js +282 -0
- package/dist/ApiKeys.js.map +1 -0
- package/dist/App.d.ts +6771 -3819
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +145 -317
- package/dist/App.js.map +1 -1
- package/dist/Handler.d.ts +86 -0
- package/dist/Handler.d.ts.map +1 -0
- package/dist/Handler.js +83 -0
- package/dist/Handler.js.map +1 -0
- package/dist/Scope.d.ts +14 -4
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +16 -4
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +5 -7
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +11 -4
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/Access.d.ts +1 -3
- package/dist/admin/Access.d.ts.map +1 -1
- package/dist/admin/Access.js +1 -3
- package/dist/admin/Access.js.map +1 -1
- package/dist/admin/App.d.ts +167 -205
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/App.js +2 -4
- package/dist/admin/App.js.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +105 -5
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +75 -9
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +6 -0
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +35 -149
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.js +18 -39
- 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 +1 -1
- package/dist/apps/data/App.d.ts +19176 -0
- package/dist/apps/data/App.d.ts.map +1 -0
- package/dist/apps/data/App.js +236 -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} +49 -49
- 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} +183 -183
- 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} +460 -460
- 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} +94 -94
- 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/{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} +6 -6
- package/dist/apps/data/routes/receipts.d.ts.map +1 -0
- package/dist/apps/{receipts.js → data/routes/receipts.js} +12 -12
- package/dist/apps/data/routes/receipts.js.map +1 -0
- package/dist/apps/{rpc.d.ts → data/routes/rpc.d.ts} +4 -4
- package/dist/apps/data/routes/rpc.d.ts.map +1 -0
- package/dist/apps/{rpc.js → data/routes/rpc.js} +6 -6
- package/dist/apps/data/routes/rpc.js.map +1 -0
- package/dist/apps/{tokenlist.d.ts → data/routes/tokenlist.d.ts} +4 -4
- 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} +11 -11
- 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} +288 -288
- 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} +35 -35
- 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} +42 -42
- 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} +66 -63
- package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
- package/dist/apps/{webhooks.js → data/routes/webhooks.js} +67 -59
- package/dist/apps/data/routes/webhooks.js.map +1 -0
- package/dist/apps/docs/App.d.ts +27 -0
- package/dist/apps/docs/App.d.ts.map +1 -0
- package/dist/apps/docs/App.js +122 -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/index.d.ts +4 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +4 -0
- package/dist/apps/index.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 +2985 -0
- package/dist/apps/platform/App.d.ts.map +1 -0
- package/dist/apps/platform/App.js +74 -0
- package/dist/apps/platform/App.js.map +1 -0
- package/dist/apps/platform/index.d.ts +2 -0
- package/dist/apps/platform/index.d.ts.map +1 -0
- package/dist/apps/platform/index.js +2 -0
- package/dist/apps/platform/index.js.map +1 -0
- package/dist/apps/platform/routes/api-keys.d.ts +681 -0
- package/dist/apps/platform/routes/api-keys.d.ts.map +1 -0
- package/dist/apps/platform/routes/api-keys.js +328 -0
- package/dist/apps/platform/routes/api-keys.js.map +1 -0
- package/dist/apps/platform/routes/invitations.d.ts +733 -0
- package/dist/apps/platform/routes/invitations.d.ts.map +1 -0
- package/dist/apps/platform/routes/invitations.js +413 -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 +582 -0
- package/dist/apps/platform/routes/orgs.d.ts.map +1 -0
- package/dist/apps/platform/routes/orgs.js +265 -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/relay/App.d.ts +41 -0
- package/dist/apps/relay/App.d.ts.map +1 -0
- package/dist/apps/relay/App.js +103 -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 +193 -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.d.ts → cli/Cli.d.ts} +13 -2
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +19 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +15 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +60 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cloudflare.d.ts +7 -0
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +9 -0
- package/dist/cloudflare.js.map +1 -1
- package/dist/db/Db.d.ts +113 -0
- package/dist/db/Db.d.ts.map +1 -0
- package/dist/db/Db.js +402 -0
- package/dist/db/Db.js.map +1 -0
- package/dist/db/Schema.d.ts +168 -0
- package/dist/db/Schema.d.ts.map +1 -0
- package/dist/db/Schema.js +229 -0
- package/dist/db/Schema.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 +123 -0
- package/dist/db/tables/organizations.d.ts.map +1 -0
- package/dist/db/tables/organizations.js +170 -0
- package/dist/db/tables/organizations.js.map +1 -0
- 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/sponsoredTransactions.d.ts +120 -0
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -0
- package/dist/db/tables/sponsoredTransactions.js +161 -0
- package/dist/db/tables/sponsoredTransactions.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/db/tables/verifiedTokens.d.ts +53 -0
- package/dist/db/tables/verifiedTokens.d.ts.map +1 -0
- package/dist/db/tables/verifiedTokens.js +74 -0
- package/dist/db/tables/verifiedTokens.js.map +1 -0
- package/dist/db/tables/webhookDeliveries.d.ts +71 -0
- package/dist/db/tables/webhookDeliveries.d.ts.map +1 -0
- package/dist/db/tables/webhookDeliveries.js +119 -0
- package/dist/db/tables/webhookDeliveries.js.map +1 -0
- package/dist/db/tables/webhookSubscriptions.d.ts +158 -0
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -0
- package/dist/db/tables/webhookSubscriptions.js +272 -0
- package/dist/db/tables/webhookSubscriptions.js.map +1 -0
- package/dist/handlers/internal/executionError.d.ts +25 -0
- package/dist/handlers/internal/executionError.d.ts.map +1 -0
- package/dist/handlers/internal/executionError.js +186 -0
- package/dist/handlers/internal/executionError.js.map +1 -0
- package/dist/handlers/internal/multisig.d.ts +233 -0
- package/dist/handlers/internal/multisig.d.ts.map +1 -0
- package/dist/handlers/internal/multisig.js +542 -0
- package/dist/handlers/internal/multisig.js.map +1 -0
- package/dist/handlers/internal/requestListener.d.ts +124 -0
- package/dist/handlers/internal/requestListener.d.ts.map +1 -0
- package/dist/handlers/internal/requestListener.js +173 -0
- package/dist/handlers/internal/requestListener.js.map +1 -0
- package/dist/handlers/internal/sponsorship.d.ts +113 -0
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -0
- package/dist/handlers/internal/sponsorship.js +128 -0
- package/dist/handlers/internal/sponsorship.js.map +1 -0
- package/dist/handlers/internal/types.d.ts +284 -0
- package/dist/handlers/internal/types.d.ts.map +1 -0
- package/dist/handlers/internal/types.js +2 -0
- package/dist/handlers/internal/types.js.map +1 -0
- package/dist/handlers/internal/utils.d.ts +34 -0
- package/dist/handlers/internal/utils.d.ts.map +1 -0
- package/dist/handlers/internal/utils.js +131 -0
- package/dist/handlers/internal/utils.js.map +1 -0
- package/dist/handlers/relay.d.ts +123 -0
- package/dist/handlers/relay.d.ts.map +1 -0
- package/dist/handlers/relay.js +1278 -0
- package/dist/handlers/relay.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/Auth.d.ts +224 -16
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +572 -33
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Log.d.ts +7 -3
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +4 -0
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +0 -19
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +0 -57
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/RpcSchema.d.ts +10 -0
- package/dist/internal/RpcSchema.d.ts.map +1 -0
- package/dist/internal/RpcSchema.js +2 -0
- package/dist/internal/RpcSchema.js.map +1 -0
- package/dist/internal/Store.d.ts +49 -4
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +81 -5
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/VerifiedTokens.d.ts +15 -34
- package/dist/internal/VerifiedTokens.d.ts.map +1 -1
- package/dist/internal/VerifiedTokens.js +115 -159
- package/dist/internal/VerifiedTokens.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 +50 -36
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +92 -205
- package/dist/internal/Webhooks.js.map +1 -1
- package/package.json +37 -6
- package/src/ApiKey.test.ts +3 -3
- package/src/ApiKey.ts +11 -12
- package/src/ApiKeys.test.ts +278 -0
- package/src/ApiKeys.ts +358 -0
- package/src/App.test-d.ts +1 -1
- package/src/App.test.ts +40508 -19083
- package/src/App.ts +239 -416
- package/src/Client.test-d.ts +307 -16
- package/src/Handler.ts +154 -0
- package/src/Scope.ts +17 -4
- package/src/Webhooks.test.ts +8 -7
- package/src/Webhooks.ts +13 -7
- package/src/admin/Access.ts +1 -3
- package/src/admin/App.ts +19 -24
- package/src/admin/apps/api-keys.test.ts +70 -18
- package/src/admin/apps/api-keys.ts +92 -9
- package/src/admin/apps/scopes.test.ts +8 -0
- package/src/admin/apps/verified-tokens.test.ts +3 -30
- package/src/admin/apps/verified-tokens.ts +18 -37
- package/src/admin/ui.generated.ts +1 -1
- package/src/apps/composition.test.ts +66 -0
- package/src/apps/data/App.ts +295 -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} +6 -5
- package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
- package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +4 -4
- 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} +2 -2
- 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/{indexer.test.ts → data/routes/indexer.test.ts} +27 -6
- package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
- package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +4 -4
- package/src/apps/{receipts.ts → data/routes/receipts.ts} +13 -13
- package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +142 -13
- package/src/apps/{rpc.ts → data/routes/rpc.ts} +7 -7
- package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +8 -10
- package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
- package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +6 -5
- package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
- package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +4 -4
- package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
- package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +3 -3
- package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
- package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +27 -15
- package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
- package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +137 -150
- package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +83 -81
- package/src/apps/docs/App.ts +136 -0
- package/src/apps/docs/index.ts +1 -0
- package/src/apps/index.ts +3 -0
- package/src/apps/metadata.ts +23 -0
- package/src/apps/platform/App.ts +130 -0
- package/src/apps/platform/index.ts +1 -0
- package/src/apps/platform/routes/api-keys.test.ts +330 -0
- package/src/apps/platform/routes/api-keys.ts +427 -0
- package/src/apps/platform/routes/invitations.test.ts +361 -0
- package/src/apps/platform/routes/invitations.ts +519 -0
- package/src/apps/platform/routes/me.test.ts +121 -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 +343 -0
- package/src/apps/platform/routes/projects.test.ts +181 -0
- package/src/apps/platform/routes/projects.ts +367 -0
- package/src/apps/relay/App.test.ts +484 -0
- package/src/apps/relay/App.ts +128 -0
- package/src/apps/relay/Sponsorships.test.ts +375 -0
- package/src/apps/relay/Sponsorships.ts +305 -0
- package/src/apps/relay/index.ts +2 -0
- package/src/{Cli.test.ts → cli/Cli.test.ts} +10 -9
- package/src/{Cli.ts → cli/Cli.ts} +16 -9
- package/src/cli/bin.ts +4 -0
- package/src/cli/commands/admin.test.ts +71 -0
- package/src/cli/commands/admin.ts +60 -0
- package/src/cloudflare.ts +10 -0
- package/src/db/Db.test.ts +84 -0
- package/src/db/Db.ts +542 -0
- package/src/db/Schema.ts +301 -0
- package/src/db/tables/invitations.ts +198 -0
- package/src/db/tables/memberships.ts +208 -0
- package/src/db/tables/organizations.test.ts +160 -0
- package/src/db/tables/organizations.ts +232 -0
- package/src/db/tables/projects.ts +107 -0
- package/src/db/tables/sponsoredTransactions.test.ts +218 -0
- package/src/db/tables/sponsoredTransactions.ts +236 -0
- package/src/db/tables/users.ts +85 -0
- package/src/db/tables/verifiedTokens.ts +111 -0
- package/src/db/tables/webhookDeliveries.ts +159 -0
- package/src/db/tables/webhookSubscriptions.ts +358 -0
- package/src/handlers/internal/executionError.ts +207 -0
- package/src/handlers/internal/multisig.test.ts +818 -0
- package/src/handlers/internal/multisig.ts +823 -0
- package/src/handlers/internal/requestListener.ts +273 -0
- package/src/handlers/internal/sponsorship.ts +245 -0
- package/src/handlers/internal/types.ts +378 -0
- package/src/handlers/internal/utils.ts +153 -0
- package/src/handlers/relay.test.ts +2035 -0
- package/src/handlers/relay.ts +1623 -0
- package/src/index.ts +4 -2
- package/src/internal/Auth.test.ts +337 -21
- package/src/internal/Auth.ts +783 -44
- package/src/internal/Cursor.test.ts +3 -2
- package/src/internal/Log.test.ts +1 -1
- package/src/internal/Log.ts +11 -3
- package/src/internal/MetricSink.ts +1 -1
- package/src/internal/OpenApi.ts +0 -59
- package/src/internal/RateLimit.test.ts +1 -1
- package/src/internal/RpcSchema.ts +10 -0
- package/src/internal/Store.test.ts +150 -10
- package/src/internal/Store.ts +136 -11
- package/src/internal/Tidx.local.test.ts +1 -1
- package/src/internal/VerifiedTokens.test.ts +99 -115
- package/src/internal/VerifiedTokens.ts +123 -175
- package/src/internal/WebhookDestination.test.ts +1 -1
- package/src/internal/Webhooks.test.ts +111 -111
- package/src/internal/Webhooks.ts +103 -221
- package/dist/ApiKeySource.d.ts +0 -166
- package/dist/ApiKeySource.d.ts.map +0 -1
- package/dist/ApiKeySource.js +0 -234
- package/dist/ApiKeySource.js.map +0 -1
- package/dist/Cli.d.ts.map +0 -1
- package/dist/Cli.js +0 -13
- package/dist/Cli.js.map +0 -1
- 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/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/31318/verified-tokens.json +0 -30
- package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +0 -4
- package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +0 -30
- package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +0 -11
- package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +0 -1
- package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +0 -5
- package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
- package/seeds/4217/verified-tokens.json +0 -177
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +0 -1
- package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +0 -1
- package/seeds/42431/verified-tokens.json +0 -44
- package/seeds/openrpc/README.md +0 -27
- package/seeds/openrpc/execution-apis.json +0 -8989
- package/src/ApiKeySource.test-d.ts +0 -11
- package/src/ApiKeySource.test.ts +0 -295
- package/src/ApiKeySource.ts +0 -303
- /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
- /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
|
@@ -4,9 +4,9 @@ import * as z from 'zod/mini'
|
|
|
4
4
|
import * as OpenApi from '../../internal/OpenApi.js'
|
|
5
5
|
import * as Response from '../../internal/Response.js'
|
|
6
6
|
import * as Schema from '../../internal/Schema.js'
|
|
7
|
-
import
|
|
7
|
+
import * as Db from '../../db/Db.js'
|
|
8
8
|
import * as VerifiedTokens from '../../internal/VerifiedTokens.js'
|
|
9
|
-
import { schema as readSchema } from '../../apps/verified-tokens.js'
|
|
9
|
+
import { schema as readSchema } from '../../apps/data/routes/verified-tokens.js'
|
|
10
10
|
import type * as App from '../App.js'
|
|
11
11
|
|
|
12
12
|
/** Required `chainId` query: admin mutations always address a chain explicitly. */
|
|
@@ -149,9 +149,9 @@ export namespace schema {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
* Management routes for the curated verified-token list, backed by the
|
|
153
|
-
*
|
|
154
|
-
*
|
|
152
|
+
* Management routes for the curated verified-token list, backed by the app
|
|
153
|
+
* database (snapshot rows). Mutations accept an optional `If-Match`
|
|
154
|
+
* precondition (`412` on mismatch).
|
|
155
155
|
*
|
|
156
156
|
* - `POST /` creates a token (`409` on a duplicate address or symbol).
|
|
157
157
|
* - `PUT /` replaces a chain's entire list (seed/rollback).
|
|
@@ -170,7 +170,6 @@ export function verifiedTokens() {
|
|
|
170
170
|
OpenApi.describeRoute({
|
|
171
171
|
operationId: 'listVerifiedTokens',
|
|
172
172
|
responses: OpenApi.responses({
|
|
173
|
-
errors: { 404: featureDisabledDescription },
|
|
174
173
|
success: {
|
|
175
174
|
description: 'Curated verified tokens.',
|
|
176
175
|
schema: schema.listVerifiedTokens.Response,
|
|
@@ -180,10 +179,9 @@ export function verifiedTokens() {
|
|
|
180
179
|
tags: ['Verified Tokens'],
|
|
181
180
|
}),
|
|
182
181
|
async (c) => {
|
|
183
|
-
const
|
|
184
|
-
if (!store) return notEnabled(c)
|
|
182
|
+
const db = Db.get(c.get('db'))
|
|
185
183
|
const { chainId } = c.req.valid('query')
|
|
186
|
-
const snapshot = await VerifiedTokens.read(
|
|
184
|
+
const snapshot = await VerifiedTokens.read(db, chainId)
|
|
187
185
|
return c.json(
|
|
188
186
|
Response.validated(schema.listVerifiedTokens.Response, {
|
|
189
187
|
data: snapshot?.list ?? [],
|
|
@@ -202,7 +200,6 @@ export function verifiedTokens() {
|
|
|
202
200
|
operationId: 'createVerifiedToken',
|
|
203
201
|
responses: OpenApi.responses({
|
|
204
202
|
errors: {
|
|
205
|
-
404: featureDisabledDescription,
|
|
206
203
|
409: 'Duplicate address or symbol.',
|
|
207
204
|
413: 'Logo exceeds the size limit.',
|
|
208
205
|
415: 'Logo is not valid SVG.',
|
|
@@ -216,22 +213,21 @@ export function verifiedTokens() {
|
|
|
216
213
|
tags: ['Verified Tokens'],
|
|
217
214
|
}),
|
|
218
215
|
async (c) => {
|
|
219
|
-
const
|
|
220
|
-
if (!store) return notEnabled(c)
|
|
216
|
+
const db = Db.get(c.get('db'))
|
|
221
217
|
const { logo, ...body } = c.req.valid('json')
|
|
222
218
|
try {
|
|
223
219
|
if (logo !== undefined) {
|
|
224
220
|
const assets = c.get('assets')
|
|
225
221
|
if (!assets?.put) return assetsNotEnabled(c)
|
|
226
222
|
const svg = encodeLogo(logo)
|
|
227
|
-
const duplicate = await findDuplicate(
|
|
223
|
+
const duplicate = await findDuplicate(db, body)
|
|
228
224
|
if (duplicate) throw duplicate
|
|
229
225
|
await assets.put(logoKey(body.chainId, body.address), {
|
|
230
226
|
body: svg,
|
|
231
227
|
contentType: 'image/svg+xml',
|
|
232
228
|
})
|
|
233
229
|
}
|
|
234
|
-
const { snapshot, token } = await VerifiedTokens.create(
|
|
230
|
+
const { snapshot, token } = await VerifiedTokens.create(db, body)
|
|
235
231
|
return c.json(
|
|
236
232
|
Response.validated(schema.createVerifiedToken.Response, {
|
|
237
233
|
data: token,
|
|
@@ -257,7 +253,6 @@ export function verifiedTokens() {
|
|
|
257
253
|
operationId: 'replaceVerifiedTokens',
|
|
258
254
|
responses: OpenApi.responses({
|
|
259
255
|
errors: {
|
|
260
|
-
404: featureDisabledDescription,
|
|
261
256
|
409: 'Duplicate address or symbol.',
|
|
262
257
|
412: 'Version precondition failed.',
|
|
263
258
|
},
|
|
@@ -270,12 +265,11 @@ export function verifiedTokens() {
|
|
|
270
265
|
tags: ['Verified Tokens'],
|
|
271
266
|
}),
|
|
272
267
|
async (c) => {
|
|
273
|
-
const
|
|
274
|
-
if (!store) return notEnabled(c)
|
|
268
|
+
const db = Db.get(c.get('db'))
|
|
275
269
|
const { chainId } = c.req.valid('query')
|
|
276
270
|
const { tokens } = c.req.valid('json')
|
|
277
271
|
try {
|
|
278
|
-
const { snapshot } = await VerifiedTokens.replace(
|
|
272
|
+
const { snapshot } = await VerifiedTokens.replace(db, chainId, tokens, {
|
|
279
273
|
...ifMatch(c),
|
|
280
274
|
})
|
|
281
275
|
return c.json(
|
|
@@ -320,13 +314,12 @@ export function verifiedTokens() {
|
|
|
320
314
|
tags: ['Verified Tokens'],
|
|
321
315
|
}),
|
|
322
316
|
async (c) => {
|
|
323
|
-
const
|
|
324
|
-
if (!store) return notEnabled(c)
|
|
317
|
+
const db = Db.get(c.get('db'))
|
|
325
318
|
const { address } = c.req.valid('param')
|
|
326
319
|
const { chainId } = c.req.valid('query')
|
|
327
320
|
const body = c.req.valid('json')
|
|
328
321
|
try {
|
|
329
|
-
const { snapshot, token } = await VerifiedTokens.patch(
|
|
322
|
+
const { snapshot, token } = await VerifiedTokens.patch(db, chainId, address, body, {
|
|
330
323
|
...ifMatch(c),
|
|
331
324
|
})
|
|
332
325
|
return c.json(
|
|
@@ -366,12 +359,11 @@ export function verifiedTokens() {
|
|
|
366
359
|
tags: ['Verified Tokens'],
|
|
367
360
|
}),
|
|
368
361
|
async (c) => {
|
|
369
|
-
const
|
|
370
|
-
if (!store) return notEnabled(c)
|
|
362
|
+
const db = Db.get(c.get('db'))
|
|
371
363
|
const { address } = c.req.valid('param')
|
|
372
364
|
const { chainId } = c.req.valid('query')
|
|
373
365
|
try {
|
|
374
|
-
const { snapshot } = await VerifiedTokens.remove(
|
|
366
|
+
const { snapshot } = await VerifiedTokens.remove(db, chainId, address, {
|
|
375
367
|
...ifMatch(c),
|
|
376
368
|
})
|
|
377
369
|
return c.json(
|
|
@@ -476,9 +468,6 @@ export function verifiedTokens() {
|
|
|
476
468
|
/** Largest accepted logo upload (SVG icons are tiny; this is generous). */
|
|
477
469
|
const maxLogoBytes = 256 * 1024
|
|
478
470
|
|
|
479
|
-
/** OpenAPI description shared by write routes' 404 when the feature is disabled. */
|
|
480
|
-
const featureDisabledDescription = 'Verified-token management is not enabled (or not found).'
|
|
481
|
-
|
|
482
471
|
/** Asset-store key the main API's loader reads for a token's curated icon. */
|
|
483
472
|
function logoKey(chainId: number, address: string): string {
|
|
484
473
|
return `${chainId}/icons/${address.toLowerCase()}`
|
|
@@ -511,10 +500,10 @@ function encodeLogo(logo: string): ArrayBuffer {
|
|
|
511
500
|
// Returns the duplicate-address/symbol error a create would throw, or undefined,
|
|
512
501
|
// so the logo upload can be skipped before it overwrites an existing icon.
|
|
513
502
|
async function findDuplicate(
|
|
514
|
-
|
|
503
|
+
db: Db.Db,
|
|
515
504
|
token: { address: string; chainId: VerifiedTokens.ChainId; symbol: string },
|
|
516
505
|
): Promise<Error | undefined> {
|
|
517
|
-
const snapshot = await VerifiedTokens.read(
|
|
506
|
+
const snapshot = await VerifiedTokens.read(db, token.chainId)
|
|
518
507
|
if (!snapshot) return undefined
|
|
519
508
|
if (snapshot.byAddress.has(token.address.toLowerCase()))
|
|
520
509
|
return new VerifiedTokens.DuplicateAddressError({ address: token.address, chainId: token.chainId }) // prettier-ignore
|
|
@@ -556,11 +545,3 @@ function mutationError(c: Context<App.Environment>, cause: unknown) {
|
|
|
556
545
|
return Response.error(c, { code: 'version_mismatch', message: cause.message, status: 412 })
|
|
557
546
|
return Response.upstream(c, cause)
|
|
558
547
|
}
|
|
559
|
-
|
|
560
|
-
function notEnabled(c: Context<App.Environment>) {
|
|
561
|
-
return Response.error(c, {
|
|
562
|
-
code: 'verified_tokens_not_enabled',
|
|
563
|
-
message: 'Verified-token management is not enabled for this deployment.',
|
|
564
|
-
status: 404,
|
|
565
|
-
})
|
|
566
|
-
}
|
|
@@ -11,7 +11,7 @@ export type Asset = {
|
|
|
11
11
|
|
|
12
12
|
/** The prerendered SPA shell HTML (assets normalized to relative URLs). */
|
|
13
13
|
export const shell =
|
|
14
|
-
'<!DOCTYPE html><html lang="en" data-theme="dark" data-regen-radius="none"><head><meta charSet="utf-8"/><meta content="width=device-width, initial-scale=1" name="viewport"/><link rel="stylesheet" href="./assets/styles-Cd7Fp5b_.css" data-precedence="default"/><title>Tempo API Admin</title><link rel="modulepreload" href="./assets/index-CPTihwDe.js"/><link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20269%20269%22%3E%3Crect%20width%3D%22269%22%20height%3D%22269%22%20fill%3D%22%23000%22%2F%3E%3Cpath%20d%3D%22M123.273%20190.794H93.445L121.09%20105.318H85.7334L93.445%2080.2642H191.95L184.238%20105.318H150.773L123.273%20190.794Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E"/></head><body><div id="root"></div><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["./assets/index-CPTihwDe.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"./assets/index-CPTihwDe.js"}}]}}},matches:$R[8]=[$R[9]={i:"__root__\u0000",u:
|
|
14
|
+
'<!DOCTYPE html><html lang="en" data-theme="dark" data-regen-radius="none"><head><meta charSet="utf-8"/><meta content="width=device-width, initial-scale=1" name="viewport"/><link rel="stylesheet" href="./assets/styles-Cd7Fp5b_.css" data-precedence="default"/><title>Tempo API Admin</title><link rel="modulepreload" href="./assets/index-CPTihwDe.js"/><link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20269%20269%22%3E%3Crect%20width%3D%22269%22%20height%3D%22269%22%20fill%3D%22%23000%22%2F%3E%3Cpath%20d%3D%22M123.273%20190.794H93.445L121.09%20105.318H85.7334L93.445%2080.2642H191.95L184.238%20105.318H150.773L123.273%20190.794Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E"/></head><body><div id="root"></div><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["./assets/index-CPTihwDe.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"./assets/index-CPTihwDe.js"}}]}}},matches:$R[8]=[$R[9]={i:"__root__\u0000",u:1783292569178,s:"success",ssr:!0}],lastMatchId:"__root__\u0000"})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="./assets/index-CPTihwDe.js"></script></body></html>'
|
|
15
15
|
|
|
16
16
|
/** Content-hashed UI assets, keyed by their path under the mount (e.g. `assets/index-*.js`). */
|
|
17
17
|
export const assets: Record<string, Asset> = {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { App, Store } from 'tapimo'
|
|
2
|
+
import { data, platform, relay } from 'tapimo/apps'
|
|
3
|
+
import * as TestApp from '../../test/App.js'
|
|
4
|
+
|
|
5
|
+
// Each test mounts one group and asserts its routes exist while the omitted
|
|
6
|
+
// group's are absent (404 and not in the document). Only `paths` are checked;
|
|
7
|
+
// tags/schemes stay a superset (Decision C).
|
|
8
|
+
|
|
9
|
+
/** Paths (sans method) present in a composed app's OpenAPI document. */
|
|
10
|
+
async function paths(app: { request: (path: string) => Promise<Response> | Response }) {
|
|
11
|
+
const res = await app.request('/openapi.json')
|
|
12
|
+
const spec = (await res.json()) as { paths: Record<string, unknown> }
|
|
13
|
+
return Object.keys(spec.paths)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe('data()', () => {
|
|
17
|
+
test('mounts data routes and omits platform routes', async () => {
|
|
18
|
+
const app = App.create({ db: TestApp.database() }).route('/', data())
|
|
19
|
+
|
|
20
|
+
const keys = await paths(app)
|
|
21
|
+
expect(keys.some((path) => path.startsWith('/v1/tokens'))).toBe(true)
|
|
22
|
+
expect(keys.some((path) => path.startsWith('/v1/blocks'))).toBe(true)
|
|
23
|
+
expect(keys.some((path) => path.startsWith('/v1/orgs'))).toBe(false)
|
|
24
|
+
expect(keys.some((path) => path.startsWith('/v1/me'))).toBe(false)
|
|
25
|
+
|
|
26
|
+
// The omitted platform route resolves to a 404 (never mounted), not a 401.
|
|
27
|
+
const orgs = await app.request('/v1/orgs')
|
|
28
|
+
expect(orgs.status).toBe(404)
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
describe('relay()', () => {
|
|
33
|
+
test('mounts the relay after data() and stays out of the document', async () => {
|
|
34
|
+
const composed = App.create({ db: TestApp.database() }).route('/', data()).route('/', relay())
|
|
35
|
+
|
|
36
|
+
// Mounted but default-closed and hidden: unauthenticated requests are
|
|
37
|
+
// refused, and the path never appears in the OpenAPI document.
|
|
38
|
+
const mounted = await composed.request('/rpc/relay')
|
|
39
|
+
expect(mounted.status).toBe(401)
|
|
40
|
+
expect((await paths(composed)).some((path) => path.startsWith('/rpc/relay'))).toBe(false)
|
|
41
|
+
|
|
42
|
+
// Without the relay group, the data group no longer serves the path.
|
|
43
|
+
const dataOnly = App.create({ db: TestApp.database() }).route('/', data())
|
|
44
|
+
expect((await dataOnly.request('/rpc/relay')).status).toBe(404)
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('platform()', () => {
|
|
49
|
+
test('mounts platform routes and omits data routes', async () => {
|
|
50
|
+
const app = App.create({
|
|
51
|
+
auth: { session: { wallet: { origin: 'https://test.example' } } },
|
|
52
|
+
db: TestApp.database(),
|
|
53
|
+
kv: { store: Store.memory() },
|
|
54
|
+
}).route('/', platform())
|
|
55
|
+
|
|
56
|
+
const keys = await paths(app)
|
|
57
|
+
expect(keys.some((path) => path.startsWith('/v1/orgs'))).toBe(true)
|
|
58
|
+
expect(keys.some((path) => path.startsWith('/v1/me'))).toBe(true)
|
|
59
|
+
expect(keys.some((path) => path.startsWith('/v1/tokens'))).toBe(false)
|
|
60
|
+
expect(keys.some((path) => path.startsWith('/v1/blocks'))).toBe(false)
|
|
61
|
+
|
|
62
|
+
// The omitted data route resolves to a 404 (never mounted).
|
|
63
|
+
const token = await app.request('/v1/tokens/0x20c0000000000000000000000000000000000000')
|
|
64
|
+
expect(token.status).toBe(404)
|
|
65
|
+
})
|
|
66
|
+
})
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Hono } from 'hono'
|
|
2
|
+
import * as z from 'zod/mini'
|
|
3
|
+
|
|
4
|
+
import type * as Assets from '../../Assets.js'
|
|
5
|
+
import type * as App from '../../App.js'
|
|
6
|
+
import * as Metadata from '../metadata.js'
|
|
7
|
+
import * as Auth from '../../internal/Auth.js'
|
|
8
|
+
import * as Path from '../../internal/Path.js'
|
|
9
|
+
import * as Response from '../../internal/Response.js'
|
|
10
|
+
import * as Schema from '../../internal/Schema.js'
|
|
11
|
+
import * as Tidx from '../../internal/Tidx.js'
|
|
12
|
+
import * as Viem from '../../internal/Viem.js'
|
|
13
|
+
|
|
14
|
+
import { transactions as transactionActivities } from './routes/activities.js'
|
|
15
|
+
import { addresses } from './routes/addresses.js'
|
|
16
|
+
import { blocks, blocksByTimestampCompat } from './routes/blocks.js'
|
|
17
|
+
import { coingecko } from './routes/coingecko.js'
|
|
18
|
+
import { exchanges } from './routes/exchanges.js'
|
|
19
|
+
import { feeAmm } from './routes/fee-amm.js'
|
|
20
|
+
import { indexer } from './routes/indexer.js'
|
|
21
|
+
import { receipts } from './routes/receipts.js'
|
|
22
|
+
import { rpc } from './routes/rpc.js'
|
|
23
|
+
import { tokenlist } from './routes/tokenlist.js'
|
|
24
|
+
import { tokens } from './routes/tokens.js'
|
|
25
|
+
import { transactions } from './routes/transactions.js'
|
|
26
|
+
import { transfers } from './routes/transfers.js'
|
|
27
|
+
import { verifiedTokens } from './routes/verified-tokens.js'
|
|
28
|
+
import { schema as webhookSchema, webhooks } from './routes/webhooks.js'
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The chain-data route group: read endpoints over blocks, transactions, tokens,
|
|
32
|
+
* the exchange/fee-AMM, and the RPC/indexer passthroughs. It owns all chain
|
|
33
|
+
* configuration and publishes the chain clients on request context.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* App.create(options).route('/', data())
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function data(options: data.Options = {}) {
|
|
40
|
+
const { assets, defaultChainId = Viem.defaultChainId, rpc: rpc_option, tidx } = options
|
|
41
|
+
|
|
42
|
+
// The chain ids this deployment serves (built-in public chains plus
|
|
43
|
+
// `defaultChainId` and any explicit `supportedChainIds`). Published on context
|
|
44
|
+
// so handlers with a path `chainId` can guard it too.
|
|
45
|
+
const supportedChainIds = new Set<number>([
|
|
46
|
+
...Object.keys(Viem.url).map(Number),
|
|
47
|
+
...Object.keys(Tidx.url).map(Number),
|
|
48
|
+
defaultChainId,
|
|
49
|
+
...(options.supportedChainIds ?? []),
|
|
50
|
+
])
|
|
51
|
+
|
|
52
|
+
// Memoize one viem client per resolved upstream (stateless HTTP transports).
|
|
53
|
+
// Keying on the resolved output (`url`+`basicAuth`+`chainId`), not the
|
|
54
|
+
// principal, bounds cardinality by the number of distinct upstreams.
|
|
55
|
+
const clients = new Map<string, ReturnType<typeof Viem.getClient>>()
|
|
56
|
+
const getClient = (chainId = defaultChainId, principal: Auth.Principal | null = null) => {
|
|
57
|
+
const { url, basicAuth } = Viem.resolve(rpc_option, { chainId, principal })
|
|
58
|
+
const cacheKey = `${url}|${basicAuth ?? ''}|${chainId}`
|
|
59
|
+
const existing = clients.get(cacheKey)
|
|
60
|
+
if (existing) return existing
|
|
61
|
+
const client = Viem.getClient({ chainId, principal, rpc: rpc_option })
|
|
62
|
+
clients.set(cacheKey, client)
|
|
63
|
+
return client
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Memoize TIDX clients per `chainId` so the base URL resolver runs once per
|
|
67
|
+
// chain instead of on every request.
|
|
68
|
+
const getTidx = Tidx.createGetClient({ defaultChainId, tidx })
|
|
69
|
+
|
|
70
|
+
const app = new Hono<App.Environment>()
|
|
71
|
+
// Publish the chain-data context vars for this group's handlers. Runs after
|
|
72
|
+
// `App.create`'s middleware, so `getClient`/`getTidx` can key on the
|
|
73
|
+
// resolved principal and `getAsset` can read `basePath` off context.
|
|
74
|
+
.use('*', async (c, next) => {
|
|
75
|
+
c.set('chainId', defaultChainId)
|
|
76
|
+
c.set('getAsset', createGetAsset({ assets, basePath: c.get('basePath'), origin: new URL(c.req.url).origin })) // prettier-ignore
|
|
77
|
+
c.set('getClient', (chainId) => getClient(chainId, Auth.getPrincipal(c)))
|
|
78
|
+
c.set('getTidx', (chainId) => getTidx(chainId, Auth.getPrincipal(c)))
|
|
79
|
+
c.set('rpc', rpc_option)
|
|
80
|
+
c.set('supportedChainIds', supportedChainIds)
|
|
81
|
+
c.set('tidx', tidx)
|
|
82
|
+
c.set('verifiedTokens', options.verifiedTokens === false ? undefined : (options.verifiedTokens ?? {})) // prettier-ignore
|
|
83
|
+
c.set('webhook', options.webhook === false ? undefined : (options.webhook ?? {}))
|
|
84
|
+
await next()
|
|
85
|
+
})
|
|
86
|
+
// Reject a well-formed but unsupported `chainId` before it reaches an
|
|
87
|
+
// upstream, which would otherwise return an opaque `upstream_error`.
|
|
88
|
+
.use('*', async (c, next) => {
|
|
89
|
+
const raw = c.req.query('chainId') ?? c.req.query('chain_id')
|
|
90
|
+
if (raw === undefined) return next()
|
|
91
|
+
// Only reject a well-formed-but-unsupported chain here; malformed values
|
|
92
|
+
// (e.g. `abc`, `0`) fall through to the route's own query validation.
|
|
93
|
+
const parsed = Schema.ChainId.safeParse(raw)
|
|
94
|
+
if (!parsed.success || supportedChainIds.has(parsed.data)) return next()
|
|
95
|
+
return Response.unsupportedChainId(c, parsed.data, supportedChainIds)
|
|
96
|
+
})
|
|
97
|
+
// Serve static API assets (e.g. verified-token icons) from the configured
|
|
98
|
+
// store; a no-op fall-through when no store is configured (logo URIs simply
|
|
99
|
+
// go unresolved).
|
|
100
|
+
.use('/assets/*', async (c, next) => {
|
|
101
|
+
if (!assets) return next()
|
|
102
|
+
const key = stripAssetPath(c.req.path, c.get('basePath')).replace(/^\/+/, '')
|
|
103
|
+
const asset = key ? await assets.get(key) : undefined
|
|
104
|
+
if (!asset) return next()
|
|
105
|
+
return c.body(asset.body, 200, {
|
|
106
|
+
'Cache-Control': 'public, max-age=86400',
|
|
107
|
+
'Content-Type': asset.contentType,
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
.route('/', addresses())
|
|
111
|
+
.route('/', blocks())
|
|
112
|
+
.route('/', exchanges())
|
|
113
|
+
.route('/', feeAmm())
|
|
114
|
+
.route('/', indexer())
|
|
115
|
+
.route('/', receipts())
|
|
116
|
+
.route('/', tokenlist())
|
|
117
|
+
.route('/', tokens())
|
|
118
|
+
.route('/', transactions())
|
|
119
|
+
.route('/', transactionActivities())
|
|
120
|
+
.route('/', transfers())
|
|
121
|
+
.route('/', verifiedTokens())
|
|
122
|
+
.route('/', webhooks({ enabled: options.webhook !== false }))
|
|
123
|
+
.route('/', rpc())
|
|
124
|
+
.route('/', coingecko())
|
|
125
|
+
.route('/', blocksByTimestampCompat())
|
|
126
|
+
return Metadata.attach(app, openapi)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export declare namespace data {
|
|
130
|
+
/** Options for the data route group. */
|
|
131
|
+
type Options = {
|
|
132
|
+
/** Static API asset store for the current runtime (e.g. `Assets.cloudflareR2(...)`). Omit to skip static assets — token logo URIs go unresolved. */
|
|
133
|
+
assets?: Assets.Assets | undefined
|
|
134
|
+
/** Default Tempo chain id for requests that omit `chainId`. */
|
|
135
|
+
defaultChainId?: Viem.ChainId | undefined
|
|
136
|
+
/** Tempo RPC options: a static config, or a per-request resolver that routes by request principal to a separate (e.g. public, no-auth) RPC. */
|
|
137
|
+
rpc?: Viem.getClient.Rpc | undefined
|
|
138
|
+
/** Extra chain ids this deployment serves, beyond the built-in public chains and `defaultChainId`. A `chainId` outside this set is rejected with a 400. */
|
|
139
|
+
supportedChainIds?: readonly number[] | undefined
|
|
140
|
+
/** TIDX query client options. */
|
|
141
|
+
tidx?: Tidx.getClient.Tidx | undefined
|
|
142
|
+
/** Verified-token feature configuration. Enabled by default (token rows live in `db`; empty until published); pass `false` to always serve an empty verified list. */
|
|
143
|
+
verifiedTokens?: VerifiedTokens | false | undefined
|
|
144
|
+
/** Webhook feature configuration. Enabled by default (rows live in `db`); pass `false` to disable, leaving `/webhooks` mounted but returning `404` and hidden from the OpenAPI document. */
|
|
145
|
+
webhook?: Webhook | false | undefined
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Verified-token feature configuration. */
|
|
149
|
+
type VerifiedTokens = {
|
|
150
|
+
/**
|
|
151
|
+
* Per-isolate soft-refresh window (ms). Lookups serve from the in-memory
|
|
152
|
+
* snapshot within it; after it, the next lookup re-checks the head version
|
|
153
|
+
* and recompiles only on change. Defaults to 10_000.
|
|
154
|
+
*/
|
|
155
|
+
refreshMs?: number | undefined
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Webhook feature configuration. */
|
|
159
|
+
type Webhook = {
|
|
160
|
+
/**
|
|
161
|
+
* Maximum active subscriptions per owner; creation is rejected with
|
|
162
|
+
* `403 limit_exceeded` once reached. Defaults to 100, bounding the spam/SSRF
|
|
163
|
+
* and delivery-cost surface per owner.
|
|
164
|
+
*/
|
|
165
|
+
maxPerOwner?: number | undefined
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The OpenAPI metadata this group owns: its operation tags and the outbound
|
|
171
|
+
* `webhooks` block. Tagged onto the {@link data} instance so `App.create`
|
|
172
|
+
* collects it; the webhooks block emits only when webhook routes are mounted.
|
|
173
|
+
*/
|
|
174
|
+
const openapi = {
|
|
175
|
+
tags: [
|
|
176
|
+
{ name: 'Activities', description: 'A readable feed of what an account did onchain.' },
|
|
177
|
+
{ name: 'Balances', description: 'How much of each token an account holds.' },
|
|
178
|
+
{ name: 'Blocks', description: 'The ordered batches of transactions making up the chain.' },
|
|
179
|
+
{ name: 'Exchange', description: "Tempo's built-in stablecoin exchange: pairs, swaps, orders, prices." }, // prettier-ignore
|
|
180
|
+
{ name: 'Fee AMM', description: 'Pools that convert stablecoins to pay fees.' },
|
|
181
|
+
{ name: 'Tokens', description: 'TIP-20 token details, supply, and holders.' },
|
|
182
|
+
{ name: 'Transactions', description: 'Transactions submitted to Tempo, and their receipts.' },
|
|
183
|
+
{ name: 'Transfers', description: 'Token movements from executing transactions.' },
|
|
184
|
+
{ name: 'Verified Tokens', description: 'A curated, trusted list of TIP-20 tokens.' },
|
|
185
|
+
{ name: 'Webhooks', description: 'Get signed callbacks when onchain events happen.' },
|
|
186
|
+
{ name: 'Indexer', description: "Run read-only SQL queries against Tempo's indexed data." },
|
|
187
|
+
{ name: 'RPC', description: 'Direct access to the chain over Ethereum JSON-RPC. Not part of the stable API contract; best-effort support only. No compatibility, latency, availability, or data-freshness guarantees. Breaking changes may happen with limited notice.' }, // prettier-ignore
|
|
188
|
+
{ name: 'CoinGecko', description: "Exchange data in CoinGecko's GeckoTerminal format." },
|
|
189
|
+
],
|
|
190
|
+
'x-tagGroups': [
|
|
191
|
+
{
|
|
192
|
+
name: 'Data API',
|
|
193
|
+
tags: [
|
|
194
|
+
'Activities',
|
|
195
|
+
'Balances',
|
|
196
|
+
'Blocks',
|
|
197
|
+
'Exchange',
|
|
198
|
+
'Fee AMM',
|
|
199
|
+
'Tokens',
|
|
200
|
+
'Transactions',
|
|
201
|
+
'Transfers',
|
|
202
|
+
'Verified Tokens',
|
|
203
|
+
'Webhooks',
|
|
204
|
+
'Indexer',
|
|
205
|
+
'RPC',
|
|
206
|
+
'CoinGecko',
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
webhooks: webhooksBlock,
|
|
211
|
+
} satisfies App.create.Metadata
|
|
212
|
+
|
|
213
|
+
// Builds the outbound-delivery `webhooks` block. `io: 'output'` documents the
|
|
214
|
+
// serialized shape; `unrepresentable: 'any'` emits `{}` for payload transforms
|
|
215
|
+
// (e.g. lazy fee-token metadata) that have no JSON-Schema form.
|
|
216
|
+
function webhooksBlock() {
|
|
217
|
+
const envelope = z.toJSONSchema(webhookSchema.Envelope, {
|
|
218
|
+
io: 'output',
|
|
219
|
+
target: 'draft-2020-12',
|
|
220
|
+
unrepresentable: 'any',
|
|
221
|
+
})
|
|
222
|
+
delete envelope.$schema
|
|
223
|
+
const header = (name: string, description: string) => ({
|
|
224
|
+
description,
|
|
225
|
+
in: 'header' as const,
|
|
226
|
+
name,
|
|
227
|
+
required: true,
|
|
228
|
+
schema: { type: 'string' as const },
|
|
229
|
+
})
|
|
230
|
+
return {
|
|
231
|
+
event: {
|
|
232
|
+
post: {
|
|
233
|
+
description:
|
|
234
|
+
'When an event you subscribed to happens, Tempo sends this signed message to your webhook URL as an HTTP POST (the same shape is used by `POST /webhooks/:id/ping` so you can test your endpoint). Always verify the `tempo-signature` header before trusting the body, then reply with any 2xx status to confirm you received it. If your endpoint returns a non-2xx status, times out, or redirects, Tempo retries with increasing delays; an endpoint that keeps failing is eventually disabled.',
|
|
235
|
+
parameters: [
|
|
236
|
+
header(
|
|
237
|
+
'tempo-signature',
|
|
238
|
+
'Signature proving the message really came from Tempo. An HMAC-SHA256 of the body using your webhook secret, formatted `t=<unix>,v1=<hex>`. Verify this before trusting the payload.',
|
|
239
|
+
),
|
|
240
|
+
header(
|
|
241
|
+
'tempo-event-id',
|
|
242
|
+
'A unique, stable id for this event (`evt_…`). The same event may be delivered more than once, so use this id to skip duplicates.',
|
|
243
|
+
),
|
|
244
|
+
header('tempo-event-type', 'What happened: `token:transfer`, `transaction:included`, `log:emitted`, `block:created`, or `ping`.'), // prettier-ignore
|
|
245
|
+
],
|
|
246
|
+
requestBody: {
|
|
247
|
+
content: { 'application/json': { schema: envelope } },
|
|
248
|
+
required: true,
|
|
249
|
+
},
|
|
250
|
+
responses: { '2xx': { description: 'Delivery acknowledged.' } },
|
|
251
|
+
summary: 'Webhook event delivery',
|
|
252
|
+
tags: ['Webhooks'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Builds the per-request static-asset resolver. The store is keyed by
|
|
259
|
+
// `:chainId/:path` (decoupled from the public `/assets/:chainId` URL) and
|
|
260
|
+
// returns absolute URLs against the request origin. Without a store, every
|
|
261
|
+
// lookup misses and callers fall back to undefined logo URIs.
|
|
262
|
+
function createGetAsset(options: createGetAsset.Options): App.GetAsset {
|
|
263
|
+
const { assets, basePath, origin } = options
|
|
264
|
+
if (!assets) return () => undefined
|
|
265
|
+
return async (chainId, path) => {
|
|
266
|
+
const pathname = Path.join(basePath, 'assets', String(chainId), path)
|
|
267
|
+
// `path` may be absolute (`Path.join` returns a leading slash); strip it so
|
|
268
|
+
// the key is `:chainId/:path`, not `:chainId//:path`.
|
|
269
|
+
const key = `${chainId}/${path.replace(/^\/+/, '')}`
|
|
270
|
+
const asset = await assets.get(key)
|
|
271
|
+
if (!asset) return undefined
|
|
272
|
+
return {
|
|
273
|
+
response: new globalThis.Response(asset.body, {
|
|
274
|
+
headers: { 'Content-Type': asset.contentType },
|
|
275
|
+
}),
|
|
276
|
+
uri: new URL(pathname, origin).toString(),
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare namespace createGetAsset {
|
|
282
|
+
type Options = {
|
|
283
|
+
assets?: Assets.Assets | undefined
|
|
284
|
+
basePath: string
|
|
285
|
+
origin: string
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Strips the (possibly base-path-prefixed) `/assets/` segment so the remainder
|
|
290
|
+
// is the store key path.
|
|
291
|
+
function stripAssetPath(path: string, basePath: string) {
|
|
292
|
+
for (const prefix of [`${Path.join(basePath, 'assets')}/`, '/assets/'])
|
|
293
|
+
if (path.startsWith(prefix)) return `/${path.slice(prefix.length)}`
|
|
294
|
+
return path
|
|
295
|
+
}
|
|
@@ -2,9 +2,9 @@ import { Address, Hex } from 'ox'
|
|
|
2
2
|
import { encodeAbiParameters, encodeEventTopics } from 'viem'
|
|
3
3
|
import { Abis } from 'viem/tempo'
|
|
4
4
|
|
|
5
|
-
import * as TestApp from '
|
|
6
|
-
import * as Runtime from '
|
|
7
|
-
import * as Store from '
|
|
5
|
+
import * as TestApp from '../../../../test/App.js'
|
|
6
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
7
|
+
import * as Store from '../../../internal/Store.js'
|
|
8
8
|
import * as Activities from './activities.js'
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -4,19 +4,19 @@ import { type Log, parseEventLogs, zeroAddress } from 'viem'
|
|
|
4
4
|
import { Abis, Addresses } from 'viem/tempo'
|
|
5
5
|
import * as z from 'zod/mini'
|
|
6
6
|
|
|
7
|
-
import type * as App from '
|
|
8
|
-
import * as Auth from '
|
|
9
|
-
import * as Cache from '
|
|
10
|
-
import * as Cursor from '
|
|
11
|
-
import * as Mpp from '
|
|
12
|
-
import * as OpenApi from '
|
|
13
|
-
import * as Response from '
|
|
14
|
-
import * as Schema from '
|
|
15
|
-
import * as Store from '
|
|
16
|
-
import type * as Tidx from '
|
|
17
|
-
import * as Timing from '
|
|
18
|
-
import * as Ttl from '
|
|
19
|
-
import * as Value from '
|
|
7
|
+
import type * as App from '../../../App.js'
|
|
8
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
9
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
10
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
11
|
+
import * as Mpp from '../../../internal/Mpp.js'
|
|
12
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
13
|
+
import * as Response from '../../../internal/Response.js'
|
|
14
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
15
|
+
import * as Store from '../../../internal/Store.js'
|
|
16
|
+
import type * as Tidx from '../../../internal/Tidx.js'
|
|
17
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
18
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
19
|
+
import * as Value from '../../../internal/Value.js'
|
|
20
20
|
import * as Tokens from './tokens.js'
|
|
21
21
|
import * as Transfers from './transfers.js'
|
|
22
22
|
|
|
@@ -1667,7 +1667,7 @@ type TxGroup = {
|
|
|
1667
1667
|
*/
|
|
1668
1668
|
export function addresses() {
|
|
1669
1669
|
return new Hono<App.Environment>().get(
|
|
1670
|
-
'/:address/activities',
|
|
1670
|
+
'/v1/addresses/:address/activities',
|
|
1671
1671
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1672
1672
|
OpenApi.validate('param', schema.getAddressActivities.Params, {
|
|
1673
1673
|
code: 'address_invalid',
|
|
@@ -1775,7 +1775,7 @@ export function addresses() {
|
|
|
1775
1775
|
*/
|
|
1776
1776
|
export function transactions() {
|
|
1777
1777
|
return new Hono<App.Environment>().get(
|
|
1778
|
-
'/:transactionHash/activities',
|
|
1778
|
+
'/v1/transactions/:transactionHash/activities',
|
|
1779
1779
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1780
1780
|
OpenApi.validate('param', schema.getTransactionActivities.Params, {
|
|
1781
1781
|
code: 'transaction_invalid',
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Hono } from 'hono'
|
|
2
2
|
|
|
3
|
-
import type * as App from '
|
|
3
|
+
import type * as App from '../../../App.js'
|
|
4
4
|
import * as Activities from './activities.js'
|
|
5
5
|
import * as Balances from './balances.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Composes the `/addresses/:address/*` route surface from the
|
|
9
|
-
* sub-routers exported by each resource module. The handlers
|
|
10
|
-
* with the resource they describe (activities,
|
|
11
|
-
*
|
|
12
|
-
* stay nested under the parent resource.
|
|
8
|
+
* Composes the `/v1/addresses/:address/*` route surface from the
|
|
9
|
+
* address-scoped sub-routers exported by each resource module. The handlers,
|
|
10
|
+
* schemas, and paths live with the resource they describe (activities,
|
|
11
|
+
* balances); this composer only aggregates them so docs grouping stays by tag
|
|
12
|
+
* while URLs stay nested under the parent resource.
|
|
13
13
|
*
|
|
14
14
|
* Only subject-relative resources live here — rows that cannot be interpreted
|
|
15
15
|
* without the path address (activity classification, held-token balances).
|