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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Schema } from '
|
|
1
|
+
import { Schema } from 'tapimo'
|
|
2
2
|
import { Value as core_Value } from 'ox'
|
|
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 Balances from './balances.js'
|
|
7
7
|
import * as Tokens from './tokens.js'
|
|
8
8
|
|
|
@@ -12,9 +12,10 @@ import * as Tokens from './tokens.js'
|
|
|
12
12
|
// verified tokens the bundle used to provide; a test can still override
|
|
13
13
|
// `verifiedTokens`.
|
|
14
14
|
const runtime = Runtime.get()
|
|
15
|
-
const
|
|
15
|
+
const db = TestApp.database()
|
|
16
|
+
await TestApp.verifiedSeed(db, runtime.chainId)
|
|
16
17
|
function app(options: TestApp.create.Options = {}) {
|
|
17
|
-
return TestApp.client({
|
|
18
|
+
return TestApp.client({ db, ...options })
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
async function holderWithBalance(client: ReturnType<typeof app>) {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { Hono, type Context } from 'hono'
|
|
2
2
|
import { Hex, Value as core_Value } from 'ox'
|
|
3
|
+
import { Actions } from 'viem/tempo'
|
|
3
4
|
import * as z from 'zod/mini'
|
|
4
5
|
|
|
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 Timing from '
|
|
13
|
-
import * as Value from '
|
|
14
|
-
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 Response from '../../../internal/Response.js'
|
|
12
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
13
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
14
|
+
import * as Value from '../../../internal/Value.js'
|
|
15
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
15
16
|
import * as FeeAmm from './fee-amm.js'
|
|
16
17
|
import * as Tokens from './tokens.js'
|
|
17
18
|
|
|
@@ -150,7 +151,7 @@ export namespace schema {
|
|
|
150
151
|
*/
|
|
151
152
|
export function addresses() {
|
|
152
153
|
return new Hono<App.Environment>().get(
|
|
153
|
-
'/:address/balances',
|
|
154
|
+
'/v1/addresses/:address/balances',
|
|
154
155
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
155
156
|
OpenApi.validate('param', schema.getAddressBalances.Params, {
|
|
156
157
|
code: 'address_invalid',
|
|
@@ -353,6 +354,39 @@ async function getAddressBalances(
|
|
|
353
354
|
|
|
354
355
|
if (holdings.data.length === 0) return { data: [], nextCursor: holdings.nextCursor }
|
|
355
356
|
|
|
357
|
+
const client = c.get('getClient')(chainId)
|
|
358
|
+
// TODO: remove once https://github.com/tempoxyz/tidx/commit/2f37b44172d381fd00234ef23f79ed1e1d69c470 deployed.
|
|
359
|
+
const corrected = await Timing.time(c, 'balances_rpc', async () => {
|
|
360
|
+
const results = await client
|
|
361
|
+
.multicall({
|
|
362
|
+
allowFailure: true,
|
|
363
|
+
contracts: holdings.data.map((holding) =>
|
|
364
|
+
Actions.token.getBalance.call(client, { account: address, token: holding.address }),
|
|
365
|
+
),
|
|
366
|
+
})
|
|
367
|
+
.catch(() => undefined)
|
|
368
|
+
|
|
369
|
+
const rows: { address: Hex.Hex; amount: string }[] = []
|
|
370
|
+
for (const [index, holding] of holdings.data.entries()) {
|
|
371
|
+
const result = results?.[index]
|
|
372
|
+
if (!result || result.status !== 'success' || typeof result.result !== 'bigint') {
|
|
373
|
+
rows.push(holding)
|
|
374
|
+
continue
|
|
375
|
+
}
|
|
376
|
+
if (result.result === 0n) continue
|
|
377
|
+
rows.push({ address: holding.address, amount: result.result.toString() })
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
rows.sort((a, b) => {
|
|
381
|
+
const delta = BigInt(b.amount) - BigInt(a.amount)
|
|
382
|
+
if (delta !== 0n) return delta > 0n ? 1 : -1
|
|
383
|
+
return a.address < b.address ? -1 : a.address > b.address ? 1 : 0
|
|
384
|
+
})
|
|
385
|
+
return rows
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
if (corrected.length === 0) return { data: [], nextCursor: holdings.nextCursor }
|
|
389
|
+
|
|
356
390
|
// Resolve token metadata for each balance. The endpoint's contract is a
|
|
357
391
|
// balance with its `token` reference inlined per row (and `formatted` needs
|
|
358
392
|
// the token `decimals`), so a row whose metadata cannot be resolved is
|
|
@@ -365,7 +399,7 @@ async function getAddressBalances(
|
|
|
365
399
|
// so it is never fetched here.
|
|
366
400
|
const resolved = await Timing.time(c, 'tokens', () =>
|
|
367
401
|
Promise.all(
|
|
368
|
-
|
|
402
|
+
corrected.map((holding) =>
|
|
369
403
|
Tokens.resolveToken(c, {
|
|
370
404
|
address: holding.address,
|
|
371
405
|
chainId,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Schema } from '
|
|
1
|
+
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 Blocks from './blocks.js'
|
|
9
9
|
import * as Transactions from './transactions.js'
|
|
10
10
|
|
|
@@ -2,17 +2,17 @@ import { Hono, type Context, type MiddlewareHandler } 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 * as Timing from '
|
|
14
|
-
import * as Ttl from '
|
|
15
|
-
import * as Value 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 * as Timing from '../../../internal/Timing.js'
|
|
14
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
15
|
+
import * as Value from '../../../internal/Value.js'
|
|
16
16
|
|
|
17
17
|
/** Example block number surfaced in OpenAPI docs. */
|
|
18
18
|
const exampleBlockNumber = '1000000'
|
|
@@ -382,7 +382,7 @@ export function blocks() {
|
|
|
382
382
|
|
|
383
383
|
return new Hono<App.Environment>()
|
|
384
384
|
.get(
|
|
385
|
-
'/',
|
|
385
|
+
'/v1/blocks',
|
|
386
386
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
387
387
|
OpenApi.validate('query', schema.getBlocks.Query, {
|
|
388
388
|
code: 'query_invalid',
|
|
@@ -425,7 +425,7 @@ export function blocks() {
|
|
|
425
425
|
},
|
|
426
426
|
)
|
|
427
427
|
.get(
|
|
428
|
-
'/:block',
|
|
428
|
+
'/v1/blocks/:block',
|
|
429
429
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
430
430
|
OpenApi.validate('param', schema.getBlock.Params, {
|
|
431
431
|
code: 'block_invalid',
|
|
@@ -590,7 +590,7 @@ export function blocks() {
|
|
|
590
590
|
*/
|
|
591
591
|
export function blocksByTimestampCompat() {
|
|
592
592
|
return new Hono<App.Environment>().get(
|
|
593
|
-
'/:chainId/blocks/by-timestamp',
|
|
593
|
+
'/chains/:chainId/blocks/by-timestamp',
|
|
594
594
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
595
595
|
OpenApi.validate('param', schema.getBlockByTimestamp.Params, {
|
|
596
596
|
code: 'chain_id_invalid',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address, Hash } from 'ox'
|
|
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 Coingecko from './coingecko.js'
|
|
6
6
|
|
|
7
7
|
// The adapter addresses the chain positionally, mirroring the legacy `/gecko`
|
|
@@ -5,14 +5,14 @@ import { type Address as ViemAddress, formatUnits } from 'viem'
|
|
|
5
5
|
import { Addresses, Tick } from 'viem/tempo'
|
|
6
6
|
import * as z from 'zod/mini'
|
|
7
7
|
|
|
8
|
-
import type * as App from '
|
|
9
|
-
import * as Auth from '
|
|
10
|
-
import * as Cache from '
|
|
11
|
-
import * as OpenApi from '
|
|
12
|
-
import * as Response from '
|
|
13
|
-
import * as Schema from '
|
|
14
|
-
import * as Timing from '
|
|
15
|
-
import * as Value from '
|
|
8
|
+
import type * as App from '../../../App.js'
|
|
9
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
10
|
+
import * as Cache from '../../../internal/Cache.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 Timing from '../../../internal/Timing.js'
|
|
15
|
+
import * as Value from '../../../internal/Value.js'
|
|
16
16
|
import { resolveBookQuotes, resolveBookReserves, resolveOrderStates } from './exchanges.js'
|
|
17
17
|
import { getTokenMetadata } from './tokens.js'
|
|
18
18
|
|
|
@@ -484,9 +484,9 @@ const guardChainId = createMiddleware<App.Environment>(async (c, next) => {
|
|
|
484
484
|
|
|
485
485
|
export function coingecko() {
|
|
486
486
|
return new Hono<App.Environment>()
|
|
487
|
-
.use('/:chainId/*', guardChainId)
|
|
487
|
+
.use('/gecko/:chainId/*', guardChainId)
|
|
488
488
|
.get(
|
|
489
|
-
'/:chainId/latest-block',
|
|
489
|
+
'/gecko/:chainId/latest-block',
|
|
490
490
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
491
491
|
OpenApi.validate('param', schema.ChainIdParam, {
|
|
492
492
|
code: 'chain_id_invalid',
|
|
@@ -527,7 +527,7 @@ export function coingecko() {
|
|
|
527
527
|
},
|
|
528
528
|
)
|
|
529
529
|
.get(
|
|
530
|
-
'/:chainId/assets/:address',
|
|
530
|
+
'/gecko/:chainId/assets/:address',
|
|
531
531
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
532
532
|
OpenApi.validate('param', schema.AssetParams, {
|
|
533
533
|
code: 'address_invalid',
|
|
@@ -578,7 +578,7 @@ export function coingecko() {
|
|
|
578
578
|
},
|
|
579
579
|
)
|
|
580
580
|
.get(
|
|
581
|
-
'/:chainId/pairs',
|
|
581
|
+
'/gecko/:chainId/pairs',
|
|
582
582
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
583
583
|
OpenApi.validate('param', schema.ChainIdParam, {
|
|
584
584
|
code: 'chain_id_invalid',
|
|
@@ -649,7 +649,7 @@ export function coingecko() {
|
|
|
649
649
|
},
|
|
650
650
|
)
|
|
651
651
|
.get(
|
|
652
|
-
'/:chainId/pairs/:pairId',
|
|
652
|
+
'/gecko/:chainId/pairs/:pairId',
|
|
653
653
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
654
654
|
OpenApi.validate('param', schema.PairParams, {
|
|
655
655
|
code: 'pair_id_invalid',
|
|
@@ -711,7 +711,7 @@ export function coingecko() {
|
|
|
711
711
|
},
|
|
712
712
|
)
|
|
713
713
|
.get(
|
|
714
|
-
'/:chainId/events',
|
|
714
|
+
'/gecko/:chainId/events',
|
|
715
715
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
716
716
|
OpenApi.validate('param', schema.ChainIdParam, {
|
|
717
717
|
code: 'chain_id_invalid',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as z from 'zod/mini'
|
|
2
|
-
import { Schema } from '
|
|
2
|
+
import { Schema } from 'tapimo'
|
|
3
3
|
|
|
4
|
-
import * as TestApp from '
|
|
4
|
+
import * as TestApp from '../../../../test/App.js'
|
|
5
5
|
import * as Exchanges from './exchanges.js'
|
|
6
6
|
|
|
7
7
|
type OrdersResponse = z.output<typeof Exchanges.schema.getOrders.Response>
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
import { Actions, Addresses, Tick } from 'viem/tempo'
|
|
11
11
|
import * as z from 'zod/mini'
|
|
12
12
|
|
|
13
|
-
import type * as App from '
|
|
14
|
-
import * as Auth from '
|
|
15
|
-
import * as Cache from '
|
|
16
|
-
import * as Cursor from '
|
|
17
|
-
import * as OpenApi from '
|
|
18
|
-
import * as Response from '
|
|
19
|
-
import * as Schema from '
|
|
20
|
-
import * as Store from '
|
|
21
|
-
import * as Timing from '
|
|
22
|
-
import * as Ttl from '
|
|
23
|
-
import * as Value from '
|
|
24
|
-
import * as VerifiedTokens from '
|
|
13
|
+
import type * as App from '../../../App.js'
|
|
14
|
+
import * as Auth from '../../../internal/Auth.js'
|
|
15
|
+
import * as Cache from '../../../internal/Cache.js'
|
|
16
|
+
import * as Cursor from '../../../internal/Cursor.js'
|
|
17
|
+
import * as OpenApi from '../../../internal/OpenApi.js'
|
|
18
|
+
import * as Response from '../../../internal/Response.js'
|
|
19
|
+
import * as Schema from '../../../internal/Schema.js'
|
|
20
|
+
import * as Store from '../../../internal/Store.js'
|
|
21
|
+
import * as Timing from '../../../internal/Timing.js'
|
|
22
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
23
|
+
import * as Value from '../../../internal/Value.js'
|
|
24
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
25
25
|
import * as Tokens from './tokens.js'
|
|
26
26
|
|
|
27
27
|
// Stablecoin DEX precompile. Pair lifecycle is announced by `PairCreated` from
|
|
@@ -1312,7 +1312,7 @@ export namespace schema {
|
|
|
1312
1312
|
export function exchanges() {
|
|
1313
1313
|
return new Hono<App.Environment>()
|
|
1314
1314
|
.get(
|
|
1315
|
-
'/swaps',
|
|
1315
|
+
'/v1/exchange/swaps',
|
|
1316
1316
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1317
1317
|
OpenApi.validate('query', schema.getSwaps.Query, {
|
|
1318
1318
|
code: 'query_invalid',
|
|
@@ -1422,7 +1422,7 @@ export function exchanges() {
|
|
|
1422
1422
|
},
|
|
1423
1423
|
)
|
|
1424
1424
|
.get(
|
|
1425
|
-
'/pairs',
|
|
1425
|
+
'/v1/exchange/pairs',
|
|
1426
1426
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1427
1427
|
OpenApi.validate('query', schema.getPairs.Query, {
|
|
1428
1428
|
code: 'query_invalid',
|
|
@@ -1529,7 +1529,7 @@ export function exchanges() {
|
|
|
1529
1529
|
.get(
|
|
1530
1530
|
// Single trading pair detail. The base address alone identifies the
|
|
1531
1531
|
// pair (its quote is intrinsic to the base token on-chain).
|
|
1532
|
-
'/pairs/:base',
|
|
1532
|
+
'/v1/exchange/pairs/:base',
|
|
1533
1533
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1534
1534
|
OpenApi.validate('param', schema.getPair.Params, {
|
|
1535
1535
|
code: 'pair_invalid',
|
|
@@ -1622,7 +1622,7 @@ export function exchanges() {
|
|
|
1622
1622
|
)
|
|
1623
1623
|
.get(
|
|
1624
1624
|
// Resting-order feed, optionally scoped to one pair via `base`.
|
|
1625
|
-
'/orders',
|
|
1625
|
+
'/v1/exchange/orders',
|
|
1626
1626
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1627
1627
|
OpenApi.validate('query', schema.getOrders.Query, {
|
|
1628
1628
|
code: 'query_invalid',
|
|
@@ -1747,7 +1747,7 @@ export function exchanges() {
|
|
|
1747
1747
|
.get(
|
|
1748
1748
|
// Single-order detail. The path-param schema rejects non-decimal
|
|
1749
1749
|
// `orderId` values, surfacing the canonical `order_invalid` error.
|
|
1750
|
-
'/orders/:orderId',
|
|
1750
|
+
'/v1/exchange/orders/:orderId',
|
|
1751
1751
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1752
1752
|
OpenApi.validate('param', schema.getOrder.Params, {
|
|
1753
1753
|
code: 'order_invalid',
|
|
@@ -1856,7 +1856,7 @@ export function exchanges() {
|
|
|
1856
1856
|
)
|
|
1857
1857
|
.get(
|
|
1858
1858
|
// Paginated fill history for a single order.
|
|
1859
|
-
'/orders/:orderId/fills',
|
|
1859
|
+
'/v1/exchange/orders/:orderId/fills',
|
|
1860
1860
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1861
1861
|
OpenApi.validate('param', schema.getOrderFills.Params, {
|
|
1862
1862
|
code: 'order_invalid',
|
|
@@ -1945,7 +1945,7 @@ export function exchanges() {
|
|
|
1945
1945
|
.get(
|
|
1946
1946
|
// OHLC (candlestick) aggregations for a single pair, addressed by its
|
|
1947
1947
|
// base token.
|
|
1948
|
-
'/pairs/:base/ohlc',
|
|
1948
|
+
'/v1/exchange/pairs/:base/ohlc',
|
|
1949
1949
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
1950
1950
|
OpenApi.validate('param', schema.getPairOhlc.Params, {
|
|
1951
1951
|
code: 'pair_invalid',
|
|
@@ -2053,7 +2053,7 @@ export function exchanges() {
|
|
|
2053
2053
|
.get(
|
|
2054
2054
|
// Orderbook depth (cumulative size per tick) for a single pair,
|
|
2055
2055
|
// addressed by its base token.
|
|
2056
|
-
'/pairs/:base/depth',
|
|
2056
|
+
'/v1/exchange/pairs/:base/depth',
|
|
2057
2057
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
2058
2058
|
OpenApi.validate('param', schema.getPairDepth.Params, {
|
|
2059
2059
|
code: 'pair_invalid',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Abis, Addresses } from 'viem/tempo'
|
|
2
2
|
|
|
3
|
-
import * as TestApp from '
|
|
4
|
-
import * as Runtime from '
|
|
5
|
-
import * as TestViem from '
|
|
3
|
+
import * as TestApp from '../../../../test/App.js'
|
|
4
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
5
|
+
import * as TestViem from '../../../../test/Viem.js'
|
|
6
6
|
import * as FeeAmm from './fee-amm.js'
|
|
7
7
|
|
|
8
8
|
/** Validator-side token with live fee-AMM activity on Tempo Moderato. */
|
|
@@ -3,18 +3,18 @@ import { AbiEvent, AbiParameters, Hash, type Hex, Value as core_Value } from 'ox
|
|
|
3
3
|
import { Abis, 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 OpenApi from '
|
|
11
|
-
import * as Response from '
|
|
12
|
-
import * as Schema from '
|
|
13
|
-
import * as Store from '
|
|
14
|
-
import * as Timing from '
|
|
15
|
-
import * as Ttl from '
|
|
16
|
-
import * as Value from '
|
|
17
|
-
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 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'
|
|
17
|
+
import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
|
|
18
18
|
import * as Tokens from './tokens.js'
|
|
19
19
|
|
|
20
20
|
// The protocol Fee AMM lives at the reserved FeeManager address. Pools are
|
|
@@ -308,7 +308,7 @@ export namespace schema {
|
|
|
308
308
|
export function feeAmm() {
|
|
309
309
|
return new Hono<App.Environment>()
|
|
310
310
|
.get(
|
|
311
|
-
'/pools',
|
|
311
|
+
'/v1/fee-amm/pools',
|
|
312
312
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
313
313
|
OpenApi.validate('query', schema.getFeeAmmPools.Query, {
|
|
314
314
|
code: 'query_invalid',
|
|
@@ -420,7 +420,7 @@ export function feeAmm() {
|
|
|
420
420
|
},
|
|
421
421
|
)
|
|
422
422
|
.get(
|
|
423
|
-
'/mints',
|
|
423
|
+
'/v1/fee-amm/mints',
|
|
424
424
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
425
425
|
OpenApi.validate('query', schema.getFeeAmmMints.Query, {
|
|
426
426
|
code: 'query_invalid',
|
|
@@ -520,8 +520,8 @@ export function feeAmm() {
|
|
|
520
520
|
* Discovers fee pools by aggregating the FeeManager's `Mint` logs into one
|
|
521
521
|
* row per `(userToken, validatorToken)` pair, paginated and ordered by mint
|
|
522
522
|
* count (most active first), so the real fee pools (thousands to millions of
|
|
523
|
-
* mints) lead the head pages and the
|
|
524
|
-
*
|
|
523
|
+
* mints) lead the head pages and the spam pairs (mint count 1) sink to the
|
|
524
|
+
* tail.
|
|
525
525
|
*
|
|
526
526
|
* Keyset pagination on `(mint_count, topic2, topic3)`: `mint_count` ranks the
|
|
527
527
|
* page (mutable — it grows as pools mint — so this is best-effort across mint
|
|
@@ -568,7 +568,7 @@ function listPools(c: Context<App.Environment>, options: listPools.Options) {
|
|
|
568
568
|
|
|
569
569
|
// Raw-`logs` ClickHouse aggregate (dynamic query, hence the cast):
|
|
570
570
|
// ordering is by mint count so the head pages surface the real fee
|
|
571
|
-
// pools and the
|
|
571
|
+
// pools and the single-mint spam pairs sink to the tail. Fetch one extra
|
|
572
572
|
// row to detect `hasMore` without a separate count query.
|
|
573
573
|
const result = await tidx.fetch({
|
|
574
574
|
chainId,
|
|
@@ -669,7 +669,7 @@ declare namespace listPools {
|
|
|
669
669
|
* Addresses are lowercased to match the indexer's stored casing.
|
|
670
670
|
*
|
|
671
671
|
* The set is intentionally gated to the verified list rather than every pooled
|
|
672
|
-
* token: anyone can mint a
|
|
672
|
+
* token: anyone can mint a single-mint spam pool, so the raw set of pool
|
|
673
673
|
* `userToken`s is unbounded (tens of thousands on busy chains) and those
|
|
674
674
|
* liquidity-less pools can't actually settle fees. Restricting to verified
|
|
675
675
|
* tokens keeps the set small (a handful of USD stablecoins), bounds the scan
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RateLimit, Store } from '
|
|
2
|
-
import * as TestApp from '
|
|
3
|
-
import * as Mppx from '
|
|
4
|
-
import * as Runtime from '
|
|
5
|
-
import * as Tempo from '
|
|
6
|
-
import * as Tidx from '
|
|
1
|
+
import { RateLimit, Store } from 'tapimo'
|
|
2
|
+
import * as TestApp from '../../../../test/App.js'
|
|
3
|
+
import * as Mppx from '../../../../test/Mppx.js'
|
|
4
|
+
import * as Runtime from '../../../../test/runtime.js'
|
|
5
|
+
import * as Tempo from '../../../../test/Tempo.js'
|
|
6
|
+
import * as Tidx from '../../../internal/Tidx.js'
|
|
7
7
|
import * as Indexer from './indexer.js'
|
|
8
8
|
|
|
9
9
|
const chainId = String(Runtime.get().chainId)
|
|
@@ -84,6 +84,27 @@ describe('GET /indexer/query', () => {
|
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
+
test('forwards chain aliases to the upstream as numeric ids', async () => {
|
|
88
|
+
const fetch = vi.spyOn(globalThis, 'fetch').mockResolvedValue(
|
|
89
|
+
new Response(JSON.stringify({ columns: [], ok: true, row_count: 0, rows: [] }), {
|
|
90
|
+
headers: { 'content-type': 'application/json' },
|
|
91
|
+
}),
|
|
92
|
+
)
|
|
93
|
+
try {
|
|
94
|
+
const client = TestApp.client()
|
|
95
|
+
const response = await client.v1.indexer.query.$get(
|
|
96
|
+
{ query: { chainId: 'mainnet', sql: 'select 2' } },
|
|
97
|
+
TestApp.auth,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
101
|
+
const upstream = new URL((fetch.mock.calls[0]![0] as Request).url)
|
|
102
|
+
expect(upstream.searchParams.get('chainId')).toMatchInlineSnapshot(`"4217"`)
|
|
103
|
+
} finally {
|
|
104
|
+
fetch.mockRestore()
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
|
|
87
108
|
test('requires authentication', async () => {
|
|
88
109
|
const client = TestApp.client()
|
|
89
110
|
const response = await client.v1.indexer.query.$get(
|
|
@@ -1,14 +1,14 @@
|
|
|
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 Cache from '
|
|
7
|
-
import * as OpenApi from '
|
|
8
|
-
import * as Path from '
|
|
9
|
-
import * as Response from '
|
|
10
|
-
import * as Schema from '
|
|
11
|
-
import * as Tidx 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 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
12
|
|
|
13
13
|
// Request headers that must not be forwarded upstream: hop-by-hop headers, the
|
|
14
14
|
// inbound host, and any caller auth so the consumer's Tempo API credentials never
|
|
@@ -98,7 +98,7 @@ export function indexer() {
|
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
return new Hono<App.Environment>().get(
|
|
101
|
-
'/query',
|
|
101
|
+
'/v1/indexer/query',
|
|
102
102
|
Auth.policy({ apiKey: { scopes: ['indexer:query'] }, mpp: true, public: true }),
|
|
103
103
|
OpenApi.describeRoute({
|
|
104
104
|
description:
|
|
@@ -250,7 +250,7 @@ async function passthrough(
|
|
|
250
250
|
|
|
251
251
|
// Resolve the upstream base URL per chain so mainnet and testnet
|
|
252
252
|
// requests reach the correct indexer.
|
|
253
|
-
const chainIdParam = c.req.query('chainId')
|
|
253
|
+
const chainIdParam = c.req.query('chainId') ?? c.req.query('chain_id')
|
|
254
254
|
const parsed = chainIdParam ? Schema.ChainId.safeParse(chainIdParam) : undefined
|
|
255
255
|
const chainId = parsed?.success ? parsed.data : c.get('chainId')
|
|
256
256
|
// Resolve the upstream for this caller. A resolver `tidx` can route by
|
|
@@ -275,6 +275,9 @@ async function passthrough(
|
|
|
275
275
|
const upstream = new URL(baseUrl)
|
|
276
276
|
upstream.pathname = Path.join(upstream.pathname, rest)
|
|
277
277
|
upstream.search = requestUrl.search
|
|
278
|
+
if (parsed?.success)
|
|
279
|
+
for (const key of ['chainId', 'chain_id'])
|
|
280
|
+
if (upstream.searchParams.has(key)) upstream.searchParams.set(key, String(chainId))
|
|
278
281
|
|
|
279
282
|
// Enforce the documented execution bounds server-side: an arbitrary SELECT
|
|
280
283
|
// from an anonymous caller is always bounded even if the upstream's own
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Schema } from '
|
|
1
|
+
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 Receipts from './receipts.js'
|
|
9
9
|
|
|
10
10
|
/** The decoded `type` names a humanized receipt may report. */
|
|
@@ -2,17 +2,17 @@ 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 * as Timing from '
|
|
14
|
-
import * as Ttl from '
|
|
15
|
-
import * as Value 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 * as Timing from '../../../internal/Timing.js'
|
|
14
|
+
import * as Ttl from '../../../internal/Ttl.js'
|
|
15
|
+
import * as Value from '../../../internal/Value.js'
|
|
16
16
|
import * as Tokens from './tokens.js'
|
|
17
17
|
|
|
18
18
|
// Receipts and transactions deliberately form an import cycle (receipts reuses
|
|
@@ -455,7 +455,7 @@ export namespace schema {
|
|
|
455
455
|
export function receipts() {
|
|
456
456
|
return new Hono<App.Environment>()
|
|
457
457
|
.get(
|
|
458
|
-
'/receipts',
|
|
458
|
+
'/v1/transactions/receipts',
|
|
459
459
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
460
460
|
OpenApi.validate('query', schema.getReceipts.Query, {
|
|
461
461
|
code: 'query_invalid',
|
|
@@ -548,7 +548,7 @@ export function receipts() {
|
|
|
548
548
|
},
|
|
549
549
|
)
|
|
550
550
|
.get(
|
|
551
|
-
'/:transactionHash/receipt',
|
|
551
|
+
'/v1/transactions/:transactionHash/receipt',
|
|
552
552
|
Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
|
|
553
553
|
OpenApi.validate('param', schema.getReceipt.Params, {
|
|
554
554
|
code: 'transaction_invalid',
|