tapimo 0.1.0 → 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 +28 -15
- package/dist/ApiKey.d.ts +3 -1
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +1 -0
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +71 -3
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +117 -1
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +7139 -4197
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +133 -329
- package/dist/App.js.map +1 -1
- package/dist/Scope.d.ts +11 -4
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -4
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +2 -2
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +2 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +126 -53
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +104 -6
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +67 -0
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +4 -1
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +115 -115
- package/dist/admin/apps/verified-tokens.js +1 -1
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +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} +49 -49
- 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} +468 -468
- package/dist/apps/data/routes/tokens.d.ts.map +1 -0
- package/dist/apps/{tokens.js → data/routes/tokens.js} +19 -19
- package/dist/apps/data/routes/tokens.js.map +1 -0
- package/dist/apps/{transactions.d.ts → data/routes/transactions.d.ts} +304 -304
- package/dist/apps/data/routes/transactions.d.ts.map +1 -0
- package/dist/apps/{transactions.js → data/routes/transactions.js} +13 -13
- package/dist/apps/data/routes/transactions.js.map +1 -0
- package/dist/apps/{transfers.d.ts → data/routes/transfers.d.ts} +6 -6
- 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} +62 -62
- package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
- package/dist/apps/{webhooks.js → data/routes/webhooks.js} +30 -26
- 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/Cli.d.ts +1 -1
- package/dist/cli/Cli.js +1 -1
- package/dist/cli/commands/admin.d.ts +1 -1
- package/dist/cli/commands/admin.js +2 -2
- package/dist/cli/commands/admin.js.map +1 -1
- package/dist/db/Db.d.ts +10 -0
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +128 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +80 -0
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +99 -0
- package/dist/db/Schema.js.map +1 -1
- 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 +44 -0
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +89 -0
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +65 -0
- package/dist/db/tables/projects.d.ts.map +1 -0
- package/dist/db/tables/projects.js +75 -0
- package/dist/db/tables/projects.js.map +1 -0
- package/dist/db/tables/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/handlers/internal/executionError.d.ts.map +1 -1
- package/dist/handlers/internal/executionError.js +2 -0
- package/dist/handlers/internal/executionError.js.map +1 -1
- package/dist/handlers/internal/multisig.d.ts +2 -6
- package/dist/handlers/internal/multisig.d.ts.map +1 -1
- package/dist/handlers/internal/multisig.js +11 -36
- package/dist/handlers/internal/multisig.js.map +1 -1
- package/dist/handlers/internal/sponsorship.d.ts +32 -2
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
- package/dist/handlers/internal/sponsorship.js +34 -9
- package/dist/handlers/internal/sponsorship.js.map +1 -1
- package/dist/handlers/relay.d.ts +6 -2
- package/dist/handlers/relay.d.ts.map +1 -1
- package/dist/handlers/relay.js +16 -2
- package/dist/handlers/relay.js.map +1 -1
- package/dist/internal/Auth.d.ts +208 -6
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +500 -21
- 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/Store.d.ts +7 -1
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +16 -2
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Viem.d.ts +84 -0
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Webhooks.d.ts +1 -1
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/package.json +31 -5
- package/src/ApiKey.ts +1 -0
- package/src/ApiKeys.test.ts +104 -1
- package/src/ApiKeys.ts +154 -1
- package/src/App.test.ts +11187 -179
- package/src/App.ts +200 -420
- package/src/Client.test-d.ts +306 -15
- package/src/Scope.ts +13 -4
- package/src/Webhooks.ts +2 -2
- package/src/admin/apps/api-keys.test.ts +51 -0
- package/src/admin/apps/api-keys.ts +84 -0
- package/src/admin/apps/scopes.test.ts +5 -1
- package/src/admin/apps/verified-tokens.ts +1 -1
- 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} +2 -2
- package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
- package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +3 -3
- package/src/apps/{blocks.ts → data/routes/blocks.ts} +14 -14
- package/src/apps/{coingecko.test.ts → data/routes/coingecko.test.ts} +2 -2
- package/src/apps/{coingecko.ts → data/routes/coingecko.ts} +14 -14
- package/src/apps/{exchanges.test.ts → data/routes/exchanges.test.ts} +1 -1
- package/src/apps/{exchanges.ts → data/routes/exchanges.ts} +20 -20
- package/src/apps/{fee-amm.test.ts → data/routes/fee-amm.test.ts} +3 -3
- package/src/apps/{fee-amm.ts → data/routes/fee-amm.ts} +18 -18
- package/src/apps/{indexer.test.ts → data/routes/indexer.test.ts} +26 -5
- package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
- package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +3 -3
- package/src/apps/{receipts.ts → data/routes/receipts.ts} +13 -13
- package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +44 -5
- package/src/apps/{rpc.ts → data/routes/rpc.ts} +7 -7
- package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +3 -3
- package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
- package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +2 -2
- package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
- package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +3 -3
- package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
- package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +2 -2
- package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
- package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +3 -3
- package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
- package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +6 -6
- package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +39 -35
- 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/Cli.ts +1 -1
- package/src/cli/commands/admin.ts +2 -2
- package/src/db/Db.ts +159 -0
- package/src/db/Schema.ts +137 -0
- package/src/db/tables/invitations.ts +198 -0
- package/src/db/tables/memberships.ts +208 -0
- package/src/db/tables/organizations.test.ts +37 -1
- package/src/db/tables/organizations.ts +105 -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/handlers/internal/executionError.ts +2 -0
- package/src/handlers/internal/multisig.test.ts +84 -10
- package/src/handlers/internal/multisig.ts +15 -50
- package/src/handlers/internal/sponsorship.ts +74 -15
- package/src/handlers/{internal/relay.localnet.test.ts → relay.test.ts} +2 -2
- package/src/handlers/relay.ts +23 -5
- package/src/internal/Auth.test.ts +316 -0
- package/src/internal/Auth.ts +691 -25
- 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/Store.test.ts +52 -0
- package/src/internal/Store.ts +24 -5
- package/src/internal/Tidx.local.test.ts +1 -1
- package/src/internal/VerifiedTokens.test.ts +1 -1
- package/src/internal/WebhookDestination.test.ts +1 -1
- package/src/internal/Webhooks.test.ts +4 -4
- package/src/internal/Webhooks.ts +1 -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/src/handlers/internal/multisig.localnet.test.ts +0 -146
- /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
- /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
package/src/handlers/relay.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from 'viem'
|
|
16
16
|
import type { LocalAccount } from 'viem/accounts'
|
|
17
17
|
import { simulateCalls } from 'viem/actions'
|
|
18
|
-
import { Abis, Actions, Addresses, Capabilities,
|
|
18
|
+
import { Abis, Actions, Addresses, Capabilities, VirtualAddress } from 'viem/tempo'
|
|
19
19
|
|
|
20
20
|
import * as ExecutionError from './internal/executionError.js'
|
|
21
21
|
import type * as RpcSchema from '../internal/RpcSchema.js'
|
|
@@ -150,6 +150,13 @@ export function relay(options: relay.Options): Handler {
|
|
|
150
150
|
|
|
151
151
|
const { feePayer: _feePayer, ...normalized } =
|
|
152
152
|
Utils.normalizeFillTransactionRequest(parameters)
|
|
153
|
+
const hasMultisigHints =
|
|
154
|
+
(typeof normalized['multisig'] === 'object' && normalized['multisig'] !== null) ||
|
|
155
|
+
(typeof normalized['multisigInit'] === 'object' &&
|
|
156
|
+
normalized['multisigInit'] !== null) ||
|
|
157
|
+
typeof normalized['multisigSignatureCount'] !== 'undefined'
|
|
158
|
+
const shouldDeferFeePayerSignature =
|
|
159
|
+
feePayerOptions && multisigOptions && hasMultisigHints
|
|
153
160
|
|
|
154
161
|
// When sponsoring, the sponsor's preferred fee token (if set)
|
|
155
162
|
// overrides whatever the consumer asked for — the sponsor is
|
|
@@ -362,9 +369,16 @@ export function relay(options: relay.Options): Handler {
|
|
|
362
369
|
})(),
|
|
363
370
|
// Sign as fee payer (if sponsored and not already signed).
|
|
364
371
|
(async () => {
|
|
365
|
-
|
|
372
|
+
// Multisig finalization changes the sender signature. Sign after quorum.
|
|
373
|
+
if (shouldDeferFeePayerSignature) return transaction_filled
|
|
374
|
+
// Never sign with the managed fee payer for an app-provided
|
|
375
|
+
// external fee payer URL: that relay is the sponsorship authority,
|
|
376
|
+
// and signing here would bypass this fee payer's `validate` gate.
|
|
377
|
+
if (!(sponsored && feePayerOptions && !externalFeePayerUrl && !alreadySigned))
|
|
378
|
+
return transaction_filled
|
|
366
379
|
return Sponsorship.sign({
|
|
367
380
|
account: feePayerOptions.account,
|
|
381
|
+
onSponsored: feePayerOptions.onSponsored,
|
|
368
382
|
sender: from,
|
|
369
383
|
transaction: transaction_filled,
|
|
370
384
|
})
|
|
@@ -519,6 +533,7 @@ export function relay(options: relay.Options): Handler {
|
|
|
519
533
|
? {
|
|
520
534
|
account: feePayerOptions.account,
|
|
521
535
|
feeToken: feePayerOptions.feeToken,
|
|
536
|
+
onSponsored: feePayerOptions.onSponsored,
|
|
522
537
|
resolveFeeToken: async (chainId) => (await getTokens(chainId))[0],
|
|
523
538
|
validate: feePayerOptions.validate,
|
|
524
539
|
}
|
|
@@ -563,6 +578,7 @@ export function relay(options: relay.Options): Handler {
|
|
|
563
578
|
getFeeToken: async (chainId) => (await getTokens(chainId))[0],
|
|
564
579
|
getClient,
|
|
565
580
|
method: request.method as Sponsorship.handleRawTransaction.Options['method'],
|
|
581
|
+
onSponsored: feePayerOptions.onSponsored,
|
|
566
582
|
request: { params: 'params' in request ? request.params : undefined },
|
|
567
583
|
validate: feePayerOptions.validate,
|
|
568
584
|
})
|
|
@@ -660,13 +676,15 @@ export namespace relay {
|
|
|
660
676
|
account: LocalAccount
|
|
661
677
|
/** Preferred fee token the sponsor wants to pay fees in. */
|
|
662
678
|
feeToken?: Address | undefined
|
|
679
|
+
/**
|
|
680
|
+
* Called once the fee payer has signed a raw transaction.
|
|
681
|
+
*/
|
|
682
|
+
onSponsored?: Sponsorship.handleRawTransaction.Options['onSponsored']
|
|
663
683
|
/**
|
|
664
684
|
* Validates whether to sponsor the transaction. When omitted, all
|
|
665
685
|
* transactions are sponsored. Return `false` to reject sponsorship.
|
|
666
686
|
*/
|
|
667
|
-
validate?:
|
|
668
|
-
| ((request: Transaction.TransactionRequest) => boolean | Promise<boolean>)
|
|
669
|
-
| undefined
|
|
687
|
+
validate?: Sponsorship.Validate | undefined
|
|
670
688
|
/** Sponsor display name returned from `eth_fillTransaction`. */
|
|
671
689
|
name?: string | undefined
|
|
672
690
|
/** Sponsor URL returned from `eth_fillTransaction`. */
|
|
@@ -267,6 +267,235 @@ describe('require', () => {
|
|
|
267
267
|
})
|
|
268
268
|
})
|
|
269
269
|
|
|
270
|
+
describe('session', () => {
|
|
271
|
+
const sessionPrincipal = {
|
|
272
|
+
id: 'usr_test',
|
|
273
|
+
identity: { provider: 'wallet', subject: '0x0000000000000000000000000000000000000001' },
|
|
274
|
+
type: 'session',
|
|
275
|
+
} as const satisfies Auth.SessionPrincipal
|
|
276
|
+
|
|
277
|
+
/** Harness with the session capability installed on the auth context. */
|
|
278
|
+
function createSessionApp(
|
|
279
|
+
options: {
|
|
280
|
+
policy?: Auth.require.Policy | undefined
|
|
281
|
+
resolve?: Auth.Session['resolve'] | undefined
|
|
282
|
+
} = {},
|
|
283
|
+
) {
|
|
284
|
+
const auth = {
|
|
285
|
+
apiKey: { resolve: TestApp.resolver({ keys: [{ ...key, token }] }) },
|
|
286
|
+
rateLimit: RateLimit.memory(),
|
|
287
|
+
...(options.resolve ? { session: { resolve: options.resolve } } : {}),
|
|
288
|
+
}
|
|
289
|
+
const app = new Hono<Auth.Environment>()
|
|
290
|
+
app.use('*', async (c, next) => {
|
|
291
|
+
c.set('auth', auth)
|
|
292
|
+
await next()
|
|
293
|
+
})
|
|
294
|
+
app.use('/protected', Auth.require(options.policy ?? { session: true }))
|
|
295
|
+
app.get('/protected', (c) => c.json(serializePrincipal(Auth.getPrincipal(c))))
|
|
296
|
+
return app
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
test('resolves cookie sessions for session-lane routes', async () => {
|
|
300
|
+
const app = createSessionApp({ resolve: async () => sessionPrincipal })
|
|
301
|
+
const response = await app.request('/protected')
|
|
302
|
+
const body = await response.json()
|
|
303
|
+
|
|
304
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
305
|
+
expect(body).toMatchInlineSnapshot(`
|
|
306
|
+
{
|
|
307
|
+
"id": "usr_test",
|
|
308
|
+
"type": "session",
|
|
309
|
+
}
|
|
310
|
+
`)
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
test('falls through to the session lane on invalid bearer tokens', async () => {
|
|
314
|
+
const app = createSessionApp({ resolve: async () => sessionPrincipal })
|
|
315
|
+
const response = await app.request('/protected', {
|
|
316
|
+
headers: { authorization: 'Bearer not-an-api-key' },
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
test('rejects anonymous requests without a session', async () => {
|
|
323
|
+
const app = createSessionApp({ resolve: async () => null })
|
|
324
|
+
const response = await app.request('/protected')
|
|
325
|
+
|
|
326
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
test('stays closed without the app session capability', async () => {
|
|
330
|
+
const app = createSessionApp()
|
|
331
|
+
const response = await app.request('/protected')
|
|
332
|
+
|
|
333
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
test('valid API keys win over sessions', async () => {
|
|
337
|
+
const app = createSessionApp({
|
|
338
|
+
policy: { apiKey: { scopes: ['data:read'] }, session: true },
|
|
339
|
+
resolve: async () => sessionPrincipal,
|
|
340
|
+
})
|
|
341
|
+
const response = await app.request('/protected', {
|
|
342
|
+
headers: { 'tempo-api-key': token },
|
|
343
|
+
})
|
|
344
|
+
const body = await response.json()
|
|
345
|
+
|
|
346
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
347
|
+
expect(body).toMatchInlineSnapshot(`
|
|
348
|
+
{
|
|
349
|
+
"id": "key_test",
|
|
350
|
+
"orgId": "org_test",
|
|
351
|
+
"type": "api_key",
|
|
352
|
+
}
|
|
353
|
+
`)
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
test('is not consulted on lane-less routes', async () => {
|
|
357
|
+
const app = createSessionApp({
|
|
358
|
+
policy: {},
|
|
359
|
+
resolve: async () => sessionPrincipal,
|
|
360
|
+
})
|
|
361
|
+
const response = await app.request('/protected')
|
|
362
|
+
|
|
363
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
describe('superAdmin', () => {
|
|
368
|
+
const secret = 'tempo:sk:a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0'
|
|
369
|
+
|
|
370
|
+
/** Auth context with the super admin secret configured alongside the test key. */
|
|
371
|
+
function withSuperAdmin(): Auth.Context {
|
|
372
|
+
return {
|
|
373
|
+
apiKey: { resolve: TestApp.resolver({ keys: [{ ...key, token }] }) },
|
|
374
|
+
rateLimit: RateLimit.memory(),
|
|
375
|
+
superAdmin: { tokenHash: ApiKey.hash(secret) },
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
test('resolves the super admin secret before key lookup', async () => {
|
|
380
|
+
const app = createApp({ auth: withSuperAdmin() })
|
|
381
|
+
const response = await app.request('/protected', {
|
|
382
|
+
headers: { 'tempo-api-key': secret },
|
|
383
|
+
})
|
|
384
|
+
const body = await response.json()
|
|
385
|
+
|
|
386
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
387
|
+
expect(body).toMatchInlineSnapshot(`
|
|
388
|
+
{
|
|
389
|
+
"actor": "super_admin",
|
|
390
|
+
"id": "super_admin",
|
|
391
|
+
"type": "super_admin",
|
|
392
|
+
}
|
|
393
|
+
`)
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
test('accepts the super admin secret as a bearer token', async () => {
|
|
397
|
+
const app = createApp({ auth: withSuperAdmin() })
|
|
398
|
+
const response = await app.request('/protected', {
|
|
399
|
+
headers: { authorization: `Bearer ${secret}` },
|
|
400
|
+
})
|
|
401
|
+
|
|
402
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
test('bypasses scope checks', async () => {
|
|
406
|
+
const app = createApp({
|
|
407
|
+
auth: withSuperAdmin(),
|
|
408
|
+
policy: { apiKey: { scopes: [Scope.wildcard] } },
|
|
409
|
+
})
|
|
410
|
+
const response = await app.request('/protected', {
|
|
411
|
+
headers: { 'tempo-api-key': secret },
|
|
412
|
+
})
|
|
413
|
+
|
|
414
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
test('non-matching tokens fall through to key lookup', async () => {
|
|
418
|
+
const app = createApp({ auth: withSuperAdmin() })
|
|
419
|
+
const response = await app.request('/protected', {
|
|
420
|
+
headers: { 'tempo-api-key': token },
|
|
421
|
+
})
|
|
422
|
+
const body = await response.json()
|
|
423
|
+
|
|
424
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
425
|
+
expect(body).toMatchInlineSnapshot(`
|
|
426
|
+
{
|
|
427
|
+
"id": "key_test",
|
|
428
|
+
"orgId": "org_test",
|
|
429
|
+
"type": "api_key",
|
|
430
|
+
}
|
|
431
|
+
`)
|
|
432
|
+
})
|
|
433
|
+
|
|
434
|
+
test('is disabled when unconfigured', async () => {
|
|
435
|
+
const app = createApp()
|
|
436
|
+
const response = await app.request('/protected', {
|
|
437
|
+
headers: { 'tempo-api-key': secret },
|
|
438
|
+
})
|
|
439
|
+
const body = await response.json()
|
|
440
|
+
|
|
441
|
+
expect(response.status).toMatchInlineSnapshot(`401`)
|
|
442
|
+
expect(body).toMatchInlineSnapshot(`
|
|
443
|
+
{
|
|
444
|
+
"error": {
|
|
445
|
+
"code": "api_key_invalid",
|
|
446
|
+
"message": "Invalid API key",
|
|
447
|
+
},
|
|
448
|
+
}
|
|
449
|
+
`)
|
|
450
|
+
})
|
|
451
|
+
|
|
452
|
+
test('is the only principal for lane-less routes', async () => {
|
|
453
|
+
const app = createApp({ auth: withSuperAdmin(), policy: {} })
|
|
454
|
+
|
|
455
|
+
const superAdmin = await app.request('/protected', {
|
|
456
|
+
headers: { 'tempo-api-key': secret },
|
|
457
|
+
})
|
|
458
|
+
expect(superAdmin.status).toMatchInlineSnapshot(`200`)
|
|
459
|
+
|
|
460
|
+
const keyed = await app.request('/protected', {
|
|
461
|
+
headers: { 'tempo-api-key': token },
|
|
462
|
+
})
|
|
463
|
+
const body = await keyed.json()
|
|
464
|
+
expect(keyed.status).toMatchInlineSnapshot(`403`)
|
|
465
|
+
expect(body).toMatchInlineSnapshot(`
|
|
466
|
+
{
|
|
467
|
+
"error": {
|
|
468
|
+
"code": "forbidden",
|
|
469
|
+
"message": "API key not permitted for this route",
|
|
470
|
+
},
|
|
471
|
+
}
|
|
472
|
+
`)
|
|
473
|
+
|
|
474
|
+
const anonymous = await app.request('/protected')
|
|
475
|
+
expect(anonymous.status).toMatchInlineSnapshot(`401`)
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
test('logs the principal actor, never the secret', async () => {
|
|
479
|
+
const entries: Log.Entry[] = []
|
|
480
|
+
const app = createApp({
|
|
481
|
+
auth: withSuperAdmin(),
|
|
482
|
+
logger: (entry) => {
|
|
483
|
+
entries.push(entry)
|
|
484
|
+
},
|
|
485
|
+
})
|
|
486
|
+
await app.request('/protected', { headers: { 'tempo-api-key': secret } })
|
|
487
|
+
|
|
488
|
+
expect(entries[0]?.principal).toMatchInlineSnapshot(`
|
|
489
|
+
{
|
|
490
|
+
"actor": "super_admin",
|
|
491
|
+
"id": "super_admin",
|
|
492
|
+
"type": "super_admin",
|
|
493
|
+
}
|
|
494
|
+
`)
|
|
495
|
+
expect(JSON.stringify(entries)).not.toContain(secret)
|
|
496
|
+
})
|
|
497
|
+
})
|
|
498
|
+
|
|
270
499
|
describe('environment', () => {
|
|
271
500
|
const sandboxToken = 'secret_sandbox'
|
|
272
501
|
|
|
@@ -613,6 +842,85 @@ describe('require', () => {
|
|
|
613
842
|
error.mockRestore()
|
|
614
843
|
}
|
|
615
844
|
})
|
|
845
|
+
|
|
846
|
+
test('fails open (at warn) when the rate-limit store stalls past the timeout', async () => {
|
|
847
|
+
const error = vi.spyOn(console, 'error').mockImplementation(() => {})
|
|
848
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
849
|
+
vi.useFakeTimers()
|
|
850
|
+
try {
|
|
851
|
+
const app = createApp({
|
|
852
|
+
auth: {
|
|
853
|
+
apiKey: { resolve: TestApp.resolver({ keys: [{ ...key, token }] }) },
|
|
854
|
+
// A hot Durable Object under a storage-latency blip never returns;
|
|
855
|
+
// the consume must not block the request indefinitely.
|
|
856
|
+
rateLimit: { consume: () => new Promise<never>(() => {}) },
|
|
857
|
+
},
|
|
858
|
+
policy: { public: { rateLimit: { perMinute: 1 } } },
|
|
859
|
+
})
|
|
860
|
+
const pending = app.request('/protected', {
|
|
861
|
+
headers: { 'x-forwarded-for': '203.0.113.10' },
|
|
862
|
+
})
|
|
863
|
+
// Advance past the 300ms consume timeout so it fails open.
|
|
864
|
+
await vi.advanceTimersByTimeAsync(300)
|
|
865
|
+
const response = await pending
|
|
866
|
+
const body = await response.json()
|
|
867
|
+
|
|
868
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
869
|
+
expect(response.headers.has('ratelimit-limit')).toMatchInlineSnapshot(`false`)
|
|
870
|
+
expect(body).toMatchInlineSnapshot(`
|
|
871
|
+
{
|
|
872
|
+
"id": "203.0.113.10",
|
|
873
|
+
"type": "public",
|
|
874
|
+
}
|
|
875
|
+
`)
|
|
876
|
+
// A timeout is an expected degradation: warn, never error.
|
|
877
|
+
expect(warn.mock.calls.length).toMatchInlineSnapshot(`1`)
|
|
878
|
+
expect(error.mock.calls.length).toMatchInlineSnapshot(`0`)
|
|
879
|
+
} finally {
|
|
880
|
+
vi.useRealTimers()
|
|
881
|
+
warn.mockRestore()
|
|
882
|
+
error.mockRestore()
|
|
883
|
+
}
|
|
884
|
+
})
|
|
885
|
+
|
|
886
|
+
test('fails open (at warn) when the rate-limit Durable Object is overloaded', async () => {
|
|
887
|
+
const error = vi.spyOn(console, 'error').mockImplementation(() => {})
|
|
888
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
889
|
+
try {
|
|
890
|
+
const app = createApp({
|
|
891
|
+
auth: {
|
|
892
|
+
apiKey: { resolve: TestApp.resolver({ keys: [{ ...key, token }] }) },
|
|
893
|
+
rateLimit: {
|
|
894
|
+
async consume() {
|
|
895
|
+
throw Object.assign(
|
|
896
|
+
new Error('Durable Object is overloaded. Requests queued for too long.'),
|
|
897
|
+
{ overloaded: true },
|
|
898
|
+
)
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
},
|
|
902
|
+
policy: { public: { rateLimit: { perMinute: 1 } } },
|
|
903
|
+
})
|
|
904
|
+
const response = await app.request('/protected', {
|
|
905
|
+
headers: { 'x-forwarded-for': '203.0.113.10' },
|
|
906
|
+
})
|
|
907
|
+
const body = await response.json()
|
|
908
|
+
|
|
909
|
+
expect(response.status).toMatchInlineSnapshot(`200`)
|
|
910
|
+
expect(response.headers.has('ratelimit-limit')).toMatchInlineSnapshot(`false`)
|
|
911
|
+
expect(body).toMatchInlineSnapshot(`
|
|
912
|
+
{
|
|
913
|
+
"id": "203.0.113.10",
|
|
914
|
+
"type": "public",
|
|
915
|
+
}
|
|
916
|
+
`)
|
|
917
|
+
expect(warn.mock.calls.length).toMatchInlineSnapshot(`1`)
|
|
918
|
+
expect(error.mock.calls.length).toMatchInlineSnapshot(`0`)
|
|
919
|
+
} finally {
|
|
920
|
+
warn.mockRestore()
|
|
921
|
+
error.mockRestore()
|
|
922
|
+
}
|
|
923
|
+
})
|
|
616
924
|
})
|
|
617
925
|
|
|
618
926
|
describe('rateLimit per-scope', () => {
|
|
@@ -948,6 +1256,14 @@ function serializePrincipal(principal: Auth.Principal | null) {
|
|
|
948
1256
|
type: principal.type,
|
|
949
1257
|
}
|
|
950
1258
|
|
|
1259
|
+
if (principal.type === 'super_admin')
|
|
1260
|
+
return {
|
|
1261
|
+
actor: principal.actor,
|
|
1262
|
+
id: principal.id,
|
|
1263
|
+
...payment,
|
|
1264
|
+
type: principal.type,
|
|
1265
|
+
}
|
|
1266
|
+
|
|
951
1267
|
return {
|
|
952
1268
|
id: principal.id,
|
|
953
1269
|
...payment,
|