tapimo 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -16
- package/dist/ApiKey.d.ts +4 -1
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +6 -2
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +98 -3
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +150 -1
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +7917 -2315
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +141 -329
- package/dist/App.js.map +1 -1
- package/dist/Scope.d.ts +20 -4
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +23 -4
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +2 -2
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +2 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +203 -120
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +111 -6
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +67 -0
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +12 -1
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/scopes.js +3 -0
- package/dist/admin/apps/scopes.js.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +116 -116
- package/dist/admin/apps/verified-tokens.js +1 -1
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +13 -13
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/analytics/Analytics.d.ts +151 -0
- package/dist/analytics/Analytics.d.ts.map +1 -0
- package/dist/analytics/Analytics.js +212 -0
- package/dist/analytics/Analytics.js.map +1 -0
- package/dist/analytics/tables/requestEvents.d.ts +215 -0
- package/dist/analytics/tables/requestEvents.d.ts.map +1 -0
- package/dist/analytics/tables/requestEvents.js +264 -0
- package/dist/analytics/tables/requestEvents.js.map +1 -0
- package/dist/apps/data/App.d.ts +19576 -0
- package/dist/apps/data/App.d.ts.map +1 -0
- package/dist/apps/data/App.js +272 -0
- package/dist/apps/data/App.js.map +1 -0
- package/dist/apps/data/index.d.ts +3 -0
- package/dist/apps/data/index.d.ts.map +1 -0
- package/dist/apps/data/index.js +3 -0
- package/dist/apps/data/index.js.map +1 -0
- package/dist/apps/{activities.d.ts → data/routes/activities.d.ts} +32 -32
- package/dist/apps/{activities.d.ts.map → data/routes/activities.d.ts.map} +1 -1
- package/dist/apps/{activities.js → data/routes/activities.js} +13 -13
- package/dist/apps/data/routes/activities.js.map +1 -0
- package/dist/apps/{addresses.d.ts → data/routes/addresses.d.ts} +22 -22
- package/dist/apps/{addresses.d.ts.map → data/routes/addresses.d.ts.map} +1 -1
- package/dist/apps/{addresses.js → data/routes/addresses.js} +5 -5
- package/dist/apps/data/routes/addresses.js.map +1 -0
- package/dist/apps/{balances.d.ts → data/routes/balances.d.ts} +4 -4
- package/dist/apps/data/routes/balances.d.ts.map +1 -0
- package/dist/apps/{balances.js → data/routes/balances.js} +42 -11
- package/dist/apps/data/routes/balances.js.map +1 -0
- package/dist/apps/{blocks.d.ts → data/routes/blocks.d.ts} +47 -47
- package/dist/apps/data/routes/blocks.d.ts.map +1 -0
- package/dist/apps/{blocks.js → data/routes/blocks.js} +13 -13
- package/dist/apps/data/routes/blocks.js.map +1 -0
- package/dist/apps/{coingecko.d.ts → data/routes/coingecko.d.ts} +8 -8
- package/dist/apps/data/routes/coingecko.d.ts.map +1 -0
- package/dist/apps/{coingecko.js → data/routes/coingecko.js} +13 -13
- package/dist/apps/data/routes/coingecko.js.map +1 -0
- package/dist/apps/{exchanges.d.ts → data/routes/exchanges.d.ts} +108 -108
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -0
- package/dist/apps/{exchanges.js → data/routes/exchanges.js} +19 -19
- package/dist/apps/data/routes/exchanges.js.map +1 -0
- package/dist/apps/{fee-amm.d.ts → data/routes/fee-amm.d.ts} +39 -39
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -0
- package/dist/apps/{fee-amm.js → data/routes/fee-amm.js} +17 -17
- package/dist/apps/data/routes/fee-amm.js.map +1 -0
- package/dist/apps/data/routes/funding.d.ts +765 -0
- package/dist/apps/data/routes/funding.d.ts.map +1 -0
- package/dist/apps/data/routes/funding.js +383 -0
- package/dist/apps/data/routes/funding.js.map +1 -0
- package/dist/apps/{indexer.d.ts → data/routes/indexer.d.ts} +4 -4
- package/dist/apps/data/routes/indexer.d.ts.map +1 -0
- package/dist/apps/{indexer.js → data/routes/indexer.js} +13 -9
- package/dist/apps/data/routes/indexer.js.map +1 -0
- package/dist/apps/{receipts.d.ts → data/routes/receipts.d.ts} +49 -49
- package/dist/apps/data/routes/receipts.d.ts.map +1 -0
- package/dist/apps/{receipts.js → data/routes/receipts.js} +14 -20
- package/dist/apps/data/routes/receipts.js.map +1 -0
- package/dist/apps/{rpc.d.ts → data/routes/rpc.d.ts} +33 -40
- package/dist/apps/data/routes/rpc.d.ts.map +1 -0
- package/dist/apps/{rpc.js → data/routes/rpc.js} +35 -7
- package/dist/apps/data/routes/rpc.js.map +1 -0
- package/dist/apps/{tokenlist.d.ts → data/routes/tokenlist.d.ts} +40 -40
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -0
- package/dist/apps/{tokenlist.js → data/routes/tokenlist.js} +8 -8
- package/dist/apps/data/routes/tokenlist.js.map +1 -0
- package/dist/apps/{tokens.d.ts → data/routes/tokens.d.ts} +468 -468
- package/dist/apps/data/routes/tokens.d.ts.map +1 -0
- package/dist/apps/{tokens.js → data/routes/tokens.js} +19 -19
- package/dist/apps/data/routes/tokens.js.map +1 -0
- package/dist/apps/{transactions.d.ts → data/routes/transactions.d.ts} +304 -304
- package/dist/apps/data/routes/transactions.d.ts.map +1 -0
- package/dist/apps/{transactions.js → data/routes/transactions.js} +13 -13
- package/dist/apps/data/routes/transactions.js.map +1 -0
- package/dist/apps/{transfers.d.ts → data/routes/transfers.d.ts} +62 -62
- package/dist/apps/data/routes/transfers.d.ts.map +1 -0
- package/dist/apps/{transfers.js → data/routes/transfers.js} +13 -13
- package/dist/apps/data/routes/transfers.js.map +1 -0
- package/dist/apps/{verified-tokens.d.ts → data/routes/verified-tokens.d.ts} +6 -6
- package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -0
- package/dist/apps/{verified-tokens.js → data/routes/verified-tokens.js} +9 -9
- package/dist/apps/data/routes/verified-tokens.js.map +1 -0
- package/dist/apps/{webhooks.d.ts → data/routes/webhooks.d.ts} +17 -17
- package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
- package/dist/apps/{webhooks.js → data/routes/webhooks.js} +38 -34
- package/dist/apps/data/routes/webhooks.js.map +1 -0
- package/dist/apps/docs/App.d.ts +29 -0
- package/dist/apps/docs/App.d.ts.map +1 -0
- package/dist/apps/docs/App.js +54 -0
- package/dist/apps/docs/App.js.map +1 -0
- package/dist/{internal/OpenApi.fonts.d.ts → apps/docs/fonts.d.ts} +1 -1
- package/dist/apps/docs/fonts.d.ts.map +1 -0
- package/dist/{internal/OpenApi.fonts.js → apps/docs/fonts.js} +1 -1
- package/dist/apps/docs/fonts.js.map +1 -0
- package/dist/apps/docs/index.d.ts +2 -0
- package/dist/apps/docs/index.d.ts.map +1 -0
- package/dist/apps/docs/index.js +2 -0
- package/dist/apps/docs/index.js.map +1 -0
- package/dist/{internal/OpenApi.logo.d.ts → apps/docs/logo.d.ts} +1 -1
- package/dist/apps/docs/logo.d.ts.map +1 -0
- package/dist/{internal/OpenApi.logo.js → apps/docs/logo.js} +1 -1
- package/dist/apps/docs/logo.js.map +1 -0
- package/dist/apps/docs/reference.d.ts +21 -0
- package/dist/apps/docs/reference.d.ts.map +1 -0
- package/dist/apps/docs/reference.js +112 -0
- package/dist/apps/docs/reference.js.map +1 -0
- package/dist/apps/index.d.ts +5 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +5 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/mcp.d.ts +76 -0
- package/dist/apps/mcp.d.ts.map +1 -0
- package/dist/apps/mcp.js +188 -0
- package/dist/apps/mcp.js.map +1 -0
- package/dist/apps/metadata.d.ts +7 -0
- package/dist/apps/metadata.d.ts.map +1 -0
- package/dist/apps/metadata.js +15 -0
- package/dist/apps/metadata.js.map +1 -0
- package/dist/apps/platform/App.d.ts +5262 -0
- package/dist/apps/platform/App.d.ts.map +1 -0
- package/dist/apps/platform/App.js +84 -0
- package/dist/apps/platform/App.js.map +1 -0
- package/dist/apps/platform/Billing.d.ts +279 -0
- package/dist/apps/platform/Billing.d.ts.map +1 -0
- package/dist/apps/platform/Billing.js +477 -0
- package/dist/apps/platform/Billing.js.map +1 -0
- package/dist/apps/platform/index.d.ts +3 -0
- package/dist/apps/platform/index.d.ts.map +1 -0
- package/dist/apps/platform/index.js +3 -0
- package/dist/apps/platform/index.js.map +1 -0
- package/dist/apps/platform/routes/api-keys.d.ts +973 -0
- package/dist/apps/platform/routes/api-keys.d.ts.map +1 -0
- package/dist/apps/platform/routes/api-keys.js +430 -0
- package/dist/apps/platform/routes/api-keys.js.map +1 -0
- package/dist/apps/platform/routes/billing.d.ts +1520 -0
- package/dist/apps/platform/routes/billing.d.ts.map +1 -0
- package/dist/apps/platform/routes/billing.js +795 -0
- package/dist/apps/platform/routes/billing.js.map +1 -0
- package/dist/apps/platform/routes/invitations.d.ts +851 -0
- package/dist/apps/platform/routes/invitations.d.ts.map +1 -0
- package/dist/apps/platform/routes/invitations.js +471 -0
- package/dist/apps/platform/routes/invitations.js.map +1 -0
- package/dist/apps/platform/routes/me.d.ts +95 -0
- package/dist/apps/platform/routes/me.d.ts.map +1 -0
- package/dist/apps/platform/routes/me.js +81 -0
- package/dist/apps/platform/routes/me.js.map +1 -0
- package/dist/apps/platform/routes/members.d.ts +554 -0
- package/dist/apps/platform/routes/members.d.ts.map +1 -0
- package/dist/apps/platform/routes/members.js +251 -0
- package/dist/apps/platform/routes/members.js.map +1 -0
- package/dist/apps/platform/routes/orgs.d.ts +596 -0
- package/dist/apps/platform/routes/orgs.d.ts.map +1 -0
- package/dist/apps/platform/routes/orgs.js +276 -0
- package/dist/apps/platform/routes/orgs.js.map +1 -0
- package/dist/apps/platform/routes/projects.d.ts +740 -0
- package/dist/apps/platform/routes/projects.d.ts.map +1 -0
- package/dist/apps/platform/routes/projects.js +286 -0
- package/dist/apps/platform/routes/projects.js.map +1 -0
- package/dist/apps/platform/routes/scopes.d.ts +107 -0
- package/dist/apps/platform/routes/scopes.d.ts.map +1 -0
- package/dist/apps/platform/routes/scopes.js +66 -0
- package/dist/apps/platform/routes/scopes.js.map +1 -0
- package/dist/apps/platform/routes/usage.d.ts +588 -0
- package/dist/apps/platform/routes/usage.d.ts.map +1 -0
- package/dist/apps/platform/routes/usage.js +391 -0
- package/dist/apps/platform/routes/usage.js.map +1 -0
- package/dist/apps/relay/App.d.ts +44 -0
- package/dist/apps/relay/App.d.ts.map +1 -0
- package/dist/apps/relay/App.js +211 -0
- package/dist/apps/relay/App.js.map +1 -0
- package/dist/apps/relay/Sponsorships.d.ts +107 -0
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -0
- package/dist/apps/relay/Sponsorships.js +194 -0
- package/dist/apps/relay/Sponsorships.js.map +1 -0
- package/dist/apps/relay/index.d.ts +3 -0
- package/dist/apps/relay/index.d.ts.map +1 -0
- package/dist/apps/relay/index.js +3 -0
- package/dist/apps/relay/index.js.map +1 -0
- package/dist/cli/Cli.d.ts +9 -2
- package/dist/cli/Cli.d.ts.map +1 -1
- package/dist/cli/Cli.js +12 -4
- package/dist/cli/Cli.js.map +1 -1
- package/dist/cli/commands/admin.d.ts +5 -1
- package/dist/cli/commands/admin.d.ts.map +1 -1
- package/dist/cli/commands/admin.js +82 -3
- package/dist/cli/commands/admin.js.map +1 -1
- package/dist/db/Db.d.ts +17 -0
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +254 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +159 -0
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +187 -2
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/billingSettings.d.ts +55 -0
- package/dist/db/tables/billingSettings.d.ts.map +1 -0
- package/dist/db/tables/billingSettings.js +70 -0
- package/dist/db/tables/billingSettings.js.map +1 -0
- package/dist/db/tables/invitations.d.ts +84 -0
- package/dist/db/tables/invitations.d.ts.map +1 -0
- package/dist/db/tables/invitations.js +165 -0
- package/dist/db/tables/invitations.js.map +1 -0
- package/dist/db/tables/memberships.d.ts +108 -0
- package/dist/db/tables/memberships.d.ts.map +1 -0
- package/dist/db/tables/memberships.js +153 -0
- package/dist/db/tables/memberships.js.map +1 -0
- package/dist/db/tables/organizations.d.ts +48 -0
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +97 -2
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +65 -0
- package/dist/db/tables/projects.d.ts.map +1 -0
- package/dist/db/tables/projects.js +75 -0
- package/dist/db/tables/projects.js.map +1 -0
- package/dist/db/tables/requestUsage.d.ts +121 -0
- package/dist/db/tables/requestUsage.d.ts.map +1 -0
- package/dist/db/tables/requestUsage.js +150 -0
- package/dist/db/tables/requestUsage.js.map +1 -0
- package/dist/db/tables/sponsoredTransactions.d.ts +239 -0
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -0
- package/dist/db/tables/sponsoredTransactions.js +314 -0
- package/dist/db/tables/sponsoredTransactions.js.map +1 -0
- package/dist/db/tables/stripeCustomers.d.ts +81 -0
- package/dist/db/tables/stripeCustomers.d.ts.map +1 -0
- package/dist/db/tables/stripeCustomers.js +120 -0
- package/dist/db/tables/stripeCustomers.js.map +1 -0
- package/dist/db/tables/users.d.ts +48 -0
- package/dist/db/tables/users.d.ts.map +1 -0
- package/dist/db/tables/users.js +65 -0
- package/dist/db/tables/users.js.map +1 -0
- package/dist/handlers/internal/executionError.d.ts.map +1 -1
- package/dist/handlers/internal/executionError.js +2 -0
- package/dist/handlers/internal/executionError.js.map +1 -1
- package/dist/handlers/internal/multisig.d.ts +2 -6
- package/dist/handlers/internal/multisig.d.ts.map +1 -1
- package/dist/handlers/internal/multisig.js +11 -36
- package/dist/handlers/internal/multisig.js.map +1 -1
- package/dist/handlers/internal/sponsorship.d.ts +35 -2
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
- package/dist/handlers/internal/sponsorship.js +53 -14
- package/dist/handlers/internal/sponsorship.js.map +1 -1
- package/dist/handlers/internal/utils.d.ts +10 -3
- package/dist/handlers/internal/utils.d.ts.map +1 -1
- package/dist/handlers/internal/utils.js +14 -6
- package/dist/handlers/internal/utils.js.map +1 -1
- package/dist/handlers/relay.d.ts +6 -2
- package/dist/handlers/relay.d.ts.map +1 -1
- package/dist/handlers/relay.js +16 -2
- package/dist/handlers/relay.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/Auth.d.ts +222 -6
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +625 -74
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Cache.d.ts.map +1 -1
- package/dist/internal/Cache.js +4 -1
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/EdgeCache.d.ts +10 -0
- package/dist/internal/EdgeCache.d.ts.map +1 -1
- package/dist/internal/EdgeCache.js +39 -8
- package/dist/internal/EdgeCache.js.map +1 -1
- package/dist/internal/Fees.d.ts +27 -0
- package/dist/internal/Fees.d.ts.map +1 -0
- package/dist/internal/Fees.js +48 -0
- package/dist/internal/Fees.js.map +1 -0
- package/dist/internal/FundingRoutes.d.ts +183 -0
- package/dist/internal/FundingRoutes.d.ts.map +1 -0
- package/dist/internal/FundingRoutes.js +490 -0
- package/dist/internal/FundingRoutes.js.map +1 -0
- package/dist/internal/Id.d.ts +15 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +22 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/Log.d.ts +9 -3
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +7 -0
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +10 -20
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +8 -58
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/RateLimit.d.ts +25 -0
- package/dist/internal/RateLimit.d.ts.map +1 -1
- package/dist/internal/RateLimit.js +51 -0
- package/dist/internal/RateLimit.js.map +1 -1
- package/dist/internal/Response.d.ts +1 -1
- package/dist/internal/Response.d.ts.map +1 -1
- package/dist/internal/Schema.d.ts +8 -0
- package/dist/internal/Schema.d.ts.map +1 -1
- package/dist/internal/Schema.js +7 -0
- package/dist/internal/Schema.js.map +1 -1
- package/dist/internal/Store.d.ts +7 -1
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +16 -2
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Viem.d.ts +84 -0
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Webhooks.d.ts +1 -1
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +3 -3
- package/dist/internal/Webhooks.js.map +1 -1
- package/package.json +33 -6
- package/src/ApiKey.ts +10 -2
- package/src/ApiKeys.test.ts +155 -1
- package/src/ApiKeys.ts +203 -1
- package/src/App.test.ts +64 -75741
- package/src/App.ts +218 -420
- package/src/Client.test-d.ts +657 -15
- package/src/Scope.ts +26 -4
- package/src/Webhooks.ts +2 -2
- package/src/admin/apps/api-keys.test.ts +51 -0
- package/src/admin/apps/api-keys.ts +84 -0
- package/src/admin/apps/scopes.test.ts +11 -1
- package/src/admin/apps/scopes.ts +3 -0
- package/src/admin/apps/verified-tokens.ts +1 -1
- package/src/admin/ui/src/components/Page.tsx +2 -3
- package/src/admin/ui/src/routes/__root.tsx +2 -2
- package/src/admin/ui/src/routes/api-keys.tsx +2 -2
- package/src/admin/ui.generated.ts +13 -13
- package/src/analytics/Analytics.test.ts +527 -0
- package/src/analytics/Analytics.ts +318 -0
- package/src/analytics/tables/requestEvents.ts +523 -0
- package/src/apps/composition.test.ts +66 -0
- package/src/apps/data/App.test.ts +72 -0
- package/src/apps/data/App.ts +330 -0
- package/src/apps/data/index.ts +2 -0
- package/src/apps/{activities.test.ts → data/routes/activities.test.ts} +3 -3
- package/src/apps/{activities.ts → data/routes/activities.ts} +15 -15
- package/src/apps/{addresses.ts → data/routes/addresses.ts} +6 -6
- package/src/apps/{balances.test.ts → data/routes/balances.test.ts} +2 -2
- package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
- package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +3 -3
- package/src/apps/{blocks.ts → data/routes/blocks.ts} +14 -14
- package/src/apps/{coingecko.test.ts → data/routes/coingecko.test.ts} +2 -2
- package/src/apps/{coingecko.ts → data/routes/coingecko.ts} +14 -14
- package/src/apps/{exchanges.test.ts → data/routes/exchanges.test.ts} +1 -1
- package/src/apps/{exchanges.ts → data/routes/exchanges.ts} +20 -20
- package/src/apps/{fee-amm.test.ts → data/routes/fee-amm.test.ts} +3 -3
- package/src/apps/{fee-amm.ts → data/routes/fee-amm.ts} +18 -18
- package/src/apps/data/routes/funding.test.ts +214 -0
- package/src/apps/data/routes/funding.ts +584 -0
- package/src/apps/{indexer.test.ts → data/routes/indexer.test.ts} +26 -5
- package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
- package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +3 -3
- package/src/apps/{receipts.ts → data/routes/receipts.ts} +15 -22
- package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +122 -7
- package/src/apps/{rpc.ts → data/routes/rpc.ts} +38 -8
- package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +3 -3
- package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
- package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +2 -2
- package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
- package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +3 -3
- package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
- package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +2 -2
- package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
- package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +3 -3
- package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
- package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +7 -7
- package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +50 -43
- package/src/apps/docs/App.ts +65 -0
- package/src/apps/docs/index.ts +1 -0
- package/src/apps/docs/reference.ts +132 -0
- package/src/apps/index.ts +4 -0
- package/src/apps/mcp.test.ts +206 -0
- package/src/apps/mcp.ts +250 -0
- package/src/apps/metadata.ts +23 -0
- package/src/apps/platform/App.ts +169 -0
- package/src/apps/platform/Billing.test.ts +530 -0
- package/src/apps/platform/Billing.ts +682 -0
- package/src/apps/platform/index.ts +2 -0
- package/src/apps/platform/routes/api-keys.test.ts +493 -0
- package/src/apps/platform/routes/api-keys.ts +543 -0
- package/src/apps/platform/routes/billing.test.ts +1100 -0
- package/src/apps/platform/routes/billing.ts +966 -0
- package/src/apps/platform/routes/invitations.test.ts +409 -0
- package/src/apps/platform/routes/invitations.ts +587 -0
- package/src/apps/platform/routes/me.test.ts +351 -0
- package/src/apps/platform/routes/me.ts +106 -0
- package/src/apps/platform/routes/members.test.ts +195 -0
- package/src/apps/platform/routes/members.ts +313 -0
- package/src/apps/platform/routes/orgs.test.ts +313 -0
- package/src/apps/platform/routes/orgs.ts +365 -0
- package/src/apps/platform/routes/projects.test.ts +181 -0
- package/src/apps/platform/routes/projects.ts +367 -0
- package/src/apps/platform/routes/scopes.test.ts +29 -0
- package/src/apps/platform/routes/scopes.ts +85 -0
- package/src/apps/platform/routes/usage.test.ts +422 -0
- package/src/apps/platform/routes/usage.ts +527 -0
- package/src/apps/relay/App.test.ts +933 -0
- package/src/apps/relay/App.ts +236 -0
- package/src/apps/relay/Sponsorships.test.ts +375 -0
- package/src/apps/relay/Sponsorships.ts +306 -0
- package/src/apps/relay/index.ts +2 -0
- package/src/cli/Cli.test.ts +25 -2
- package/src/cli/Cli.ts +18 -3
- package/src/cli/commands/admin.test.ts +83 -0
- package/src/cli/commands/admin.ts +91 -3
- package/src/db/Db.ts +296 -0
- package/src/db/Schema.ts +241 -2
- package/src/db/tables/billingSettings.test.ts +87 -0
- package/src/db/tables/billingSettings.ts +108 -0
- package/src/db/tables/invitations.ts +198 -0
- package/src/db/tables/memberships.ts +208 -0
- package/src/db/tables/organizations.test.ts +38 -2
- package/src/db/tables/organizations.ts +117 -2
- package/src/db/tables/projects.ts +107 -0
- package/src/db/tables/requestUsage.ts +231 -0
- package/src/db/tables/sponsoredTransactions.test.ts +325 -0
- package/src/db/tables/sponsoredTransactions.ts +464 -0
- package/src/db/tables/stripeCustomers.test.ts +109 -0
- package/src/db/tables/stripeCustomers.ts +162 -0
- package/src/db/tables/users.ts +85 -0
- package/src/handlers/internal/executionError.ts +2 -0
- package/src/handlers/internal/multisig.test.ts +84 -10
- package/src/handlers/internal/multisig.ts +15 -50
- package/src/handlers/internal/sponsorship.ts +106 -20
- package/src/handlers/internal/utils.ts +19 -7
- package/src/handlers/{internal/relay.localnet.test.ts → relay.test.ts} +2 -2
- package/src/handlers/relay.ts +23 -5
- package/src/index.ts +1 -0
- package/src/internal/Auth.test.ts +491 -25
- package/src/internal/Auth.ts +839 -84
- package/src/internal/Cache.ts +5 -1
- package/src/internal/Cursor.test.ts +3 -2
- package/src/internal/EdgeCache.test.ts +27 -4
- package/src/internal/EdgeCache.ts +47 -9
- package/src/internal/Fees.test.ts +32 -0
- package/src/internal/Fees.ts +51 -0
- package/src/internal/FundingRoutes.ts +583 -0
- package/src/internal/Id.test.ts +17 -0
- package/src/internal/Id.ts +24 -0
- package/src/internal/Log.test.ts +2 -1
- package/src/internal/Log.ts +16 -3
- package/src/internal/MetricSink.ts +1 -1
- package/src/internal/OpenApi.ts +12 -60
- package/src/internal/RateLimit.test.ts +84 -0
- package/src/internal/RateLimit.ts +70 -0
- package/src/internal/Response.ts +1 -1
- package/src/internal/Schema.ts +8 -0
- package/src/internal/Store.test.ts +52 -0
- package/src/internal/Store.ts +24 -5
- package/src/internal/Tidx.local.test.ts +1 -1
- package/src/internal/VerifiedTokens.test.ts +1 -1
- package/src/internal/WebhookDestination.test.ts +1 -1
- package/src/internal/Webhooks.test.ts +7 -7
- package/src/internal/Webhooks.ts +4 -4
- package/dist/apps/activities.js.map +0 -1
- package/dist/apps/addresses.js.map +0 -1
- package/dist/apps/balances.d.ts.map +0 -1
- package/dist/apps/balances.js.map +0 -1
- package/dist/apps/blocks.d.ts.map +0 -1
- package/dist/apps/blocks.js.map +0 -1
- package/dist/apps/coingecko.d.ts.map +0 -1
- package/dist/apps/coingecko.js.map +0 -1
- package/dist/apps/exchanges.d.ts.map +0 -1
- package/dist/apps/exchanges.js.map +0 -1
- package/dist/apps/fee-amm.d.ts.map +0 -1
- package/dist/apps/fee-amm.js.map +0 -1
- package/dist/apps/indexer.d.ts.map +0 -1
- package/dist/apps/indexer.js.map +0 -1
- package/dist/apps/receipts.d.ts.map +0 -1
- package/dist/apps/receipts.js.map +0 -1
- package/dist/apps/rpc.d.ts.map +0 -1
- package/dist/apps/rpc.js.map +0 -1
- package/dist/apps/tokenlist.d.ts.map +0 -1
- package/dist/apps/tokenlist.js.map +0 -1
- package/dist/apps/tokens.d.ts.map +0 -1
- package/dist/apps/tokens.js.map +0 -1
- package/dist/apps/transactions.d.ts.map +0 -1
- package/dist/apps/transactions.js.map +0 -1
- package/dist/apps/transfers.d.ts.map +0 -1
- package/dist/apps/transfers.js.map +0 -1
- package/dist/apps/verified-tokens.d.ts.map +0 -1
- package/dist/apps/verified-tokens.js.map +0 -1
- package/dist/apps/webhooks.js.map +0 -1
- package/dist/internal/OpenApi.fonts.d.ts.map +0 -1
- package/dist/internal/OpenApi.fonts.js.map +0 -1
- package/dist/internal/OpenApi.logo.d.ts.map +0 -1
- package/dist/internal/OpenApi.logo.js.map +0 -1
- package/src/handlers/internal/multisig.localnet.test.ts +0 -146
- /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
- /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
package/src/Client.test-d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { Client } from 'tapimo'
|
|
2
2
|
import type * as z from 'zod/mini'
|
|
3
3
|
|
|
4
|
-
import * as Activities from './apps/activities.js'
|
|
5
|
-
import * as Balances from './apps/balances.js'
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
4
|
+
import * as Activities from './apps/data/routes/activities.js'
|
|
5
|
+
import * as Balances from './apps/data/routes/balances.js'
|
|
6
|
+
import * as Billing from './apps/platform/routes/billing.js'
|
|
7
|
+
import * as Blocks from './apps/data/routes/blocks.js'
|
|
8
|
+
import * as Exchanges from './apps/data/routes/exchanges.js'
|
|
9
|
+
import * as FeeAmm from './apps/data/routes/fee-amm.js'
|
|
10
|
+
import * as Funding from './apps/data/routes/funding.js'
|
|
11
|
+
import * as Indexer from './apps/data/routes/indexer.js'
|
|
12
|
+
import * as Me from './apps/platform/routes/me.js'
|
|
13
|
+
import * as Orgs from './apps/platform/routes/orgs.js'
|
|
14
|
+
import * as Receipts from './apps/data/routes/receipts.js'
|
|
15
|
+
import * as Rpc from './apps/data/routes/rpc.js'
|
|
16
|
+
import * as Scopes from './apps/platform/routes/scopes.js'
|
|
17
|
+
import * as Tokens from './apps/data/routes/tokens.js'
|
|
18
|
+
import * as Transactions from './apps/data/routes/transactions.js'
|
|
19
|
+
import * as Transfers from './apps/data/routes/transfers.js'
|
|
20
|
+
import * as VerifiedTokens from './apps/data/routes/verified-tokens.js'
|
|
21
|
+
import * as Webhooks from './apps/data/routes/webhooks.js'
|
|
17
22
|
|
|
18
23
|
type Access400<code extends string> = code | 'api_key_malformed'
|
|
19
24
|
type PaidAccessStatus = PublicAccessStatus | 402
|
|
@@ -97,6 +102,559 @@ describe('narrows responses by status', () => {
|
|
|
97
102
|
}
|
|
98
103
|
})
|
|
99
104
|
|
|
105
|
+
test('GET /v1/me', async () => {
|
|
106
|
+
const client = Client.create()
|
|
107
|
+
const res = await client.v1.me.$get()
|
|
108
|
+
|
|
109
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
110
|
+
|
|
111
|
+
switch (res.status) {
|
|
112
|
+
case 200: {
|
|
113
|
+
const json = await res.json()
|
|
114
|
+
expectTypeOf(json.id).toEqualTypeOf<z.output<typeof Me.schema.User>['id']>()
|
|
115
|
+
void json
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
case 403: {
|
|
119
|
+
const json = await res.json()
|
|
120
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'forbidden'>()
|
|
121
|
+
void json
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
case 404: {
|
|
125
|
+
const json = await res.json()
|
|
126
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'user_not_found'>()
|
|
127
|
+
void json
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
test('GET /v1/scopes', async () => {
|
|
134
|
+
const client = Client.create()
|
|
135
|
+
const res = await client.v1.scopes.$get()
|
|
136
|
+
|
|
137
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | PublicAccessStatus>()
|
|
138
|
+
|
|
139
|
+
switch (res.status) {
|
|
140
|
+
case 200: {
|
|
141
|
+
const json = await res.json()
|
|
142
|
+
expectTypeOf(json.data[0]!.scope).toEqualTypeOf<
|
|
143
|
+
z.output<typeof Scopes.schema.getScopes.Response>['data'][number]['scope']
|
|
144
|
+
>()
|
|
145
|
+
void json
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
case 400: {
|
|
149
|
+
const json = await res.json()
|
|
150
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'api_key_malformed'>()
|
|
151
|
+
void json
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
test('POST /v1/orgs', async () => {
|
|
158
|
+
const client = Client.create()
|
|
159
|
+
const res = await client.v1.orgs.$post({ json: { name: 'Acme' } })
|
|
160
|
+
|
|
161
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 502>()
|
|
162
|
+
|
|
163
|
+
switch (res.status) {
|
|
164
|
+
case 200: {
|
|
165
|
+
const json = await res.json()
|
|
166
|
+
expectTypeOf(json.id).toEqualTypeOf<z.output<typeof Orgs.schema.Organization>['id']>()
|
|
167
|
+
void json
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
case 403: {
|
|
171
|
+
const json = await res.json()
|
|
172
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'forbidden'>()
|
|
173
|
+
void json
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
test('GET /v1/orgs/:orgId', async () => {
|
|
180
|
+
const client = Client.create()
|
|
181
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].$get({
|
|
182
|
+
param: { orgId: 'org_test' },
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404>()
|
|
186
|
+
|
|
187
|
+
switch (res.status) {
|
|
188
|
+
case 200: {
|
|
189
|
+
const json = await res.json()
|
|
190
|
+
expectTypeOf(json.name).toEqualTypeOf<string>()
|
|
191
|
+
void json
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
case 404: {
|
|
195
|
+
const json = await res.json()
|
|
196
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'organization_not_found'>()
|
|
197
|
+
void json
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
test('GET /v1/orgs/:orgId/billing', async () => {
|
|
204
|
+
const client = Client.create()
|
|
205
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].billing.$get({
|
|
206
|
+
param: { orgId: 'org_test' },
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
210
|
+
|
|
211
|
+
switch (res.status) {
|
|
212
|
+
case 200: {
|
|
213
|
+
const json = await res.json()
|
|
214
|
+
expectTypeOf(json.status).toEqualTypeOf<z.output<typeof Billing.schema.Billing>['status']>()
|
|
215
|
+
void json
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
case 501: {
|
|
219
|
+
const json = await res.json()
|
|
220
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'billing_unconfigured'>()
|
|
221
|
+
void json
|
|
222
|
+
return
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
test('GET /v1/orgs/:orgId/usage/sponsorships', async () => {
|
|
228
|
+
const client = Client.create()
|
|
229
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].usage.sponsorships.$get({
|
|
230
|
+
param: { orgId: 'org_test' },
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
234
|
+
|
|
235
|
+
switch (res.status) {
|
|
236
|
+
case 200: {
|
|
237
|
+
const json = await res.json()
|
|
238
|
+
expectTypeOf(json.data[0]!.count).toEqualTypeOf<number>()
|
|
239
|
+
expectTypeOf(json.data[0]!.feeTotal).toEqualTypeOf<{ amount: string; currency: 'usd' }>()
|
|
240
|
+
expectTypeOf(json.data[0]!.timestamp).toEqualTypeOf<string>()
|
|
241
|
+
void json
|
|
242
|
+
return
|
|
243
|
+
}
|
|
244
|
+
case 400: {
|
|
245
|
+
const json = await res.json()
|
|
246
|
+
expectTypeOf(json.error.code).toEqualTypeOf<Access400<'param_invalid' | 'query_invalid'>>()
|
|
247
|
+
void json
|
|
248
|
+
return
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
test('PATCH /v1/orgs/:orgId/billing', async () => {
|
|
254
|
+
const client = Client.create()
|
|
255
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].billing.$patch({
|
|
256
|
+
json: { spendLimit: { amount: '250' }, txFeeLimit: null },
|
|
257
|
+
param: { orgId: 'org_test' },
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
261
|
+
|
|
262
|
+
switch (res.status) {
|
|
263
|
+
case 200: {
|
|
264
|
+
const json = await res.json()
|
|
265
|
+
expectTypeOf(json.spendLimit).toEqualTypeOf<
|
|
266
|
+
z.output<typeof Billing.schema.SpendLimit> | undefined
|
|
267
|
+
>()
|
|
268
|
+
expectTypeOf(json.spend).toEqualTypeOf<z.output<typeof Billing.schema.Billing>['spend']>()
|
|
269
|
+
void json
|
|
270
|
+
return
|
|
271
|
+
}
|
|
272
|
+
case 501: {
|
|
273
|
+
const json = await res.json()
|
|
274
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'billing_unconfigured'>()
|
|
275
|
+
void json
|
|
276
|
+
return
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
test('POST /v1/orgs/:orgId/billing/stripe/manage', async () => {
|
|
282
|
+
const client = Client.create()
|
|
283
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].billing.stripe.manage.$post({
|
|
284
|
+
param: { orgId: 'org_test' },
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
288
|
+
|
|
289
|
+
switch (res.status) {
|
|
290
|
+
case 200: {
|
|
291
|
+
const json = await res.json()
|
|
292
|
+
expectTypeOf(json.url).toEqualTypeOf<string>()
|
|
293
|
+
void json
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
case 404: {
|
|
297
|
+
const json = await res.json()
|
|
298
|
+
expectTypeOf(json.error.code).toEqualTypeOf<
|
|
299
|
+
'billing_not_found' | 'organization_not_found'
|
|
300
|
+
>()
|
|
301
|
+
void json
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
test('GET /v1/orgs/:orgId/billing/payment-methods', async () => {
|
|
308
|
+
const client = Client.create()
|
|
309
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].billing['payment-methods'].$get({
|
|
310
|
+
param: { orgId: 'org_test' },
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
314
|
+
|
|
315
|
+
switch (res.status) {
|
|
316
|
+
case 200: {
|
|
317
|
+
const json = await res.json()
|
|
318
|
+
expectTypeOf(json.data[0]!.provider).toEqualTypeOf<'stripe'>()
|
|
319
|
+
expectTypeOf(json.data[0]!.default).toEqualTypeOf<boolean>()
|
|
320
|
+
expectTypeOf(json.data[0]!.card).toEqualTypeOf<
|
|
321
|
+
{ brand: string; expMonth: number; expYear: number; last4: string } | undefined
|
|
322
|
+
>()
|
|
323
|
+
void json
|
|
324
|
+
return
|
|
325
|
+
}
|
|
326
|
+
case 501: {
|
|
327
|
+
const json = await res.json()
|
|
328
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'billing_unconfigured'>()
|
|
329
|
+
void json
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
test('DELETE /v1/orgs/:orgId/billing/payment-methods/:methodId', async () => {
|
|
336
|
+
const client = Client.create()
|
|
337
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].billing['payment-methods'][
|
|
338
|
+
':methodId{pm_[A-Za-z0-9_-]+}'
|
|
339
|
+
].$delete({ param: { methodId: 'pm_test', orgId: 'org_test' } })
|
|
340
|
+
|
|
341
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
342
|
+
|
|
343
|
+
switch (res.status) {
|
|
344
|
+
case 200: {
|
|
345
|
+
const json = await res.json()
|
|
346
|
+
expectTypeOf(json.status).toEqualTypeOf<'active' | 'canceled' | 'none' | 'past_due'>()
|
|
347
|
+
void json
|
|
348
|
+
return
|
|
349
|
+
}
|
|
350
|
+
case 404: {
|
|
351
|
+
const json = await res.json()
|
|
352
|
+
expectTypeOf(json.error.code).toEqualTypeOf<
|
|
353
|
+
'billing_not_found' | 'organization_not_found' | 'payment_method_not_found'
|
|
354
|
+
>()
|
|
355
|
+
void json
|
|
356
|
+
return
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
test('DELETE /v1/orgs/:orgId', async () => {
|
|
362
|
+
const client = Client.create()
|
|
363
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].$delete({
|
|
364
|
+
param: { orgId: 'org_test' },
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
368
|
+
|
|
369
|
+
switch (res.status) {
|
|
370
|
+
case 200: {
|
|
371
|
+
const json = await res.json()
|
|
372
|
+
expectTypeOf(json.id).toEqualTypeOf<string>()
|
|
373
|
+
void json
|
|
374
|
+
return
|
|
375
|
+
}
|
|
376
|
+
case 404: {
|
|
377
|
+
const json = await res.json()
|
|
378
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'organization_not_found'>()
|
|
379
|
+
void json
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
})
|
|
384
|
+
|
|
385
|
+
test('GET /v1/orgs/:orgId/projects/:projectId', async () => {
|
|
386
|
+
const client = Client.create()
|
|
387
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].projects[
|
|
388
|
+
':projectId{prj_[A-Za-z0-9_-]+}'
|
|
389
|
+
].$get({ param: { orgId: 'org_test', projectId: 'prj_test' } })
|
|
390
|
+
|
|
391
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404>()
|
|
392
|
+
|
|
393
|
+
switch (res.status) {
|
|
394
|
+
case 200: {
|
|
395
|
+
const json = await res.json()
|
|
396
|
+
expectTypeOf(json.environments[0]).toEqualTypeOf<'production' | 'sandbox' | undefined>()
|
|
397
|
+
void json
|
|
398
|
+
return
|
|
399
|
+
}
|
|
400
|
+
case 404: {
|
|
401
|
+
const json = await res.json()
|
|
402
|
+
expectTypeOf(json.error.code).toEqualTypeOf<
|
|
403
|
+
'organization_not_found' | 'project_not_found'
|
|
404
|
+
>()
|
|
405
|
+
void json
|
|
406
|
+
return
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
|
|
411
|
+
test('DELETE /v1/orgs/:orgId/projects/:projectId', async () => {
|
|
412
|
+
const client = Client.create()
|
|
413
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].projects[
|
|
414
|
+
':projectId{prj_[A-Za-z0-9_-]+}'
|
|
415
|
+
].$delete({ param: { orgId: 'org_test', projectId: 'prj_test' } })
|
|
416
|
+
|
|
417
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
418
|
+
|
|
419
|
+
switch (res.status) {
|
|
420
|
+
case 200: {
|
|
421
|
+
const json = await res.json()
|
|
422
|
+
expectTypeOf(json.id).toEqualTypeOf<string>()
|
|
423
|
+
void json
|
|
424
|
+
return
|
|
425
|
+
}
|
|
426
|
+
case 404: {
|
|
427
|
+
const json = await res.json()
|
|
428
|
+
expectTypeOf(json.error.code).toEqualTypeOf<
|
|
429
|
+
'organization_not_found' | 'project_not_found'
|
|
430
|
+
>()
|
|
431
|
+
void json
|
|
432
|
+
return
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
test('POST /v1/orgs/:orgId/projects/:projectId/api-keys', async () => {
|
|
438
|
+
const client = Client.create()
|
|
439
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].projects[
|
|
440
|
+
':projectId{prj_[A-Za-z0-9_-]+}'
|
|
441
|
+
]['api-keys'].$post({
|
|
442
|
+
json: { scopes: ['data:read'] },
|
|
443
|
+
param: { orgId: 'org_test', projectId: 'prj_test' },
|
|
444
|
+
})
|
|
445
|
+
|
|
446
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
447
|
+
|
|
448
|
+
switch (res.status) {
|
|
449
|
+
case 200: {
|
|
450
|
+
const json = await res.json()
|
|
451
|
+
expectTypeOf(json.token).toEqualTypeOf<string>()
|
|
452
|
+
expectTypeOf(json.id).toEqualTypeOf<string>()
|
|
453
|
+
void json
|
|
454
|
+
return
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
test('GET /v1/orgs/:orgId/api-keys', async () => {
|
|
460
|
+
const client = Client.create()
|
|
461
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}']['api-keys'].$get({
|
|
462
|
+
// The environment filter is optional (defaults to production server-side).
|
|
463
|
+
query: { environment: 'sandbox' },
|
|
464
|
+
param: { orgId: 'org_test' },
|
|
465
|
+
})
|
|
466
|
+
|
|
467
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
468
|
+
|
|
469
|
+
switch (res.status) {
|
|
470
|
+
case 200: {
|
|
471
|
+
const json = await res.json()
|
|
472
|
+
expectTypeOf(json.data[0]!.id).toEqualTypeOf<string>()
|
|
473
|
+
expectTypeOf(json.data[0]!.environment).toEqualTypeOf<'production' | 'sandbox'>()
|
|
474
|
+
// Absent on org-wide keys minted without project attribution.
|
|
475
|
+
expectTypeOf(json.data[0]!.projectId).toEqualTypeOf<string | undefined>()
|
|
476
|
+
void json
|
|
477
|
+
return
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
})
|
|
481
|
+
|
|
482
|
+
test('DELETE /v1/orgs/:orgId/projects/:projectId/api-keys/:keyId', async () => {
|
|
483
|
+
const client = Client.create()
|
|
484
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].projects[
|
|
485
|
+
':projectId{prj_[A-Za-z0-9_-]+}'
|
|
486
|
+
]['api-keys'][':keyId{key_[A-Za-z0-9_-]+}'].$delete({
|
|
487
|
+
param: { keyId: 'key_test', orgId: 'org_test', projectId: 'prj_test' },
|
|
488
|
+
})
|
|
489
|
+
|
|
490
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
491
|
+
|
|
492
|
+
switch (res.status) {
|
|
493
|
+
case 404: {
|
|
494
|
+
const json = await res.json()
|
|
495
|
+
expectTypeOf(json.error.code).toEqualTypeOf<
|
|
496
|
+
| 'api_key_not_found'
|
|
497
|
+
| 'api_keys_not_enabled'
|
|
498
|
+
| 'organization_not_found'
|
|
499
|
+
| 'project_not_found'
|
|
500
|
+
>()
|
|
501
|
+
void json
|
|
502
|
+
return
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
})
|
|
506
|
+
|
|
507
|
+
test('GET /v1/orgs/:orgId/usage/requests', async () => {
|
|
508
|
+
const client = Client.create()
|
|
509
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].usage.requests.$get({
|
|
510
|
+
param: { orgId: 'org_test' },
|
|
511
|
+
query: { projectId: 'prj_test' },
|
|
512
|
+
})
|
|
513
|
+
|
|
514
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 501 | 502>()
|
|
515
|
+
|
|
516
|
+
switch (res.status) {
|
|
517
|
+
case 200: {
|
|
518
|
+
const json = await res.json()
|
|
519
|
+
expectTypeOf(json.from).toEqualTypeOf<string>()
|
|
520
|
+
expectTypeOf(json.interval).toEqualTypeOf<'day' | 'hour'>()
|
|
521
|
+
expectTypeOf(json.to).toEqualTypeOf<string>()
|
|
522
|
+
expectTypeOf(json.totals.requests).toEqualTypeOf<number>()
|
|
523
|
+
expectTypeOf(json.byKey[0]?.apiKeyId).toEqualTypeOf<string | undefined>()
|
|
524
|
+
void json
|
|
525
|
+
return
|
|
526
|
+
}
|
|
527
|
+
case 404: {
|
|
528
|
+
const json = await res.json()
|
|
529
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'organization_not_found'>()
|
|
530
|
+
void json
|
|
531
|
+
return
|
|
532
|
+
}
|
|
533
|
+
case 501: {
|
|
534
|
+
const json = await res.json()
|
|
535
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'analytics_unconfigured'>()
|
|
536
|
+
void json
|
|
537
|
+
return
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
test('GET /v1/orgs/:orgId/members', async () => {
|
|
543
|
+
const client = Client.create()
|
|
544
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].members.$get({
|
|
545
|
+
param: { orgId: 'org_test' },
|
|
546
|
+
})
|
|
547
|
+
|
|
548
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
549
|
+
|
|
550
|
+
switch (res.status) {
|
|
551
|
+
case 200: {
|
|
552
|
+
const json = await res.json()
|
|
553
|
+
expectTypeOf(json.data[0]!.role).toEqualTypeOf<'admin' | 'member' | 'owner'>()
|
|
554
|
+
void json
|
|
555
|
+
return
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
})
|
|
559
|
+
|
|
560
|
+
test('PATCH /v1/orgs/:orgId/members/:userId', async () => {
|
|
561
|
+
const client = Client.create()
|
|
562
|
+
const res = await client.v1.orgs[':orgId{org_[A-Za-z0-9_-]+}'].members[
|
|
563
|
+
':userId{usr_[A-Za-z0-9_-]+}'
|
|
564
|
+
].$patch({ json: { role: 'admin' }, param: { orgId: 'org_test', userId: 'usr_test' } })
|
|
565
|
+
|
|
566
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 409 | 502>()
|
|
567
|
+
|
|
568
|
+
switch (res.status) {
|
|
569
|
+
case 409: {
|
|
570
|
+
const json = await res.json()
|
|
571
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'last_owner'>()
|
|
572
|
+
void json
|
|
573
|
+
return
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
|
|
578
|
+
test('POST /v1/invitations/:invitationId/accept', async () => {
|
|
579
|
+
const client = Client.create()
|
|
580
|
+
const res = await client.v1.invitations[':invitationId{inv_[A-Za-z0-9_-]+}'].accept.$post({
|
|
581
|
+
param: { invitationId: 'inv_test' },
|
|
582
|
+
})
|
|
583
|
+
|
|
584
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
585
|
+
|
|
586
|
+
switch (res.status) {
|
|
587
|
+
case 200: {
|
|
588
|
+
const json = await res.json()
|
|
589
|
+
expectTypeOf(json.role).toEqualTypeOf<'admin' | 'member' | 'owner'>()
|
|
590
|
+
void json
|
|
591
|
+
return
|
|
592
|
+
}
|
|
593
|
+
case 404: {
|
|
594
|
+
const json = await res.json()
|
|
595
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'invitation_not_found'>()
|
|
596
|
+
void json
|
|
597
|
+
return
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
})
|
|
601
|
+
|
|
602
|
+
test('POST /v1/invitations/:invitationId/decline', async () => {
|
|
603
|
+
const client = Client.create()
|
|
604
|
+
const res = await client.v1.invitations[':invitationId{inv_[A-Za-z0-9_-]+}'].decline.$post({
|
|
605
|
+
param: { invitationId: 'inv_test' },
|
|
606
|
+
})
|
|
607
|
+
|
|
608
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 404 | 502>()
|
|
609
|
+
|
|
610
|
+
switch (res.status) {
|
|
611
|
+
case 200: {
|
|
612
|
+
const json = await res.json()
|
|
613
|
+
expectTypeOf(json.id).toEqualTypeOf<string>()
|
|
614
|
+
void json
|
|
615
|
+
return
|
|
616
|
+
}
|
|
617
|
+
case 404: {
|
|
618
|
+
const json = await res.json()
|
|
619
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'invitation_not_found'>()
|
|
620
|
+
void json
|
|
621
|
+
return
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
})
|
|
625
|
+
|
|
626
|
+
test('GET /v1/orgs', async () => {
|
|
627
|
+
const client = Client.create()
|
|
628
|
+
const res = await client.v1.orgs.$get()
|
|
629
|
+
|
|
630
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | 401 | 403 | 502>()
|
|
631
|
+
|
|
632
|
+
switch (res.status) {
|
|
633
|
+
case 200: {
|
|
634
|
+
const json = await res.json()
|
|
635
|
+
expectTypeOf(json.data[0]!.id).toEqualTypeOf<
|
|
636
|
+
z.output<typeof Orgs.schema.listOrganizations.Response>['data'][number]['id']
|
|
637
|
+
>()
|
|
638
|
+
void json
|
|
639
|
+
return
|
|
640
|
+
}
|
|
641
|
+
case 403: {
|
|
642
|
+
const json = await res.json()
|
|
643
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'forbidden'>()
|
|
644
|
+
expectTypeOf(json.error.message).toEqualTypeOf<string>()
|
|
645
|
+
void json
|
|
646
|
+
return
|
|
647
|
+
}
|
|
648
|
+
case 502: {
|
|
649
|
+
const json = await res.json()
|
|
650
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'upstream_error'>()
|
|
651
|
+
expectTypeOf(json.error.message).toEqualTypeOf<string>()
|
|
652
|
+
void json
|
|
653
|
+
return
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
})
|
|
657
|
+
|
|
100
658
|
test('GET /v1/blocks/:block', async () => {
|
|
101
659
|
const client = Client.create()
|
|
102
660
|
const res = await client.v1.blocks[':block'].$get({ param: { block: '1' } })
|
|
@@ -631,6 +1189,90 @@ describe('narrows responses by status', () => {
|
|
|
631
1189
|
}
|
|
632
1190
|
})
|
|
633
1191
|
|
|
1192
|
+
test('GET /v1/funding/routes', async () => {
|
|
1193
|
+
const client = Client.create()
|
|
1194
|
+
const res = await client.v1.funding.routes.$get({
|
|
1195
|
+
query: {
|
|
1196
|
+
sourceAmount: '1000000',
|
|
1197
|
+
sourceChain: 'base',
|
|
1198
|
+
sourceToken: 'USDC',
|
|
1199
|
+
},
|
|
1200
|
+
})
|
|
1201
|
+
|
|
1202
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | PaidAccessStatus>()
|
|
1203
|
+
|
|
1204
|
+
switch (res.status) {
|
|
1205
|
+
case 200: {
|
|
1206
|
+
const json = await res.json()
|
|
1207
|
+
expectTypeOf(json.data[0]!.sourceAmount).toEqualTypeOf<
|
|
1208
|
+
z.output<typeof Funding.schema.listFundingRoutes.Response>['data'][number]['sourceAmount']
|
|
1209
|
+
>()
|
|
1210
|
+
expectTypeOf(json.data[0]!.provider.id).toEqualTypeOf<string>()
|
|
1211
|
+
void json
|
|
1212
|
+
return
|
|
1213
|
+
}
|
|
1214
|
+
case 400: {
|
|
1215
|
+
const json = await res.json()
|
|
1216
|
+
expectTypeOf(json.error.code).toEqualTypeOf<Access400<'query_invalid'>>()
|
|
1217
|
+
expectTypeOf(json.error.message).toEqualTypeOf<string>()
|
|
1218
|
+
void json
|
|
1219
|
+
return
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
})
|
|
1223
|
+
|
|
1224
|
+
test('GET /v1/funding/chains', async () => {
|
|
1225
|
+
const client = Client.create()
|
|
1226
|
+
const res = await client.v1.funding.chains.$get()
|
|
1227
|
+
|
|
1228
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | PaidAccessStatus>()
|
|
1229
|
+
|
|
1230
|
+
switch (res.status) {
|
|
1231
|
+
case 200: {
|
|
1232
|
+
const json = await res.json()
|
|
1233
|
+
expectTypeOf(json.data[0]!.tokens[0]!.symbol).toEqualTypeOf<
|
|
1234
|
+
z.output<
|
|
1235
|
+
typeof Funding.schema.listFundingChains.Response
|
|
1236
|
+
>['data'][number]['tokens'][number]['symbol']
|
|
1237
|
+
>()
|
|
1238
|
+
void json
|
|
1239
|
+
return
|
|
1240
|
+
}
|
|
1241
|
+
case 400: {
|
|
1242
|
+
const json = await res.json()
|
|
1243
|
+
expectTypeOf(json.error.code).toEqualTypeOf<'api_key_malformed'>()
|
|
1244
|
+
expectTypeOf(json.error.message).toEqualTypeOf<string>()
|
|
1245
|
+
void json
|
|
1246
|
+
return
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
})
|
|
1250
|
+
|
|
1251
|
+
test('GET /v1/providers', async () => {
|
|
1252
|
+
const client = Client.create()
|
|
1253
|
+
const res = await client.v1.providers.$get({ query: { capability: 'fundingRoutes' } })
|
|
1254
|
+
|
|
1255
|
+
expectTypeOf(res.status).toEqualTypeOf<200 | 400 | PaidAccessStatus>()
|
|
1256
|
+
|
|
1257
|
+
switch (res.status) {
|
|
1258
|
+
case 200: {
|
|
1259
|
+
const json = await res.json()
|
|
1260
|
+
expectTypeOf(json.data[0]!.capabilities).toEqualTypeOf<
|
|
1261
|
+
z.output<typeof Funding.schema.listProviders.Response>['data'][number]['capabilities']
|
|
1262
|
+
>()
|
|
1263
|
+
void json
|
|
1264
|
+
return
|
|
1265
|
+
}
|
|
1266
|
+
case 400: {
|
|
1267
|
+
const json = await res.json()
|
|
1268
|
+
expectTypeOf(json.error.code).toEqualTypeOf<Access400<'query_invalid'>>()
|
|
1269
|
+
expectTypeOf(json.error.message).toEqualTypeOf<string>()
|
|
1270
|
+
void json
|
|
1271
|
+
return
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
})
|
|
1275
|
+
|
|
634
1276
|
test('GET /v1/exchange/swaps', async () => {
|
|
635
1277
|
const client = Client.create()
|
|
636
1278
|
const res = await client.v1.exchange.swaps.$get()
|
|
@@ -1176,7 +1818,7 @@ describe('narrows responses by status', () => {
|
|
|
1176
1818
|
|
|
1177
1819
|
test('POST /rpc/:chain', async () => {
|
|
1178
1820
|
const client = Client.create()
|
|
1179
|
-
const res = await client.rpc[':chain{mainnet|testnet|[0-9]+}?'].$post({
|
|
1821
|
+
const res = await client.rpc[':chain{(mainnet|testnet|[0-9]+)}?'].$post({
|
|
1180
1822
|
param: { chain: undefined },
|
|
1181
1823
|
})
|
|
1182
1824
|
|
|
@@ -1208,7 +1850,7 @@ describe('narrows responses by status', () => {
|
|
|
1208
1850
|
|
|
1209
1851
|
test('POST /rpc/:chain testnet shortcut', async () => {
|
|
1210
1852
|
const client = Client.create()
|
|
1211
|
-
const res = await client.rpc[':chain{mainnet|testnet|[0-9]+}?'].$post({
|
|
1853
|
+
const res = await client.rpc[':chain{(mainnet|testnet|[0-9]+)}?'].$post({
|
|
1212
1854
|
param: { chain: 'testnet' },
|
|
1213
1855
|
})
|
|
1214
1856
|
|