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
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Selectable } from 'kysely'
|
|
2
|
+
|
|
3
|
+
import type * as Db from '../Db.js'
|
|
4
|
+
import type * as db_Schema from '../Schema.js'
|
|
5
|
+
|
|
6
|
+
/** Columns of the `stripe_customers` table, derived from `Schema.StripeCustomer`. */
|
|
7
|
+
export type Table = db_Schema.StripeCustomer
|
|
8
|
+
|
|
9
|
+
/** A stored Stripe billing-source row. */
|
|
10
|
+
export type Record = Selectable<Table>
|
|
11
|
+
|
|
12
|
+
/** A billing status. */
|
|
13
|
+
export type Status = Record['status']
|
|
14
|
+
|
|
15
|
+
/** Billing statuses; `active` alone opens the production sponsorship gate. */
|
|
16
|
+
export const statuses = ['active', 'canceled', 'none', 'past_due'] as const satisfies readonly Status[] // prettier-ignore
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Inserts a Stripe billing source (status `none`) and returns the stored record.
|
|
20
|
+
* Idempotent per organization: a concurrent first-checkout race resolves to
|
|
21
|
+
* the winner's row — the loser's Stripe customer stays orphaned in Stripe,
|
|
22
|
+
* which is harmless.
|
|
23
|
+
*
|
|
24
|
+
* @param db - The database.
|
|
25
|
+
* @param input - The Stripe source to insert.
|
|
26
|
+
* @returns The stored record.
|
|
27
|
+
*/
|
|
28
|
+
export async function create(db: Db.Db, input: create.Input): Promise<Record> {
|
|
29
|
+
const now = new Date().toISOString()
|
|
30
|
+
const environment = input.environment ?? 'production'
|
|
31
|
+
const inserted = await db.kysely
|
|
32
|
+
.insertInto('stripe_customers')
|
|
33
|
+
.values({
|
|
34
|
+
createdAt: now,
|
|
35
|
+
environment,
|
|
36
|
+
orgId: input.orgId,
|
|
37
|
+
status: 'none',
|
|
38
|
+
stripeCustomerId: input.stripeCustomerId,
|
|
39
|
+
updatedAt: now,
|
|
40
|
+
})
|
|
41
|
+
// Untargeted so it holds against either the org pkey (before the pkey drop
|
|
42
|
+
// release) or the `(org_id, environment)` unique index (after).
|
|
43
|
+
.onConflict((oc) => oc.doNothing())
|
|
44
|
+
.returningAll()
|
|
45
|
+
.executeTakeFirst()
|
|
46
|
+
if (inserted) return inserted
|
|
47
|
+
return await db.kysely
|
|
48
|
+
.selectFrom('stripe_customers')
|
|
49
|
+
.selectAll()
|
|
50
|
+
.where('orgId', '=', input.orgId)
|
|
51
|
+
.where('environment', '=', environment)
|
|
52
|
+
.executeTakeFirstOrThrow()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare namespace create {
|
|
56
|
+
/** Fields accepted when inserting a Stripe billing source. */
|
|
57
|
+
type Input = {
|
|
58
|
+
/** Environment this source backs; defaults to `production`. */
|
|
59
|
+
environment?: Record['environment'] | undefined
|
|
60
|
+
/** Organization id (`org_…`) the Stripe source belongs to. */
|
|
61
|
+
orgId: string
|
|
62
|
+
/** Stripe customer id backing this account. */
|
|
63
|
+
stripeCustomerId: string
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Deletes an organization's Stripe billing source. The Stripe customer is never
|
|
69
|
+
* deleted; its invoice history stays in Stripe for audit.
|
|
70
|
+
*
|
|
71
|
+
* @param db - The database.
|
|
72
|
+
* @param orgId - The organization id (`org_…`).
|
|
73
|
+
* @returns Whether a Stripe source existed and was deleted.
|
|
74
|
+
*/
|
|
75
|
+
export async function deleteByOrg(db: Db.Db, orgId: string): Promise<boolean> {
|
|
76
|
+
const result = await db.kysely
|
|
77
|
+
.deleteFrom('stripe_customers')
|
|
78
|
+
.where('orgId', '=', orgId)
|
|
79
|
+
.executeTakeFirst()
|
|
80
|
+
return result.numDeletedRows > 0n
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Reads an organization's Stripe billing source.
|
|
85
|
+
*
|
|
86
|
+
* @param db - The database.
|
|
87
|
+
* @param orgId - The organization id (`org_…`).
|
|
88
|
+
* @param environment - The environment to read; defaults to `production`.
|
|
89
|
+
* @returns The stored record, or `undefined` when the org has none.
|
|
90
|
+
*/
|
|
91
|
+
export function get(
|
|
92
|
+
db: Db.Db,
|
|
93
|
+
orgId: string,
|
|
94
|
+
environment: Record['environment'] = 'production',
|
|
95
|
+
): Promise<Record | undefined> {
|
|
96
|
+
return db.kysely
|
|
97
|
+
.selectFrom('stripe_customers')
|
|
98
|
+
.selectAll()
|
|
99
|
+
.where('orgId', '=', orgId)
|
|
100
|
+
.where('environment', '=', environment)
|
|
101
|
+
.executeTakeFirst()
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Lists every billing source in an environment — the driver set for the cron
|
|
106
|
+
* job that reconciles cached billing snapshots (e.g. API-key records) against
|
|
107
|
+
* this authoritative table.
|
|
108
|
+
*
|
|
109
|
+
* @param db - The database.
|
|
110
|
+
* @param environment - The environment to enumerate.
|
|
111
|
+
* @returns The stored records for that environment.
|
|
112
|
+
*/
|
|
113
|
+
export function listByEnvironment(
|
|
114
|
+
db: Db.Db,
|
|
115
|
+
environment: Record['environment'],
|
|
116
|
+
): Promise<Record[]> {
|
|
117
|
+
return db.kysely
|
|
118
|
+
.selectFrom('stripe_customers')
|
|
119
|
+
.selectAll()
|
|
120
|
+
.where('environment', '=', environment)
|
|
121
|
+
.execute()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Reads a Stripe billing source by its customer id — the webhook handler's
|
|
126
|
+
* lookup for inbound events.
|
|
127
|
+
*
|
|
128
|
+
* @param db - The database.
|
|
129
|
+
* @param stripeCustomerId - The Stripe customer id.
|
|
130
|
+
* @returns The stored record, or `undefined` for unknown customers.
|
|
131
|
+
*/
|
|
132
|
+
export function getByCustomer(db: Db.Db, stripeCustomerId: string): Promise<Record | undefined> {
|
|
133
|
+
return db.kysely
|
|
134
|
+
.selectFrom('stripe_customers')
|
|
135
|
+
.selectAll()
|
|
136
|
+
.where('stripeCustomerId', '=', stripeCustomerId)
|
|
137
|
+
.executeTakeFirst()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Sets an organization's billing status.
|
|
142
|
+
*
|
|
143
|
+
* @param db - The database.
|
|
144
|
+
* @param orgId - The organization id (`org_…`).
|
|
145
|
+
* @param status - The derived status to persist.
|
|
146
|
+
* @param environment - The environment to update; defaults to `production`.
|
|
147
|
+
* @returns The updated record, or `undefined` when the org has no Stripe source.
|
|
148
|
+
*/
|
|
149
|
+
export function setStatus(
|
|
150
|
+
db: Db.Db,
|
|
151
|
+
orgId: string,
|
|
152
|
+
status: Status,
|
|
153
|
+
environment: Record['environment'] = 'production',
|
|
154
|
+
): Promise<Record | undefined> {
|
|
155
|
+
return db.kysely
|
|
156
|
+
.updateTable('stripe_customers')
|
|
157
|
+
.set({ status, updatedAt: new Date().toISOString() })
|
|
158
|
+
.where('orgId', '=', orgId)
|
|
159
|
+
.where('environment', '=', environment)
|
|
160
|
+
.returningAll()
|
|
161
|
+
.executeTakeFirst()
|
|
162
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Selectable } from 'kysely'
|
|
2
|
+
|
|
3
|
+
import * as Id from '../../internal/Id.js'
|
|
4
|
+
import type * as Db from '../Db.js'
|
|
5
|
+
import type * as db_Schema from '../Schema.js'
|
|
6
|
+
|
|
7
|
+
/** Columns of the `users` table, derived from `Schema.User`. */
|
|
8
|
+
export type Table = db_Schema.User
|
|
9
|
+
|
|
10
|
+
/** A stored user row. */
|
|
11
|
+
export type Record = Selectable<Table>
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reads a user by id (`usr_…`).
|
|
15
|
+
*
|
|
16
|
+
* @param db - The database.
|
|
17
|
+
* @param id - The user id.
|
|
18
|
+
* @returns The record, or `undefined` when absent.
|
|
19
|
+
*/
|
|
20
|
+
export function get(db: Db.Db, id: string): Promise<Record | undefined> {
|
|
21
|
+
return db.kysely.selectFrom('users').selectAll().where('id', '=', id).executeTakeFirst()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Reads a user by wallet address (compared lowercase).
|
|
26
|
+
*
|
|
27
|
+
* @param db - The database.
|
|
28
|
+
* @param address - The wallet address.
|
|
29
|
+
* @returns The record, or `undefined` when absent.
|
|
30
|
+
*/
|
|
31
|
+
export function getByAddress(db: Db.Db, address: string): Promise<Record | undefined> {
|
|
32
|
+
return db.kysely
|
|
33
|
+
.selectFrom('users')
|
|
34
|
+
.selectAll()
|
|
35
|
+
.where('address', '=', address.toLowerCase())
|
|
36
|
+
.executeTakeFirst()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Inserts a user for `address` when absent and returns the stored record.
|
|
41
|
+
* Existing users are returned unchanged, so repeated sign-ins are idempotent.
|
|
42
|
+
*
|
|
43
|
+
* @param db - The database.
|
|
44
|
+
* @param input - The user to ensure.
|
|
45
|
+
* @returns The stored record.
|
|
46
|
+
*/
|
|
47
|
+
export async function upsertByAddress(db: Db.Db, input: upsertByAddress.Input): Promise<Record> {
|
|
48
|
+
const address = input.address.toLowerCase()
|
|
49
|
+
const now = new Date().toISOString()
|
|
50
|
+
const inserted = await db.kysely
|
|
51
|
+
.insertInto('users')
|
|
52
|
+
.values({ address, createdAt: now, email: null, id: Id.generate('usr'), updatedAt: now })
|
|
53
|
+
.onConflict((oc) => oc.column('address').doNothing())
|
|
54
|
+
.returningAll()
|
|
55
|
+
.executeTakeFirst()
|
|
56
|
+
if (inserted) return inserted
|
|
57
|
+
return db.kysely
|
|
58
|
+
.selectFrom('users')
|
|
59
|
+
.selectAll()
|
|
60
|
+
.where('address', '=', address)
|
|
61
|
+
.executeTakeFirstOrThrow()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export declare namespace upsertByAddress {
|
|
65
|
+
/** Fields accepted when ensuring a user. */
|
|
66
|
+
type Input = {
|
|
67
|
+
/** Wallet address that signed in (stored lowercase). */
|
|
68
|
+
address: string
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Sets a user's verified email, bumping `updatedAt`.
|
|
74
|
+
*
|
|
75
|
+
* @param db - The database.
|
|
76
|
+
* @param id - The user id (`usr_…`).
|
|
77
|
+
* @param email - The verified email.
|
|
78
|
+
*/
|
|
79
|
+
export async function setEmail(db: Db.Db, id: string, email: string): Promise<void> {
|
|
80
|
+
await db.kysely
|
|
81
|
+
.updateTable('users')
|
|
82
|
+
.set({ email, updatedAt: new Date().toISOString() })
|
|
83
|
+
.where('id', '=', id)
|
|
84
|
+
.execute()
|
|
85
|
+
}
|
|
@@ -34,6 +34,7 @@ export const messages: Record<AbiErrorName, string> = {
|
|
|
34
34
|
ChannelNotFound: 'Channel not found.',
|
|
35
35
|
CloseNotReady: 'Channel is not ready to close.',
|
|
36
36
|
ContractPaused: 'Contract is paused.',
|
|
37
|
+
DelegateCallNotAllowed: 'Delegate call is not allowed.',
|
|
37
38
|
DepositOverflow: 'Deposit overflow.',
|
|
38
39
|
DivisionByZero: 'Division by zero.',
|
|
39
40
|
EmptyV1ValidatorSet: 'Validator set is empty.',
|
|
@@ -65,6 +66,7 @@ export const messages: Record<AbiErrorName, string> = {
|
|
|
65
66
|
InvalidLogoURI: 'Invalid logo URI.',
|
|
66
67
|
InvalidMasterAddress: 'Invalid master address.',
|
|
67
68
|
InvalidMigrationIndex: 'Invalid migration index.',
|
|
69
|
+
InvalidMode: 'Invalid mode.',
|
|
68
70
|
InvalidNonceKey: 'Invalid nonce key.',
|
|
69
71
|
InvalidOwner: 'Invalid owner.',
|
|
70
72
|
InvalidPayee: 'Invalid payee.',
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Address, Hex, P256 } from 'ox'
|
|
2
2
|
import { MultisigConfig, SignatureEnvelope, TxEnvelopeTempo } from 'ox/tempo'
|
|
3
3
|
import { createClient, custom } from 'viem'
|
|
4
|
+
import { prepareTransactionRequest, sendTransactionSync, signTransaction } from 'viem/actions'
|
|
4
5
|
import { Account, Transaction } from 'viem/tempo'
|
|
5
6
|
import { tempoDevnet } from 'viem/tempo/chains'
|
|
6
7
|
|
|
8
|
+
import * as Relay from '../../../test/Relay.js'
|
|
9
|
+
import * as Runtime from '../../../test/runtime.js'
|
|
10
|
+
import * as StateStore from '../../internal/Store.js'
|
|
7
11
|
import * as Multisig from './multisig.js'
|
|
8
12
|
|
|
9
13
|
const privateKey_1 = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
|
|
@@ -245,12 +249,12 @@ describe('config resolution', () => {
|
|
|
245
249
|
expect({
|
|
246
250
|
hash,
|
|
247
251
|
init: transaction_submitted.signature.init
|
|
248
|
-
? MultisigConfig.
|
|
252
|
+
? MultisigConfig.getAddress(transaction_submitted.signature.init)
|
|
249
253
|
: undefined,
|
|
250
254
|
}).toMatchInlineSnapshot(`
|
|
251
255
|
{
|
|
252
256
|
"hash": "${hash}",
|
|
253
|
-
"init": "${
|
|
257
|
+
"init": "${account.address.toLowerCase()}",
|
|
254
258
|
}
|
|
255
259
|
`)
|
|
256
260
|
})
|
|
@@ -311,12 +315,12 @@ describe('config resolution', () => {
|
|
|
311
315
|
expect({
|
|
312
316
|
hash,
|
|
313
317
|
init: transaction_submitted.signature.init
|
|
314
|
-
? MultisigConfig.
|
|
318
|
+
? MultisigConfig.getAddress(transaction_submitted.signature.init)
|
|
315
319
|
: undefined,
|
|
316
320
|
}).toMatchInlineSnapshot(`
|
|
317
321
|
{
|
|
318
322
|
"hash": "${hash}",
|
|
319
|
-
"init": "${
|
|
323
|
+
"init": "${account.address.toLowerCase()}",
|
|
320
324
|
}
|
|
321
325
|
`)
|
|
322
326
|
})
|
|
@@ -376,12 +380,12 @@ describe('config resolution', () => {
|
|
|
376
380
|
expect({
|
|
377
381
|
hash,
|
|
378
382
|
init: transaction_submitted.signature.init
|
|
379
|
-
? MultisigConfig.
|
|
383
|
+
? MultisigConfig.getAddress(transaction_submitted.signature.init)
|
|
380
384
|
: undefined,
|
|
381
385
|
}).toMatchInlineSnapshot(`
|
|
382
386
|
{
|
|
383
387
|
"hash": "${hash}",
|
|
384
|
-
"init": "${
|
|
388
|
+
"init": "${account.address.toLowerCase()}",
|
|
385
389
|
}
|
|
386
390
|
`)
|
|
387
391
|
})
|
|
@@ -474,12 +478,12 @@ describe('config resolution', () => {
|
|
|
474
478
|
signature: SignatureEnvelope.Multisig
|
|
475
479
|
}
|
|
476
480
|
expect({
|
|
481
|
+
account: transaction_submitted.signature.account,
|
|
477
482
|
hash,
|
|
478
483
|
init: transaction_submitted.signature.init,
|
|
479
|
-
genesisConfigId: transaction_submitted.signature.genesisConfigId,
|
|
480
484
|
}).toMatchInlineSnapshot(`
|
|
481
485
|
{
|
|
482
|
-
"
|
|
486
|
+
"account": "${account.address.toLowerCase()}",
|
|
483
487
|
"hash": "${hash}",
|
|
484
488
|
"init": undefined,
|
|
485
489
|
}
|
|
@@ -566,6 +570,7 @@ describe('handleRawTransaction with sponsor', () => {
|
|
|
566
570
|
signatures: [signature_2],
|
|
567
571
|
} as never)
|
|
568
572
|
const broadcasted: string[] = []
|
|
573
|
+
const sponsored: unknown[] = []
|
|
569
574
|
|
|
570
575
|
await Multisig.handleRawTransaction({
|
|
571
576
|
getClient: (() => undefined) as never,
|
|
@@ -593,6 +598,10 @@ describe('handleRawTransaction with sponsor', () => {
|
|
|
593
598
|
request: { params: [second] },
|
|
594
599
|
sponsor: {
|
|
595
600
|
account: feePayer as never,
|
|
601
|
+
onSponsored: (event) => {
|
|
602
|
+
sponsored.push(event)
|
|
603
|
+
expect(broadcasted).toHaveLength(0)
|
|
604
|
+
},
|
|
596
605
|
resolveFeeToken: () => feeToken,
|
|
597
606
|
},
|
|
598
607
|
store,
|
|
@@ -608,6 +617,7 @@ describe('handleRawTransaction with sponsor', () => {
|
|
|
608
617
|
feeToken: (transaction_broadcasted['feeToken'] as string).toLowerCase(),
|
|
609
618
|
hash,
|
|
610
619
|
init: Boolean(signature.init),
|
|
620
|
+
sponsored: sponsored.length,
|
|
611
621
|
signature: signature.type,
|
|
612
622
|
}).toMatchInlineSnapshot(`
|
|
613
623
|
{
|
|
@@ -616,6 +626,7 @@ describe('handleRawTransaction with sponsor', () => {
|
|
|
616
626
|
"hash": "${hash}",
|
|
617
627
|
"init": true,
|
|
618
628
|
"signature": "multisig",
|
|
629
|
+
"sponsored": 1,
|
|
619
630
|
}
|
|
620
631
|
`)
|
|
621
632
|
})
|
|
@@ -706,13 +717,77 @@ describe('handleRawTransaction with sponsor', () => {
|
|
|
706
717
|
})
|
|
707
718
|
})
|
|
708
719
|
|
|
720
|
+
describe.runIf(Runtime.get().mode === 'localnet' && process.env.TEMPO_IMAGE_TAG === 'sha-8968664')(
|
|
721
|
+
'e2e',
|
|
722
|
+
() => {
|
|
723
|
+
const owner_1 = Relay.accounts[1]!
|
|
724
|
+
const owner_2 = Relay.accounts[2]!
|
|
725
|
+
const feePayer = Relay.accounts[0]!
|
|
726
|
+
const sponsorFeeToken = Relay.addresses.pathUsd
|
|
727
|
+
const store = StateStore.memory()
|
|
728
|
+
let client: ReturnType<typeof Relay.getClient>
|
|
729
|
+
let server: Relay.Server
|
|
730
|
+
|
|
731
|
+
beforeAll(async () => {
|
|
732
|
+
server = await Relay.createServer(
|
|
733
|
+
(
|
|
734
|
+
await Relay.relay({
|
|
735
|
+
feePayer: {
|
|
736
|
+
account: feePayer,
|
|
737
|
+
feeToken: sponsorFeeToken,
|
|
738
|
+
},
|
|
739
|
+
multisig: { store },
|
|
740
|
+
})
|
|
741
|
+
).listener,
|
|
742
|
+
)
|
|
743
|
+
client = Relay.getClient({ url: server.url })
|
|
744
|
+
})
|
|
745
|
+
|
|
746
|
+
afterAll(() => {
|
|
747
|
+
server.close()
|
|
748
|
+
})
|
|
749
|
+
|
|
750
|
+
test('behavior: sponsors bootstrap multisig', async () => {
|
|
751
|
+
const account = Account.fromMultisig({
|
|
752
|
+
threshold: 2,
|
|
753
|
+
owners: [
|
|
754
|
+
{ owner: owner_1.address, weight: 1 },
|
|
755
|
+
{ owner: owner_2.address, weight: 1 },
|
|
756
|
+
],
|
|
757
|
+
})
|
|
758
|
+
const transaction = await prepareTransactionRequest(client, {
|
|
759
|
+
account,
|
|
760
|
+
feePayer: true,
|
|
761
|
+
to: account.address,
|
|
762
|
+
value: 0n,
|
|
763
|
+
})
|
|
764
|
+
const signatures = await Promise.all(
|
|
765
|
+
[owner_1, owner_2].map((owner) =>
|
|
766
|
+
signTransaction(client, { ...transaction, account: owner }),
|
|
767
|
+
),
|
|
768
|
+
)
|
|
769
|
+
const receipt = await sendTransactionSync(client, {
|
|
770
|
+
...transaction,
|
|
771
|
+
account,
|
|
772
|
+
signatures,
|
|
773
|
+
})
|
|
774
|
+
|
|
775
|
+
expect(receipt).toMatchObject({
|
|
776
|
+
feePayer: feePayer.address.toLowerCase(),
|
|
777
|
+
feeToken: sponsorFeeToken.toLowerCase(),
|
|
778
|
+
from: account.address.toLowerCase(),
|
|
779
|
+
status: 'success',
|
|
780
|
+
})
|
|
781
|
+
})
|
|
782
|
+
},
|
|
783
|
+
)
|
|
784
|
+
|
|
709
785
|
function createOperation(): Multisig.Operation {
|
|
710
786
|
const now = Date.now()
|
|
711
787
|
return {
|
|
712
788
|
account: '0x0000000000000000000000000000000000000001',
|
|
713
789
|
chainId: tempoDevnet.id,
|
|
714
790
|
createdAt: now,
|
|
715
|
-
genesisConfigId: `0x${'11'.repeat(32)}`,
|
|
716
791
|
id: `0x${'22'.repeat(32)}`,
|
|
717
792
|
payload: `0x${'33'.repeat(32)}`,
|
|
718
793
|
signatures: [],
|
|
@@ -737,7 +812,6 @@ function withoutInit(serialized: `0x${string}`) {
|
|
|
737
812
|
return TxEnvelopeTempo.serialize(TxEnvelopeTempo.from(unsigned as never), {
|
|
738
813
|
signature: SignatureEnvelope.from({
|
|
739
814
|
account: signature.account,
|
|
740
|
-
genesisConfigId: signature.genesisConfigId,
|
|
741
815
|
signatures: signature.signatures,
|
|
742
816
|
}),
|
|
743
817
|
})
|