tapimo 0.14.0 → 0.15.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 +7 -4
- package/dist/ApiKey.js +1 -1
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +95 -14
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +360 -49
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +12457 -10365
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +300 -22
- package/dist/App.js.map +1 -1
- package/dist/Assets.d.ts.map +1 -1
- package/dist/Assets.js +2 -1
- package/dist/Assets.js.map +1 -1
- package/dist/Handler.d.ts +0 -1
- package/dist/Handler.d.ts.map +1 -1
- package/dist/Handler.js +0 -1
- package/dist/Handler.js.map +1 -1
- package/dist/Scope.d.ts +13 -5
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +16 -5
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.js +1 -1
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +3057 -549
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/App.js +26 -5
- package/dist/admin/App.js.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +159 -7
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +95 -43
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/earn-vaults.d.ts +1398 -0
- package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
- package/dist/admin/apps/earn-vaults.js +463 -7
- package/dist/admin/apps/earn-vaults.js.map +1 -1
- package/dist/admin/apps/organizations.d.ts +267 -15
- package/dist/admin/apps/organizations.d.ts.map +1 -1
- package/dist/admin/apps/organizations.js +241 -25
- package/dist/admin/apps/organizations.js.map +1 -1
- package/dist/admin/apps/routes-support.d.ts +95 -0
- package/dist/admin/apps/routes-support.d.ts.map +1 -0
- package/dist/admin/apps/routes-support.js +151 -0
- package/dist/admin/apps/routes-support.js.map +1 -0
- package/dist/admin/apps/routes.d.ts +2764 -0
- package/dist/admin/apps/routes.d.ts.map +1 -0
- package/dist/admin/apps/routes.js +728 -0
- package/dist/admin/apps/routes.js.map +1 -0
- package/dist/admin/apps/subsidies.d.ts +501 -0
- package/dist/admin/apps/subsidies.d.ts.map +1 -0
- package/dist/admin/apps/subsidies.js +384 -0
- package/dist/admin/apps/subsidies.js.map +1 -0
- package/dist/admin/apps/verified-tokens.d.ts +88 -88
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.js +3 -3
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.d.ts.map +1 -1
- package/dist/admin/ui.generated.js +129 -69
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/analytics/Analytics.d.ts +5 -2
- package/dist/analytics/Analytics.d.ts.map +1 -1
- package/dist/analytics/Analytics.js +31 -1
- package/dist/analytics/Analytics.js.map +1 -1
- package/dist/analytics/tables/requestEvents.d.ts +2 -1
- package/dist/analytics/tables/requestEvents.d.ts.map +1 -1
- package/dist/analytics/tables/requestEvents.js +10 -1
- package/dist/analytics/tables/requestEvents.js.map +1 -1
- package/dist/analytics/tables/routesLifecycleIntervals.d.ts +72 -0
- package/dist/analytics/tables/routesLifecycleIntervals.d.ts.map +1 -0
- package/dist/analytics/tables/routesLifecycleIntervals.js +56 -0
- package/dist/analytics/tables/routesLifecycleIntervals.js.map +1 -0
- package/dist/apps/Zones.d.ts +21 -12526
- package/dist/apps/Zones.d.ts.map +1 -1
- package/dist/apps/Zones.js +37 -5
- package/dist/apps/Zones.js.map +1 -1
- package/dist/apps/data/App.d.ts +3971 -2595
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +76 -21
- package/dist/apps/data/App.js.map +1 -1
- package/dist/apps/data/routes/activities.d.ts +364 -34
- package/dist/apps/data/routes/activities.d.ts.map +1 -1
- package/dist/apps/data/routes/activities.js +495 -190
- package/dist/apps/data/routes/activities.js.map +1 -1
- package/dist/apps/data/routes/addresses.d.ts +72 -0
- package/dist/apps/data/routes/addresses.d.ts.map +1 -1
- package/dist/apps/data/routes/blocks.d.ts +37 -37
- package/dist/apps/data/routes/coingecko.d.ts.map +1 -1
- package/dist/apps/data/routes/coingecko.js +47 -21
- package/dist/apps/data/routes/coingecko.js.map +1 -1
- package/dist/apps/data/routes/earn.d.ts +1450 -337
- package/dist/apps/data/routes/earn.d.ts.map +1 -1
- package/dist/apps/data/routes/earn.js +1226 -144
- package/dist/apps/data/routes/earn.js.map +1 -1
- package/dist/apps/data/routes/fee-amm.d.ts +5 -0
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
- package/dist/apps/data/routes/fee-amm.js +31 -19
- package/dist/apps/data/routes/fee-amm.js.map +1 -1
- package/dist/apps/data/routes/indexer.d.ts +125 -0
- package/dist/apps/data/routes/indexer.d.ts.map +1 -1
- package/dist/apps/data/routes/indexer.js +83 -27
- package/dist/apps/data/routes/indexer.js.map +1 -1
- package/dist/apps/data/routes/rpc.d.ts +507 -33
- package/dist/apps/data/routes/rpc.d.ts.map +1 -1
- package/dist/apps/data/routes/rpc.js +266 -156
- package/dist/apps/data/routes/rpc.js.map +1 -1
- package/dist/apps/data/routes/tokenlist.d.ts +47 -15
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
- package/dist/apps/data/routes/tokenlist.js +68 -11
- package/dist/apps/data/routes/tokenlist.js.map +1 -1
- package/dist/apps/data/routes/tokens.d.ts +2 -0
- package/dist/apps/data/routes/tokens.d.ts.map +1 -1
- package/dist/apps/data/routes/tokens.js +26 -14
- package/dist/apps/data/routes/tokens.js.map +1 -1
- package/dist/apps/data/routes/transfers.d.ts +28 -12
- package/dist/apps/data/routes/transfers.d.ts.map +1 -1
- package/dist/apps/data/routes/transfers.js +9 -7
- package/dist/apps/data/routes/transfers.js.map +1 -1
- package/dist/apps/data/routes/valuation.d.ts +30 -30
- package/dist/apps/data/routes/verified-tokens.d.ts +9 -9
- package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -1
- package/dist/apps/data/routes/verified-tokens.js +64 -20
- package/dist/apps/data/routes/verified-tokens.js.map +1 -1
- package/dist/apps/data/routes/webhooks.d.ts +613 -176
- package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/data/routes/webhooks.js +291 -195
- package/dist/apps/data/routes/webhooks.js.map +1 -1
- package/dist/apps/data/routes/zones.d.ts.map +1 -1
- package/dist/apps/data/routes/zones.js +20 -12
- package/dist/apps/data/routes/zones.js.map +1 -1
- package/dist/apps/docs/reference.js +2 -2
- package/dist/apps/docs/reference.js.map +1 -1
- package/dist/apps/index.d.ts +1 -1
- package/dist/apps/index.d.ts.map +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/management/App.d.ts +3763 -3385
- package/dist/apps/management/App.d.ts.map +1 -1
- package/dist/apps/management/App.js +5 -14
- package/dist/apps/management/App.js.map +1 -1
- package/dist/apps/management/Billing.d.ts +48 -7
- package/dist/apps/management/Billing.d.ts.map +1 -1
- package/dist/apps/management/Billing.js +204 -25
- package/dist/apps/management/Billing.js.map +1 -1
- package/dist/apps/management/routes/api-keys.d.ts +106 -4
- package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
- package/dist/apps/management/routes/api-keys.js +43 -15
- package/dist/apps/management/routes/api-keys.js.map +1 -1
- package/dist/apps/management/routes/billing.d.ts +290 -4
- package/dist/apps/management/routes/billing.d.ts.map +1 -1
- package/dist/apps/management/routes/billing.js +274 -49
- package/dist/apps/management/routes/billing.js.map +1 -1
- package/dist/apps/management/routes/faucet.d.ts +6 -6
- package/dist/apps/management/routes/faucet.js +1 -1
- package/dist/apps/management/routes/faucet.js.map +1 -1
- package/dist/apps/management/routes/invitations.d.ts +77 -2
- package/dist/apps/management/routes/invitations.d.ts.map +1 -1
- package/dist/apps/management/routes/invitations.js +117 -13
- package/dist/apps/management/routes/invitations.js.map +1 -1
- package/dist/apps/management/routes/invite-links.d.ts +4 -4
- package/dist/apps/management/routes/me.d.ts.map +1 -1
- package/dist/apps/management/routes/me.js +6 -2
- package/dist/apps/management/routes/me.js.map +1 -1
- package/dist/apps/management/routes/members.d.ts +30 -30
- package/dist/apps/management/routes/orgs.d.ts +18 -2
- package/dist/apps/management/routes/orgs.d.ts.map +1 -1
- package/dist/apps/management/routes/orgs.js +52 -12
- package/dist/apps/management/routes/orgs.js.map +1 -1
- package/dist/apps/management/routes/projects.d.ts +4 -4
- package/dist/apps/management/routes/projects.d.ts.map +1 -1
- package/dist/apps/management/routes/projects.js +6 -1
- package/dist/apps/management/routes/projects.js.map +1 -1
- package/dist/apps/management/routes/scopes.d.ts.map +1 -1
- package/dist/apps/management/routes/scopes.js +4 -1
- package/dist/apps/management/routes/scopes.js.map +1 -1
- package/dist/apps/management/routes/usage.d.ts +24 -24
- package/dist/apps/management/routes/usage.js +21 -4
- package/dist/apps/management/routes/usage.js.map +1 -1
- package/dist/apps/management/routes/verified-token-requests.d.ts +2 -2
- package/dist/apps/management/routes/webhooks.d.ts +280 -214
- package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/management/routes/webhooks.js +58 -12
- package/dist/apps/management/routes/webhooks.js.map +1 -1
- package/dist/apps/mcp.d.ts +1 -1
- package/dist/apps/mcp.js +7 -7
- package/dist/apps/mcp.js.map +1 -1
- package/dist/apps/mpp/App.d.ts.map +1 -1
- package/dist/apps/mpp/App.js +35 -7
- package/dist/apps/mpp/App.js.map +1 -1
- package/dist/apps/mpp/internal/Adapter.d.ts +2 -0
- package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
- package/dist/apps/mpp/internal/Adapter.js +30 -1
- package/dist/apps/mpp/internal/Adapter.js.map +1 -1
- package/dist/apps/mpp/internal/Policy.d.ts +22 -4
- package/dist/apps/mpp/internal/Policy.d.ts.map +1 -1
- package/dist/apps/mpp/internal/Policy.js +24 -6
- package/dist/apps/mpp/internal/Policy.js.map +1 -1
- package/dist/apps/mpp/internal/Sponsorship.d.ts +3 -0
- package/dist/apps/mpp/internal/Sponsorship.d.ts.map +1 -1
- package/dist/apps/mpp/internal/Sponsorship.js +6 -3
- package/dist/apps/mpp/internal/Sponsorship.js.map +1 -1
- package/dist/apps/relay/App.d.ts +2 -0
- package/dist/apps/relay/App.d.ts.map +1 -1
- package/dist/apps/relay/App.js +134 -75
- package/dist/apps/relay/App.js.map +1 -1
- package/dist/apps/relay/Sponsorships.d.ts +5 -3
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
- package/dist/apps/relay/Sponsorships.js +209 -28
- package/dist/apps/relay/Sponsorships.js.map +1 -1
- package/dist/apps/{funding → routes}/Access.d.ts +4 -4
- package/dist/apps/routes/Access.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/Access.js +4 -4
- package/dist/apps/routes/Access.js.map +1 -0
- package/dist/apps/{funding → routes}/App.d.ts +418 -124
- package/dist/apps/{funding → routes}/App.d.ts.map +1 -1
- package/dist/apps/{funding → routes}/App.js +16 -16
- package/dist/apps/routes/App.js.map +1 -0
- package/dist/apps/routes/Inventory.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/Inventory.js +2 -2
- package/dist/apps/routes/Inventory.js.map +1 -0
- package/dist/apps/routes/index.d.ts +2 -0
- package/dist/apps/routes/index.d.ts.map +1 -0
- package/dist/apps/routes/index.js +2 -0
- package/dist/apps/routes/index.js.map +1 -0
- package/dist/apps/{funding → routes}/routes/chains.d.ts +7 -7
- package/dist/apps/routes/routes/chains.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/routes/chains.js +25 -25
- package/dist/apps/routes/routes/chains.js.map +1 -0
- package/dist/apps/{funding → routes}/routes/deposit-addresses.d.ts +107 -43
- package/dist/apps/routes/routes/deposit-addresses.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/routes/deposit-addresses.js +497 -222
- package/dist/apps/routes/routes/deposit-addresses.js.map +1 -0
- package/dist/apps/{funding → routes}/routes/providers.d.ts +8 -8
- package/dist/apps/routes/routes/providers.d.ts.map +1 -0
- package/dist/apps/routes/routes/providers.js +57 -0
- package/dist/apps/routes/routes/providers.js.map +1 -0
- package/dist/apps/{funding → routes}/routes/quotes.d.ts +19 -16
- package/dist/apps/routes/routes/quotes.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/routes/quotes.js +55 -38
- package/dist/apps/routes/routes/quotes.js.map +1 -0
- package/dist/apps/{funding → routes}/routes/transfers.d.ts +379 -74
- package/dist/apps/routes/routes/transfers.d.ts.map +1 -0
- package/dist/apps/routes/routes/transfers.js +1140 -0
- package/dist/apps/routes/routes/transfers.js.map +1 -0
- package/dist/cli/Cli.d.ts +30 -0
- package/dist/cli/Cli.d.ts.map +1 -1
- package/dist/cli/commands/admin.d.ts +36 -0
- package/dist/cli/commands/admin.d.ts.map +1 -1
- package/dist/cli/commands/admin.js +273 -0
- package/dist/cli/commands/admin.js.map +1 -1
- package/dist/cloudflare.d.ts +16 -14
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +26 -21
- package/dist/cloudflare.js.map +1 -1
- package/dist/db/Db.d.ts +63 -21
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +1030 -15
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +780 -133
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +575 -162
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts +4 -0
- package/dist/db/tables/apiKeyAdmissionBootstraps.d.ts.map +1 -0
- package/dist/db/tables/apiKeyAdmissionBootstraps.js +2 -0
- package/dist/db/tables/apiKeyAdmissionBootstraps.js.map +1 -0
- package/dist/db/tables/apiKeyAdmissions.d.ts +73 -0
- package/dist/db/tables/apiKeyAdmissions.d.ts.map +1 -0
- package/dist/db/tables/apiKeyAdmissions.js +142 -0
- package/dist/db/tables/apiKeyAdmissions.js.map +1 -0
- package/dist/db/tables/apiKeyOwnerAdmissions.d.ts +4 -0
- package/dist/db/tables/apiKeyOwnerAdmissions.d.ts.map +1 -0
- package/dist/db/tables/apiKeyOwnerAdmissions.js +2 -0
- package/dist/db/tables/apiKeyOwnerAdmissions.js.map +1 -0
- package/dist/db/tables/apiKeyOwnerTombstones.d.ts +20 -0
- package/dist/db/tables/apiKeyOwnerTombstones.d.ts.map +1 -0
- package/dist/db/tables/apiKeyOwnerTombstones.js +57 -0
- package/dist/db/tables/apiKeyOwnerTombstones.js.map +1 -0
- package/dist/db/tables/apiKeyRevocations.d.ts +21 -0
- package/dist/db/tables/apiKeyRevocations.d.ts.map +1 -0
- package/dist/db/tables/apiKeyRevocations.js +98 -0
- package/dist/db/tables/apiKeyRevocations.js.map +1 -0
- package/dist/db/tables/authAccounts.d.ts +47 -0
- package/dist/db/tables/authAccounts.d.ts.map +1 -0
- package/dist/db/tables/authAccounts.js +72 -0
- package/dist/db/tables/authAccounts.js.map +1 -0
- package/dist/db/tables/authSessions.d.ts +12 -0
- package/dist/db/tables/authSessions.d.ts.map +1 -0
- package/dist/db/tables/authSessions.js +2 -0
- package/dist/db/tables/authSessions.js.map +1 -0
- package/dist/db/tables/authVerifications.d.ts +12 -0
- package/dist/db/tables/authVerifications.d.ts.map +1 -0
- package/dist/db/tables/authVerifications.js +2 -0
- package/dist/db/tables/authVerifications.js.map +1 -0
- package/dist/db/tables/invitations.d.ts +17 -1
- package/dist/db/tables/invitations.d.ts.map +1 -1
- package/dist/db/tables/invitations.js +123 -43
- package/dist/db/tables/invitations.js.map +1 -1
- package/dist/db/tables/memberships.d.ts +8 -0
- package/dist/db/tables/memberships.d.ts.map +1 -1
- package/dist/db/tables/memberships.js +51 -2
- package/dist/db/tables/memberships.js.map +1 -1
- package/dist/db/tables/organizations.d.ts +32 -10
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +110 -49
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +2 -0
- package/dist/db/tables/projects.d.ts.map +1 -1
- package/dist/db/tables/projects.js +12 -3
- package/dist/db/tables/projects.js.map +1 -1
- package/dist/db/tables/requestUsage.d.ts.map +1 -1
- package/dist/db/tables/requestUsage.js.map +1 -1
- package/dist/db/tables/rewardAccounts.d.ts +86 -0
- package/dist/db/tables/rewardAccounts.d.ts.map +1 -0
- package/dist/db/tables/rewardAccounts.js +88 -0
- package/dist/db/tables/rewardAccounts.js.map +1 -0
- package/dist/db/tables/rewardCampaignDistributors.d.ts +36 -0
- package/dist/db/tables/rewardCampaignDistributors.d.ts.map +1 -0
- package/dist/db/tables/rewardCampaignDistributors.js +30 -0
- package/dist/db/tables/rewardCampaignDistributors.js.map +1 -0
- package/dist/db/tables/rewardCampaigns.d.ts +171 -0
- package/dist/db/tables/rewardCampaigns.d.ts.map +1 -0
- package/dist/db/tables/rewardCampaigns.js +392 -0
- package/dist/db/tables/rewardCampaigns.js.map +1 -0
- package/dist/db/tables/rewardCredits.d.ts +53 -0
- package/dist/db/tables/rewardCredits.d.ts.map +1 -0
- package/dist/db/tables/rewardCredits.js +63 -0
- package/dist/db/tables/rewardCredits.js.map +1 -0
- package/dist/db/tables/rewardEligibilityAssociations.d.ts +61 -0
- package/dist/db/tables/rewardEligibilityAssociations.d.ts.map +1 -0
- package/dist/db/tables/rewardEligibilityAssociations.js +103 -0
- package/dist/db/tables/rewardEligibilityAssociations.js.map +1 -0
- package/dist/db/tables/rewardRuns.d.ts +188 -0
- package/dist/db/tables/rewardRuns.d.ts.map +1 -0
- package/dist/db/tables/rewardRuns.js +278 -0
- package/dist/db/tables/rewardRuns.js.map +1 -0
- package/dist/db/tables/rewardTransactionAttempts.d.ts +100 -0
- package/dist/db/tables/rewardTransactionAttempts.d.ts.map +1 -0
- package/dist/db/tables/rewardTransactionAttempts.js +163 -0
- package/dist/db/tables/rewardTransactionAttempts.js.map +1 -0
- package/dist/db/tables/routesCatalog.d.ts +58 -0
- package/dist/db/tables/routesCatalog.d.ts.map +1 -0
- package/dist/db/tables/{fundingCatalog.js → routesCatalog.js} +19 -19
- package/dist/db/tables/routesCatalog.js.map +1 -0
- package/dist/db/tables/routesDepositAddresses.d.ts +476 -0
- package/dist/db/tables/routesDepositAddresses.d.ts.map +1 -0
- package/dist/db/tables/routesDepositAddresses.js +587 -0
- package/dist/db/tables/routesDepositAddresses.js.map +1 -0
- package/dist/db/tables/{fundingDepositRequestObservations.d.ts → routesDepositRequestObservations.d.ts} +6 -6
- package/dist/db/tables/routesDepositRequestObservations.d.ts.map +1 -0
- package/dist/db/tables/{fundingDepositRequestObservations.js → routesDepositRequestObservations.js} +6 -6
- package/dist/db/tables/routesDepositRequestObservations.js.map +1 -0
- package/dist/db/tables/{fundingDeposits.d.ts → routesDeposits.d.ts} +210 -22
- package/dist/db/tables/routesDeposits.d.ts.map +1 -0
- package/dist/db/tables/routesDeposits.js +576 -0
- package/dist/db/tables/routesDeposits.js.map +1 -0
- package/dist/db/tables/routesIdempotency.d.ts +166 -0
- package/dist/db/tables/routesIdempotency.d.ts.map +1 -0
- package/dist/db/tables/routesIdempotency.js +330 -0
- package/dist/db/tables/routesIdempotency.js.map +1 -0
- package/dist/db/tables/routesSubsidies.d.ts +27 -0
- package/dist/db/tables/routesSubsidies.d.ts.map +1 -0
- package/dist/db/tables/routesSubsidies.js +45 -0
- package/dist/db/tables/routesSubsidies.js.map +1 -0
- package/dist/db/tables/{fundingTransferEvents.d.ts → routesTransferEvents.d.ts} +3 -3
- package/dist/db/tables/routesTransferEvents.d.ts.map +1 -0
- package/dist/db/tables/{fundingTransferEvents.js → routesTransferEvents.js} +3 -3
- package/dist/db/tables/routesTransferEvents.js.map +1 -0
- package/dist/db/tables/routesTransferSubsidies.d.ts +19 -0
- package/dist/db/tables/routesTransferSubsidies.d.ts.map +1 -0
- package/dist/db/tables/routesTransferSubsidies.js +17 -0
- package/dist/db/tables/routesTransferSubsidies.js.map +1 -0
- package/dist/db/tables/routesTransferSubsidyNonces.d.ts +51 -0
- package/dist/db/tables/routesTransferSubsidyNonces.d.ts.map +1 -0
- package/dist/db/tables/routesTransferSubsidyNonces.js +82 -0
- package/dist/db/tables/routesTransferSubsidyNonces.js.map +1 -0
- package/dist/db/tables/routesTransferTransactions.d.ts +77 -0
- package/dist/db/tables/routesTransferTransactions.d.ts.map +1 -0
- package/dist/db/tables/{fundingTransferTransactions.js → routesTransferTransactions.js} +31 -13
- package/dist/db/tables/routesTransferTransactions.js.map +1 -0
- package/dist/db/tables/routesTransfers.d.ts +319 -0
- package/dist/db/tables/routesTransfers.d.ts.map +1 -0
- package/dist/db/tables/routesTransfers.js +372 -0
- package/dist/db/tables/routesTransfers.js.map +1 -0
- package/dist/db/tables/sponsoredTransactions.d.ts +75 -20
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
- package/dist/db/tables/sponsoredTransactions.js +124 -54
- package/dist/db/tables/sponsoredTransactions.js.map +1 -1
- package/dist/db/tables/sponsorshipAttributions.d.ts +69 -0
- package/dist/db/tables/sponsorshipAttributions.d.ts.map +1 -0
- package/dist/db/tables/sponsorshipAttributions.js +77 -0
- package/dist/db/tables/sponsorshipAttributions.js.map +1 -0
- package/dist/db/tables/sponsorshipReconciliationCursors.d.ts +22 -0
- package/dist/db/tables/sponsorshipReconciliationCursors.d.ts.map +1 -0
- package/dist/db/tables/sponsorshipReconciliationCursors.js +45 -0
- package/dist/db/tables/sponsorshipReconciliationCursors.js.map +1 -0
- package/dist/db/tables/stripeCustomers.d.ts +11 -0
- package/dist/db/tables/stripeCustomers.d.ts.map +1 -1
- package/dist/db/tables/stripeCustomers.js +13 -0
- package/dist/db/tables/stripeCustomers.js.map +1 -1
- package/dist/db/tables/users.d.ts +17 -1
- package/dist/db/tables/users.d.ts.map +1 -1
- package/dist/db/tables/users.js +47 -2
- package/dist/db/tables/users.js.map +1 -1
- package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
- package/dist/db/tables/webhookQueueEvents.js +5 -1
- package/dist/db/tables/webhookQueueEvents.js.map +1 -1
- package/dist/db/tables/webhookSubscriptions.d.ts +19 -11
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
- package/dist/db/tables/webhookSubscriptions.js +45 -13
- package/dist/db/tables/webhookSubscriptions.js.map +1 -1
- package/dist/handlers/internal/executionError.d.ts +2 -2
- package/dist/handlers/internal/executionError.d.ts.map +1 -1
- package/dist/handlers/internal/executionError.js +1 -2
- package/dist/handlers/internal/executionError.js.map +1 -1
- package/dist/handlers/internal/multisig.d.ts +4 -232
- package/dist/handlers/internal/multisig.d.ts.map +1 -1
- package/dist/handlers/internal/multisig.js +11 -537
- package/dist/handlers/internal/multisig.js.map +1 -1
- package/dist/handlers/internal/sponsorship.d.ts +19 -8
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
- package/dist/handlers/internal/sponsorship.js +13 -9
- package/dist/handlers/internal/sponsorship.js.map +1 -1
- package/dist/handlers/relay.d.ts +9 -12
- package/dist/handlers/relay.d.ts.map +1 -1
- package/dist/handlers/relay.js +81 -85
- package/dist/handlers/relay.js.map +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -17
- package/dist/index.js.map +1 -1
- package/dist/internal/AssetResponse.d.ts +12 -0
- package/dist/internal/AssetResponse.d.ts.map +1 -0
- package/dist/internal/AssetResponse.js +21 -0
- package/dist/internal/AssetResponse.js.map +1 -0
- package/dist/internal/Auth.d.ts +48 -12
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +603 -175
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/BetterAuth.d.ts +1488 -0
- package/dist/internal/BetterAuth.d.ts.map +1 -0
- package/dist/internal/BetterAuth.js +253 -0
- package/dist/internal/BetterAuth.js.map +1 -0
- package/dist/internal/Cache.d.ts +2 -0
- package/dist/internal/Cache.d.ts.map +1 -1
- package/dist/internal/Cache.js +2 -0
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/EarnRates.d.ts +26 -3
- package/dist/internal/EarnRates.d.ts.map +1 -1
- package/dist/internal/EarnRates.js +84 -19
- package/dist/internal/EarnRates.js.map +1 -1
- package/dist/internal/EarnSharePrices.d.ts +120 -0
- package/dist/internal/EarnSharePrices.d.ts.map +1 -0
- package/dist/internal/EarnSharePrices.js +179 -0
- package/dist/internal/EarnSharePrices.js.map +1 -0
- package/dist/internal/EarnVaults.d.ts +4 -0
- package/dist/internal/EarnVaults.d.ts.map +1 -1
- package/dist/internal/EarnVaults.js +27 -10
- package/dist/internal/EarnVaults.js.map +1 -1
- package/dist/internal/Email.d.ts +37 -0
- package/dist/internal/Email.d.ts.map +1 -0
- package/dist/internal/Email.js +16 -0
- package/dist/internal/Email.js.map +1 -0
- package/dist/internal/Log.d.ts +32 -28
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +18 -11
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/MetricSink.d.ts +3 -0
- package/dist/internal/MetricSink.d.ts.map +1 -1
- package/dist/internal/MetricSink.js +67 -8
- package/dist/internal/MetricSink.js.map +1 -1
- package/dist/internal/Mpp.d.ts.map +1 -1
- package/dist/internal/Mpp.js +20 -25
- package/dist/internal/Mpp.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +26 -3
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +25 -10
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/Provider.d.ts +1 -1
- package/dist/internal/Provider.d.ts.map +1 -1
- package/dist/internal/RateLimit.d.ts.map +1 -1
- package/dist/internal/RateLimit.js +13 -1
- package/dist/internal/RateLimit.js.map +1 -1
- package/dist/internal/Store.d.ts +16 -0
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +59 -8
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Tidx.d.ts +9 -2
- package/dist/internal/Tidx.d.ts.map +1 -1
- package/dist/internal/Tidx.js +78 -11
- package/dist/internal/Tidx.js.map +1 -1
- package/dist/internal/Timing.d.ts +26 -0
- package/dist/internal/Timing.d.ts.map +1 -1
- package/dist/internal/Timing.js +63 -5
- package/dist/internal/Timing.js.map +1 -1
- package/dist/internal/VercelOidc.d.ts +94 -0
- package/dist/internal/VercelOidc.d.ts.map +1 -0
- package/dist/internal/VercelOidc.js +128 -0
- package/dist/internal/VercelOidc.js.map +1 -0
- package/dist/internal/VerifiedTokens.d.ts +2 -8
- package/dist/internal/VerifiedTokens.d.ts.map +1 -1
- package/dist/internal/VerifiedTokens.js +24 -24
- package/dist/internal/VerifiedTokens.js.map +1 -1
- package/dist/internal/Viem.d.ts +30 -2067
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Viem.js +167 -17
- package/dist/internal/Viem.js.map +1 -1
- package/dist/internal/Webhooks.d.ts +12 -4
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +9 -3
- package/dist/internal/Webhooks.js.map +1 -1
- package/dist/internal/ZoneRpc.d.ts +7 -0
- package/dist/internal/ZoneRpc.d.ts.map +1 -0
- package/dist/internal/ZoneRpc.js +49 -0
- package/dist/internal/ZoneRpc.js.map +1 -0
- package/dist/internal/index.d.ts +3 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +3 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/rewards/Audit.d.ts +88 -0
- package/dist/internal/rewards/Audit.d.ts.map +1 -0
- package/dist/internal/rewards/Audit.js +134 -0
- package/dist/internal/rewards/Audit.js.map +1 -0
- package/dist/internal/rewards/Campaigns.d.ts +572 -0
- package/dist/internal/rewards/Campaigns.d.ts.map +1 -0
- package/dist/internal/rewards/Campaigns.js +531 -0
- package/dist/internal/rewards/Campaigns.js.map +1 -0
- package/dist/internal/rewards/Credits.d.ts +76 -0
- package/dist/internal/rewards/Credits.d.ts.map +1 -0
- package/dist/internal/rewards/Credits.js +95 -0
- package/dist/internal/rewards/Credits.js.map +1 -0
- package/dist/internal/rewards/Events.d.ts +100 -0
- package/dist/internal/rewards/Events.d.ts.map +1 -0
- package/dist/internal/rewards/Events.js +340 -0
- package/dist/internal/rewards/Events.js.map +1 -0
- package/dist/internal/rewards/Projection.d.ts +237 -0
- package/dist/internal/rewards/Projection.d.ts.map +1 -0
- package/dist/internal/rewards/Projection.js +616 -0
- package/dist/internal/rewards/Projection.js.map +1 -0
- package/dist/internal/rewards/Rates.d.ts +44 -0
- package/dist/internal/rewards/Rates.d.ts.map +1 -0
- package/dist/internal/rewards/Rates.js +60 -0
- package/dist/internal/rewards/Rates.js.map +1 -0
- package/dist/internal/rewards/Read.d.ts +158 -0
- package/dist/internal/rewards/Read.d.ts.map +1 -0
- package/dist/internal/rewards/Read.js +292 -0
- package/dist/internal/rewards/Read.js.map +1 -0
- package/dist/internal/rewards/Runner.d.ts +164 -0
- package/dist/internal/rewards/Runner.d.ts.map +1 -0
- package/dist/internal/rewards/Runner.js +1778 -0
- package/dist/internal/rewards/Runner.js.map +1 -0
- package/dist/internal/rewards/Signer.d.ts +224 -0
- package/dist/internal/rewards/Signer.d.ts.map +1 -0
- package/dist/internal/rewards/Signer.js +135 -0
- package/dist/internal/rewards/Signer.js.map +1 -0
- package/dist/internal/rewards/index.d.ts +15 -0
- package/dist/internal/rewards/index.d.ts.map +1 -0
- package/dist/internal/rewards/index.js +15 -0
- package/dist/internal/rewards/index.js.map +1 -0
- package/dist/internal/{funding → routes}/Action.d.ts +12 -1
- package/dist/internal/routes/Action.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Action.js +17 -9
- package/dist/internal/routes/Action.js.map +1 -0
- package/dist/internal/{funding → routes}/Catalog.d.ts +20 -20
- package/dist/internal/routes/Catalog.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Catalog.js +29 -29
- package/dist/internal/routes/Catalog.js.map +1 -0
- package/dist/internal/{funding → routes}/Chain.d.ts +10 -10
- package/dist/internal/routes/Chain.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Chain.js +3 -3
- package/dist/internal/routes/Chain.js.map +1 -0
- package/dist/internal/{funding → routes}/Deposit.d.ts +45 -23
- package/dist/internal/routes/Deposit.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Deposit.js +60 -27
- package/dist/internal/routes/Deposit.js.map +1 -0
- package/dist/internal/{funding → routes}/DepositAddress.d.ts +56 -27
- package/dist/internal/routes/DepositAddress.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/DepositAddress.js +95 -33
- package/dist/internal/routes/DepositAddress.js.map +1 -0
- package/dist/internal/{funding → routes}/DepositWebhook.d.ts +4 -4
- package/dist/internal/routes/DepositWebhook.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/DepositWebhook.js +4 -4
- package/dist/internal/routes/DepositWebhook.js.map +1 -0
- package/dist/internal/routes/Economics.d.ts +25 -0
- package/dist/internal/routes/Economics.d.ts.map +1 -0
- package/dist/internal/routes/Economics.js +28 -0
- package/dist/internal/routes/Economics.js.map +1 -0
- package/dist/internal/{funding → routes}/Evidence.d.ts +3 -3
- package/dist/internal/routes/Evidence.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Evidence.js +7 -7
- package/dist/internal/routes/Evidence.js.map +1 -0
- package/dist/internal/routes/Observability.d.ts +154 -0
- package/dist/internal/routes/Observability.d.ts.map +1 -0
- package/dist/internal/routes/Observability.js +389 -0
- package/dist/internal/routes/Observability.js.map +1 -0
- package/dist/internal/{funding → routes}/Provider.d.ts +311 -105
- package/dist/internal/routes/Provider.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Provider.js +229 -98
- package/dist/internal/routes/Provider.js.map +1 -0
- package/dist/internal/{funding → routes}/Reconciliation.d.ts +11 -6
- package/dist/internal/routes/Reconciliation.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Reconciliation.js +408 -158
- package/dist/internal/routes/Reconciliation.js.map +1 -0
- package/dist/internal/routes/Route.d.ts +21 -0
- package/dist/internal/routes/Route.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Route.js +1 -1
- package/dist/internal/routes/Route.js.map +1 -0
- package/dist/internal/{funding → routes}/SourceObservation.d.ts +6 -6
- package/dist/internal/routes/SourceObservation.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/SourceObservation.js +8 -8
- package/dist/internal/routes/SourceObservation.js.map +1 -0
- package/dist/internal/{funding → routes}/Subsidy.d.ts +48 -3
- package/dist/internal/routes/Subsidy.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Subsidy.js +43 -3
- package/dist/internal/routes/Subsidy.js.map +1 -0
- package/dist/internal/{funding → routes}/Token.d.ts +4 -4
- package/dist/internal/routes/Token.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Token.js +3 -3
- package/dist/internal/routes/Token.js.map +1 -0
- package/dist/internal/{funding → routes}/Transfer.d.ts +241 -46
- package/dist/internal/routes/Transfer.d.ts.map +1 -0
- package/dist/internal/routes/Transfer.js +728 -0
- package/dist/internal/routes/Transfer.js.map +1 -0
- package/dist/internal/{funding → routes}/TransferReconciliation.d.ts +13 -10
- package/dist/internal/routes/TransferReconciliation.d.ts.map +1 -0
- package/dist/internal/routes/TransferReconciliation.js +422 -0
- package/dist/internal/routes/TransferReconciliation.js.map +1 -0
- package/dist/internal/routes/TransferSubsidy.d.ts +201 -0
- package/dist/internal/routes/TransferSubsidy.d.ts.map +1 -0
- package/dist/internal/routes/TransferSubsidy.js +256 -0
- package/dist/internal/routes/TransferSubsidy.js.map +1 -0
- package/dist/internal/{funding → routes}/TransferWebhook.d.ts +5 -5
- package/dist/internal/routes/TransferWebhook.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/TransferWebhook.js +3 -3
- package/dist/internal/routes/TransferWebhook.js.map +1 -0
- package/dist/internal/{funding → routes}/index.d.ts +2 -0
- package/dist/internal/routes/index.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/index.js +2 -0
- package/dist/internal/routes/index.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/across.d.ts +4 -4
- package/dist/internal/routes/providers/across.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/providers/across.js +13 -13
- package/dist/internal/routes/providers/across.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/relay.d.ts +21 -12
- package/dist/internal/routes/providers/relay.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/providers/relay.js +194 -110
- package/dist/internal/routes/providers/relay.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/rhino.d.ts +4 -4
- package/dist/internal/routes/providers/rhino.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/providers/rhino.js +10 -10
- package/dist/internal/routes/providers/rhino.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/squid.d.ts +4 -4
- package/dist/internal/routes/providers/squid.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/providers/squid.js +14 -14
- package/dist/internal/routes/providers/squid.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/stargate.d.ts +46 -18
- package/dist/internal/routes/providers/stargate.d.ts.map +1 -0
- package/dist/internal/routes/providers/stargate.js +898 -0
- package/dist/internal/routes/providers/stargate.js.map +1 -0
- package/dist/internal/{funding → routes}/providers/symbiosis.d.ts +4 -4
- package/dist/internal/routes/providers/symbiosis.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/providers/symbiosis.js +30 -20
- package/dist/internal/routes/providers/symbiosis.js.map +1 -0
- package/dist/internal/webhookDestinations/slack.js +12 -12
- package/dist/internal/webhookDestinations/slack.js.map +1 -1
- package/dist/providers/index.d.ts +12 -12
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +12 -12
- package/dist/providers/index.js.map +1 -1
- package/dist/server.d.ts +19 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +19 -0
- package/dist/server.js.map +1 -0
- package/package.json +15 -4
- package/src/ApiKey.ts +1 -1
- package/src/ApiKeys.test.ts +1033 -3
- package/src/ApiKeys.ts +489 -48
- package/src/App.test-d.ts +1 -1
- package/src/App.test.ts +216 -25
- package/src/App.ts +334 -31
- package/src/Assets.test.ts +2 -2
- package/src/Assets.ts +3 -1
- package/src/Auth.test-d.ts +1 -1
- package/src/Client.test-d.ts +539 -110
- package/src/Handler.ts +0 -1
- package/src/OpenApi.contract.test.ts +195 -0
- package/src/Scope.ts +17 -5
- package/src/Webhooks.ts +1 -1
- package/src/admin/App.test.ts +30 -2
- package/src/admin/App.ts +42 -6
- package/src/admin/apps/api-keys.test.ts +267 -5
- package/src/admin/apps/api-keys.ts +100 -50
- package/src/admin/apps/earn-vaults.test.ts +158 -0
- package/src/admin/apps/earn-vaults.ts +679 -6
- package/src/admin/apps/organizations.test.ts +306 -17
- package/src/admin/apps/organizations.ts +299 -24
- package/src/admin/apps/routes-support.test.ts +200 -0
- package/src/admin/apps/routes-support.ts +201 -0
- package/src/admin/apps/routes.test.ts +450 -0
- package/src/admin/apps/routes.ts +896 -0
- package/src/admin/apps/scopes.test.ts +15 -5
- package/src/admin/apps/subsidies.test.ts +306 -0
- package/src/admin/apps/subsidies.ts +457 -0
- package/src/admin/apps/verified-tokens.test.ts +8 -3
- package/src/admin/apps/verified-tokens.ts +3 -3
- package/src/admin/ui/plugin.ts +1 -2
- package/src/admin/ui/src/components/RewardCampaignForm.tsx +1009 -0
- package/src/admin/ui/src/lib/config.ts +11 -2
- package/src/admin/ui/src/lib/earn-vaults.ts +2 -2
- package/src/admin/ui/src/lib/organizations.test.ts +83 -50
- package/src/admin/ui/src/lib/organizations.ts +106 -25
- package/src/admin/ui/src/lib/query-client.ts +1 -1
- package/src/admin/ui/src/lib/reward-campaigns.ts +136 -0
- package/src/admin/ui/src/lib/routes.test.ts +88 -0
- package/src/admin/ui/src/lib/routes.ts +304 -0
- package/src/admin/ui/src/lib/subsidies.ts +75 -0
- package/src/admin/ui/src/routeTree.gen.ts +63 -0
- package/src/admin/ui/src/routes/__root.tsx +12 -1
- package/src/admin/ui/src/routes/api-keys.tsx +196 -84
- package/src/admin/ui/src/routes/earn.vaults_.$vaultId.edit.tsx +105 -70
- package/src/admin/ui/src/routes/organizations_.$orgId.tsx +239 -23
- package/src/admin/ui/src/routes/routes.tsx +1615 -0
- package/src/admin/ui/src/routes/routes_.support.tsx +248 -0
- package/src/admin/ui/src/routes/subsidies.tsx +799 -0
- package/src/admin/ui.generated.ts +144 -69
- package/src/analytics/Analytics.test.ts +108 -18
- package/src/analytics/Analytics.ts +38 -6
- package/src/analytics/tables/requestEvents.test.ts +100 -0
- package/src/analytics/tables/requestEvents.ts +10 -1
- package/src/analytics/tables/routesLifecycleIntervals.ts +140 -0
- package/src/apps/Zones.test.ts +15 -0
- package/src/apps/Zones.ts +52 -5
- package/src/apps/composition.test.ts +68 -60
- package/src/apps/data/App.test.ts +154 -2
- package/src/apps/data/App.ts +88 -28
- package/src/apps/data/routes/activities.test.ts +419 -7
- package/src/apps/data/routes/activities.ts +683 -216
- package/src/apps/data/routes/balances.test.ts +2 -2
- package/src/apps/data/routes/blocks.test.ts +46 -1
- package/src/apps/data/routes/coingecko.test.ts +419 -1
- package/src/apps/data/routes/coingecko.ts +309 -253
- package/src/apps/data/routes/earn.discovery.test.ts +274 -0
- package/src/apps/data/routes/earn.test.ts +1294 -17
- package/src/apps/data/routes/earn.ts +1838 -321
- package/src/apps/data/routes/exchanges.test.ts +12 -15
- package/src/apps/data/routes/fee-amm.test.ts +224 -0
- package/src/apps/data/routes/fee-amm.ts +191 -160
- package/src/apps/data/routes/indexer.test.ts +389 -0
- package/src/apps/data/routes/indexer.ts +165 -69
- package/src/apps/data/routes/receipts.test.ts +1 -1
- package/src/apps/data/routes/rpc.test.ts +352 -8
- package/src/apps/data/routes/rpc.ts +407 -219
- package/src/apps/data/routes/rpc.zone.test.ts +340 -0
- package/src/apps/data/routes/tokenlist.test.ts +285 -0
- package/src/apps/data/routes/tokenlist.ts +173 -88
- package/src/apps/data/routes/tokens.test.ts +93 -3
- package/src/apps/data/routes/tokens.ts +39 -23
- package/src/apps/data/routes/transactions.test.ts +1 -1
- package/src/apps/data/routes/transfers.test.ts +56 -24
- package/src/apps/data/routes/transfers.ts +19 -8
- package/src/apps/data/routes/valuation.test.ts +1 -1
- package/src/apps/data/routes/verified-tokens.test.ts +345 -0
- package/src/apps/data/routes/verified-tokens.ts +99 -29
- package/src/apps/data/routes/webhooks.test.ts +645 -83
- package/src/apps/data/routes/webhooks.ts +1089 -857
- package/src/apps/data/routes/zones.test.ts +148 -71
- package/src/apps/data/routes/zones.ts +71 -55
- package/src/apps/docs/reference.ts +2 -2
- package/src/apps/index.ts +1 -1
- package/src/apps/management/App.ts +9 -51
- package/src/apps/management/Billing.test.ts +375 -14
- package/src/apps/management/Billing.ts +265 -29
- package/src/apps/management/routes/api-keys.test.ts +269 -7
- package/src/apps/management/routes/api-keys.ts +61 -20
- package/src/apps/management/routes/billing.test.ts +477 -15
- package/src/apps/management/routes/billing.ts +377 -50
- package/src/apps/management/routes/faucet.test.ts +1 -1
- package/src/apps/management/routes/faucet.ts +1 -1
- package/src/apps/management/routes/invitations.test.ts +270 -3
- package/src/apps/management/routes/invitations.ts +185 -15
- package/src/apps/management/routes/invoicePreview.test.ts +549 -0
- package/src/apps/management/routes/me.test.ts +246 -5
- package/src/apps/management/routes/me.ts +7 -2
- package/src/apps/management/routes/members.test.ts +108 -0
- package/src/apps/management/routes/orgs.test.ts +191 -3
- package/src/apps/management/routes/orgs.ts +58 -11
- package/src/apps/management/routes/projects.test.ts +33 -3
- package/src/apps/management/routes/projects.ts +6 -1
- package/src/apps/management/routes/scopes.test.ts +30 -2
- package/src/apps/management/routes/scopes.ts +4 -1
- package/src/apps/management/routes/usage.test.ts +32 -0
- package/src/apps/management/routes/usage.ts +22 -4
- package/src/apps/management/routes/webhooks.test.ts +49 -26
- package/src/apps/management/routes/webhooks.ts +78 -22
- package/src/apps/mcp.test.ts +6 -6
- package/src/apps/mcp.ts +7 -7
- package/src/apps/mpp/App.ts +37 -7
- package/src/apps/mpp/Mpp.test.ts +49 -8
- package/src/apps/mpp/Mpp.zone.test.ts +219 -0
- package/src/apps/mpp/internal/Adapter.ts +34 -0
- package/src/apps/mpp/internal/Policy.test.ts +86 -31
- package/src/apps/mpp/internal/Policy.ts +49 -7
- package/src/apps/mpp/internal/Sponsorship.test.ts +207 -0
- package/src/apps/mpp/internal/Sponsorship.ts +9 -3
- package/src/apps/relay/App.test.ts +839 -64
- package/src/apps/relay/App.ts +148 -81
- package/src/apps/relay/App.zone-billing.test.ts +257 -0
- package/src/apps/relay/Sponsorships.test.ts +67 -4
- package/src/apps/relay/Sponsorships.ts +233 -32
- package/src/apps/relay/Sponsorships.zone.test.ts +102 -0
- package/src/apps/{funding → routes}/Access.ts +6 -6
- package/src/apps/routes/App.test.ts +165 -0
- package/src/apps/routes/App.ts +96 -0
- package/src/apps/{funding → routes}/Inventory.ts +2 -2
- package/src/apps/routes/index.ts +1 -0
- package/src/apps/{funding → routes}/routes/chains.test.ts +66 -66
- package/src/apps/{funding → routes}/routes/chains.ts +23 -23
- package/src/apps/{funding → routes}/routes/deposit-addresses.test.ts +1358 -458
- package/src/apps/{funding → routes}/routes/deposit-addresses.ts +566 -246
- package/src/apps/{funding → routes}/routes/providers.test.ts +27 -33
- package/src/apps/{funding → routes}/routes/providers.ts +23 -23
- package/src/apps/{funding → routes}/routes/quotes.test.ts +298 -41
- package/src/apps/{funding → routes}/routes/quotes.ts +57 -40
- package/src/apps/{funding → routes}/routes/transfers.test.ts +1100 -353
- package/src/apps/routes/routes/transfers.ts +1332 -0
- package/src/cli/Cli.test.ts +1 -1
- package/src/cli/commands/admin.test.ts +748 -1
- package/src/cli/commands/admin.ts +278 -0
- package/src/cloudflare.ts +52 -47
- package/src/db/Db.test.ts +245 -2
- package/src/db/Db.ts +1476 -34
- package/src/db/Schema.ts +729 -228
- package/src/db/tables/apiKeyAdmissionBootstraps.ts +4 -0
- package/src/db/tables/apiKeyAdmissions.ts +218 -0
- package/src/db/tables/apiKeyOwnerAdmissions.ts +4 -0
- package/src/db/tables/apiKeyOwnerTombstones.ts +81 -0
- package/src/db/tables/apiKeyRevocations.test.ts +74 -0
- package/src/db/tables/apiKeyRevocations.ts +121 -0
- package/src/db/tables/authAccounts.ts +105 -0
- package/src/db/tables/authSessions.ts +13 -0
- package/src/db/tables/authVerifications.ts +13 -0
- package/src/db/tables/invitations.ts +142 -45
- package/src/db/tables/memberships.ts +79 -3
- package/src/db/tables/organizations.test.ts +690 -13
- package/src/db/tables/organizations.ts +139 -55
- package/src/db/tables/projects.test.ts +16 -0
- package/src/db/tables/projects.ts +13 -3
- package/src/db/tables/requestUsage.ts +4 -1
- package/src/db/tables/rewardAccounts.ts +178 -0
- package/src/db/tables/rewardCampaignDistributors.ts +68 -0
- package/src/db/tables/rewardCampaigns.test.ts +1388 -0
- package/src/db/tables/rewardCampaigns.ts +647 -0
- package/src/db/tables/rewardCredits.ts +110 -0
- package/src/db/tables/rewardEligibilityAssociations.test.ts +271 -0
- package/src/db/tables/rewardEligibilityAssociations.ts +184 -0
- package/src/db/tables/rewardRuns.ts +514 -0
- package/src/db/tables/rewardTransactionAttempts.ts +272 -0
- package/src/db/tables/routesCatalog.test.ts +185 -0
- package/src/db/tables/routesCatalog.ts +163 -0
- package/src/db/tables/routesDepositAddresses.test.ts +1048 -0
- package/src/db/tables/routesDepositAddresses.ts +1008 -0
- package/src/db/tables/{fundingDepositRequestObservations.test.ts → routesDepositRequestObservations.test.ts} +13 -14
- package/src/db/tables/{fundingDepositRequestObservations.ts → routesDepositRequestObservations.ts} +10 -10
- package/src/db/tables/{fundingDeposits.test.ts → routesDeposits.test.ts} +316 -46
- package/src/db/tables/routesDeposits.ts +1062 -0
- package/src/db/tables/routesIdempotency.test.ts +796 -0
- package/src/db/tables/routesIdempotency.ts +496 -0
- package/src/db/tables/routesSubsidies.test.ts +120 -0
- package/src/db/tables/routesSubsidies.ts +71 -0
- package/src/db/tables/{fundingTransferEvents.ts → routesTransferEvents.ts} +4 -4
- package/src/db/tables/routesTransferSubsidies.ts +38 -0
- package/src/db/tables/routesTransferSubsidyNonces.ts +124 -0
- package/src/db/tables/routesTransferTransactions.test.ts +195 -0
- package/src/db/tables/{fundingTransferTransactions.ts → routesTransferTransactions.ts} +63 -18
- package/src/db/tables/routesTransfers.test.ts +338 -0
- package/src/db/tables/routesTransfers.ts +662 -0
- package/src/db/tables/sponsoredTransactions.test.ts +269 -45
- package/src/db/tables/sponsoredTransactions.ts +225 -65
- package/src/db/tables/sponsorshipAttributions.test.ts +160 -0
- package/src/db/tables/sponsorshipAttributions.ts +168 -0
- package/src/db/tables/sponsorshipReconciliationCursors.test.ts +115 -0
- package/src/db/tables/sponsorshipReconciliationCursors.ts +67 -0
- package/src/db/tables/stripeCustomers.test.ts +85 -0
- package/src/db/tables/stripeCustomers.ts +24 -0
- package/src/db/tables/users.test.ts +129 -0
- package/src/db/tables/users.ts +49 -3
- package/src/db/tables/webhookQueueEvents.ts +8 -1
- package/src/db/tables/webhookSubscriptions.ts +95 -20
- package/src/handlers/internal/executionError.ts +3 -4
- package/src/handlers/internal/multisig.ts +13 -816
- package/src/handlers/internal/sponsorship.ts +26 -10
- package/src/handlers/relay.test-d.ts +9 -1
- package/src/handlers/relay.test.ts +823 -3
- package/src/handlers/relay.ts +127 -107
- package/src/index.test-d.ts +7 -0
- package/src/index.ts +0 -17
- package/src/internal/AssetResponse.ts +26 -0
- package/src/internal/Auth.test.ts +1564 -9
- package/src/internal/Auth.ts +833 -239
- package/src/internal/BetterAuth.test.ts +242 -0
- package/src/internal/BetterAuth.ts +349 -0
- package/src/internal/Cache.ts +2 -0
- package/src/internal/EarnRates.test.ts +17 -0
- package/src/internal/EarnRates.ts +124 -31
- package/src/internal/EarnSharePrices.test.ts +182 -0
- package/src/internal/EarnSharePrices.ts +313 -0
- package/src/internal/EarnVaults.test.ts +21 -0
- package/src/internal/EarnVaults.ts +33 -11
- package/src/internal/Email.ts +54 -0
- package/src/internal/Idempotency.test.ts +2 -2
- package/src/internal/Log.test-d.ts +8 -7
- package/src/internal/Log.test.ts +114 -16
- package/src/internal/Log.ts +53 -40
- package/src/internal/MetricSink.test.ts +313 -26
- package/src/internal/MetricSink.ts +73 -8
- package/src/internal/Mpp.test.ts +31 -0
- package/src/internal/Mpp.ts +21 -24
- package/src/internal/OpenApi.ts +45 -12
- package/src/internal/Provider.test.ts +1 -1
- package/src/internal/Provider.ts +1 -1
- package/src/internal/RateLimit.test.ts +21 -3
- package/src/internal/RateLimit.ts +12 -1
- package/src/internal/Store.test-d.ts +1 -1
- package/src/internal/Store.test.ts +151 -8
- package/src/internal/Store.ts +76 -9
- package/src/internal/Tidx.test.ts +59 -8
- package/src/internal/Tidx.ts +86 -14
- package/src/internal/Timing.test.ts +77 -0
- package/src/internal/Timing.ts +83 -6
- package/src/internal/VercelOidc.test.ts +188 -0
- package/src/internal/VercelOidc.ts +193 -0
- package/src/internal/VerifiedTokens.test.ts +60 -6
- package/src/internal/VerifiedTokens.ts +21 -24
- package/src/internal/Viem.batch.test.ts +80 -0
- package/src/internal/Viem.test.ts +201 -2
- package/src/internal/Viem.ts +221 -25
- package/src/internal/Webhooks.test.ts +85 -6
- package/src/internal/Webhooks.ts +22 -4
- package/src/internal/ZoneRpc.ts +50 -0
- package/src/internal/exchange/Provider.test.ts +2 -2
- package/src/internal/index.test.ts +3 -1
- package/src/internal/index.ts +3 -1
- package/src/internal/rewards/Audit.ts +231 -0
- package/src/internal/rewards/Campaigns.test.ts +1234 -0
- package/src/internal/rewards/Campaigns.ts +1205 -0
- package/src/internal/rewards/Credits.ts +165 -0
- package/src/internal/rewards/Events.local.test.ts +113 -0
- package/src/internal/rewards/Events.test.ts +152 -0
- package/src/internal/rewards/Events.ts +468 -0
- package/src/internal/rewards/Projection.test.ts +681 -0
- package/src/internal/rewards/Projection.ts +987 -0
- package/src/internal/rewards/Rates.test.ts +171 -0
- package/src/internal/rewards/Rates.ts +110 -0
- package/src/internal/rewards/Read.test.ts +501 -0
- package/src/internal/rewards/Read.ts +476 -0
- package/src/internal/rewards/Runner.checkpoint.test.ts +80 -0
- package/src/internal/rewards/Runner.states.test.ts +188 -0
- package/src/internal/rewards/Runner.test.ts +90 -0
- package/src/internal/rewards/Runner.ts +2229 -0
- package/src/internal/rewards/Signer.test.ts +79 -0
- package/src/internal/rewards/Signer.ts +180 -0
- package/src/internal/rewards/index.ts +14 -0
- package/src/internal/{funding → routes}/Action.test.ts +63 -14
- package/src/internal/{funding → routes}/Action.ts +35 -8
- package/src/internal/{funding → routes}/Catalog.test.ts +3 -3
- package/src/internal/{funding → routes}/Catalog.ts +39 -39
- package/src/internal/{funding → routes}/Chain.test.ts +1 -1
- package/src/internal/{funding → routes}/Chain.ts +11 -11
- package/src/internal/{funding → routes}/Deposit.test.ts +1 -1
- package/src/internal/{funding → routes}/Deposit.ts +93 -45
- package/src/internal/{funding → routes}/DepositAddress.test.ts +11 -3
- package/src/internal/{funding → routes}/DepositAddress.ts +132 -53
- package/src/internal/{funding → routes}/DepositWebhook.test.ts +61 -18
- package/src/internal/{funding → routes}/DepositWebhook.ts +9 -9
- package/src/internal/routes/Economics.test.ts +42 -0
- package/src/internal/routes/Economics.ts +47 -0
- package/src/internal/{funding → routes}/Evidence.test.ts +6 -6
- package/src/internal/{funding → routes}/Evidence.ts +9 -9
- package/src/internal/routes/Observability.test.ts +636 -0
- package/src/internal/routes/Observability.ts +668 -0
- package/src/internal/{funding → routes}/Provider.test.ts +489 -153
- package/src/internal/{funding → routes}/Provider.ts +489 -186
- package/src/internal/{funding → routes}/Reconciliation.local.test.ts +84 -12
- package/src/internal/{funding → routes}/Reconciliation.test.ts +1213 -279
- package/src/internal/{funding → routes}/Reconciliation.ts +501 -203
- package/src/internal/routes/Reconciliation.unattributed.test.ts +250 -0
- package/src/internal/{funding → routes}/Route.ts +7 -7
- package/src/internal/{funding → routes}/SourceObservation.test.ts +13 -14
- package/src/internal/{funding → routes}/SourceObservation.ts +13 -13
- package/src/internal/{funding → routes}/Subsidy.local.test.ts +7 -7
- package/src/internal/routes/Subsidy.test.ts +169 -0
- package/src/internal/{funding → routes}/Subsidy.ts +86 -6
- package/src/internal/{funding → routes}/Token.test.ts +1 -1
- package/src/internal/{funding → routes}/Token.ts +5 -5
- package/src/internal/routes/Transfer.test.ts +1199 -0
- package/src/internal/routes/Transfer.ts +1206 -0
- package/src/internal/routes/TransferReconciliation.test.ts +731 -0
- package/src/internal/routes/TransferReconciliation.ts +527 -0
- package/src/internal/routes/TransferSubsidy.test.ts +172 -0
- package/src/internal/routes/TransferSubsidy.ts +447 -0
- package/src/internal/{funding → routes}/TransferWebhook.test.ts +13 -13
- package/src/internal/{funding → routes}/TransferWebhook.ts +7 -7
- package/src/internal/{funding → routes}/index.test.ts +5 -3
- package/src/internal/{funding → routes}/index.ts +2 -0
- package/src/internal/{funding → routes}/providers/across.ts +16 -16
- package/src/internal/{funding → routes}/providers/index.test.ts +157 -44
- package/src/internal/{funding → routes}/providers/relay.test.ts +165 -32
- package/src/internal/{funding → routes}/providers/relay.ts +228 -121
- package/src/internal/{funding → routes}/providers/rhino.ts +16 -16
- package/src/internal/{funding → routes}/providers/squid.ts +17 -17
- package/src/internal/routes/providers/stargate.test.ts +728 -0
- package/src/internal/routes/providers/stargate.ts +1276 -0
- package/src/internal/{funding → routes}/providers/symbiosis.ts +64 -24
- package/src/internal/webhookDestinations/slack.ts +10 -10
- package/src/providers/index.ts +13 -13
- package/src/server.ts +18 -0
- package/dist/apps/funding/Access.d.ts.map +0 -1
- package/dist/apps/funding/Access.js.map +0 -1
- package/dist/apps/funding/App.js.map +0 -1
- package/dist/apps/funding/Inventory.d.ts.map +0 -1
- package/dist/apps/funding/Inventory.js.map +0 -1
- package/dist/apps/funding/ProviderAttempts.d.ts +0 -5
- package/dist/apps/funding/ProviderAttempts.d.ts.map +0 -1
- package/dist/apps/funding/ProviderAttempts.js +0 -24
- package/dist/apps/funding/ProviderAttempts.js.map +0 -1
- package/dist/apps/funding/index.d.ts +0 -2
- package/dist/apps/funding/index.d.ts.map +0 -1
- package/dist/apps/funding/index.js +0 -2
- package/dist/apps/funding/index.js.map +0 -1
- package/dist/apps/funding/routes/chains.d.ts.map +0 -1
- package/dist/apps/funding/routes/chains.js.map +0 -1
- package/dist/apps/funding/routes/deposit-addresses.d.ts.map +0 -1
- package/dist/apps/funding/routes/deposit-addresses.js.map +0 -1
- package/dist/apps/funding/routes/providers.d.ts.map +0 -1
- package/dist/apps/funding/routes/providers.js +0 -57
- package/dist/apps/funding/routes/providers.js.map +0 -1
- package/dist/apps/funding/routes/quotes.d.ts.map +0 -1
- package/dist/apps/funding/routes/quotes.js.map +0 -1
- package/dist/apps/funding/routes/transfers.d.ts.map +0 -1
- package/dist/apps/funding/routes/transfers.js +0 -828
- package/dist/apps/funding/routes/transfers.js.map +0 -1
- package/dist/db/tables/fundingCatalog.d.ts +0 -58
- package/dist/db/tables/fundingCatalog.d.ts.map +0 -1
- package/dist/db/tables/fundingCatalog.js.map +0 -1
- package/dist/db/tables/fundingDepositAddresses.d.ts +0 -192
- package/dist/db/tables/fundingDepositAddresses.d.ts.map +0 -1
- package/dist/db/tables/fundingDepositAddresses.js +0 -235
- package/dist/db/tables/fundingDepositAddresses.js.map +0 -1
- package/dist/db/tables/fundingDepositRequestObservations.d.ts.map +0 -1
- package/dist/db/tables/fundingDepositRequestObservations.js.map +0 -1
- package/dist/db/tables/fundingDeposits.d.ts.map +0 -1
- package/dist/db/tables/fundingDeposits.js +0 -295
- package/dist/db/tables/fundingDeposits.js.map +0 -1
- package/dist/db/tables/fundingIdempotency.d.ts +0 -91
- package/dist/db/tables/fundingIdempotency.d.ts.map +0 -1
- package/dist/db/tables/fundingIdempotency.js +0 -103
- package/dist/db/tables/fundingIdempotency.js.map +0 -1
- package/dist/db/tables/fundingTransferEvents.d.ts.map +0 -1
- package/dist/db/tables/fundingTransferEvents.js.map +0 -1
- package/dist/db/tables/fundingTransferTransactions.d.ts +0 -53
- package/dist/db/tables/fundingTransferTransactions.d.ts.map +0 -1
- package/dist/db/tables/fundingTransferTransactions.js.map +0 -1
- package/dist/db/tables/fundingTransfers.d.ts +0 -99
- package/dist/db/tables/fundingTransfers.d.ts.map +0 -1
- package/dist/db/tables/fundingTransfers.js +0 -110
- package/dist/db/tables/fundingTransfers.js.map +0 -1
- package/dist/internal/funding/Action.d.ts.map +0 -1
- package/dist/internal/funding/Action.js.map +0 -1
- package/dist/internal/funding/Catalog.d.ts.map +0 -1
- package/dist/internal/funding/Catalog.js.map +0 -1
- package/dist/internal/funding/Chain.d.ts.map +0 -1
- package/dist/internal/funding/Chain.js.map +0 -1
- package/dist/internal/funding/Deposit.d.ts.map +0 -1
- package/dist/internal/funding/Deposit.js.map +0 -1
- package/dist/internal/funding/DepositAddress.d.ts.map +0 -1
- package/dist/internal/funding/DepositAddress.js.map +0 -1
- package/dist/internal/funding/DepositWebhook.d.ts.map +0 -1
- package/dist/internal/funding/DepositWebhook.js.map +0 -1
- package/dist/internal/funding/Evidence.d.ts.map +0 -1
- package/dist/internal/funding/Evidence.js.map +0 -1
- package/dist/internal/funding/Provider.d.ts.map +0 -1
- package/dist/internal/funding/Provider.js.map +0 -1
- package/dist/internal/funding/Reconciliation.d.ts.map +0 -1
- package/dist/internal/funding/Reconciliation.js.map +0 -1
- package/dist/internal/funding/Route.d.ts +0 -21
- package/dist/internal/funding/Route.d.ts.map +0 -1
- package/dist/internal/funding/Route.js.map +0 -1
- package/dist/internal/funding/SourceObservation.d.ts.map +0 -1
- package/dist/internal/funding/SourceObservation.js.map +0 -1
- package/dist/internal/funding/Subsidy.d.ts.map +0 -1
- package/dist/internal/funding/Subsidy.js.map +0 -1
- package/dist/internal/funding/Token.d.ts.map +0 -1
- package/dist/internal/funding/Token.js.map +0 -1
- package/dist/internal/funding/Transfer.d.ts.map +0 -1
- package/dist/internal/funding/Transfer.js +0 -462
- package/dist/internal/funding/Transfer.js.map +0 -1
- package/dist/internal/funding/TransferReconciliation.d.ts.map +0 -1
- package/dist/internal/funding/TransferReconciliation.js +0 -192
- package/dist/internal/funding/TransferReconciliation.js.map +0 -1
- package/dist/internal/funding/TransferWebhook.d.ts.map +0 -1
- package/dist/internal/funding/TransferWebhook.js.map +0 -1
- package/dist/internal/funding/index.d.ts.map +0 -1
- package/dist/internal/funding/index.js.map +0 -1
- package/dist/internal/funding/providers/across.d.ts.map +0 -1
- package/dist/internal/funding/providers/across.js.map +0 -1
- package/dist/internal/funding/providers/relay.d.ts.map +0 -1
- package/dist/internal/funding/providers/relay.js.map +0 -1
- package/dist/internal/funding/providers/rhino.d.ts.map +0 -1
- package/dist/internal/funding/providers/rhino.js.map +0 -1
- package/dist/internal/funding/providers/squid.d.ts.map +0 -1
- package/dist/internal/funding/providers/squid.js.map +0 -1
- package/dist/internal/funding/providers/stargate.d.ts.map +0 -1
- package/dist/internal/funding/providers/stargate.js +0 -579
- package/dist/internal/funding/providers/stargate.js.map +0 -1
- package/dist/internal/funding/providers/symbiosis.d.ts.map +0 -1
- package/dist/internal/funding/providers/symbiosis.js.map +0 -1
- package/src/apps/funding/App.test.ts +0 -78
- package/src/apps/funding/App.ts +0 -88
- package/src/apps/funding/ProviderAttempts.ts +0 -26
- package/src/apps/funding/index.ts +0 -1
- package/src/apps/funding/routes/transfers.ts +0 -987
- package/src/db/tables/fundingCatalog.test.ts +0 -122
- package/src/db/tables/fundingCatalog.ts +0 -163
- package/src/db/tables/fundingDepositAddresses.test.ts +0 -608
- package/src/db/tables/fundingDepositAddresses.ts +0 -443
- package/src/db/tables/fundingDeposits.ts +0 -572
- package/src/db/tables/fundingIdempotency.test.ts +0 -182
- package/src/db/tables/fundingIdempotency.ts +0 -180
- package/src/db/tables/fundingTransferTransactions.test.ts +0 -112
- package/src/db/tables/fundingTransfers.test.ts +0 -115
- package/src/db/tables/fundingTransfers.ts +0 -189
- package/src/handlers/internal/multisig.test.ts +0 -818
- package/src/internal/funding/Subsidy.test.ts +0 -75
- package/src/internal/funding/Transfer.test.ts +0 -524
- package/src/internal/funding/Transfer.ts +0 -762
- package/src/internal/funding/TransferReconciliation.test.ts +0 -147
- package/src/internal/funding/TransferReconciliation.ts +0 -264
- package/src/internal/funding/providers/stargate.test.ts +0 -328
- package/src/internal/funding/providers/stargate.ts +0 -856
- /package/dist/apps/{funding → routes}/Inventory.d.ts +0 -0
- /package/src/internal/{funding → routes}/Route.test.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// TODO(tidx-v1): Restore `queryOutbound` from commit `de87725` after TIDX v1 ships. Remove the receipt-side merge and bounded follow-up lookup.
|
|
2
1
|
import { Hono } from 'hono';
|
|
3
2
|
import { Address, Hex } from 'ox';
|
|
4
3
|
import { parseEventLogs, zeroAddress } from 'viem';
|
|
@@ -1266,6 +1265,10 @@ export var schema;
|
|
|
1266
1265
|
});
|
|
1267
1266
|
/** A single classified activity item. */
|
|
1268
1267
|
schema.Item = OpenApi.component(z.union(schema.items).check(z.describe('One classified activity item in the address feed.')), 'ActivityItem');
|
|
1268
|
+
/** Public activity types accepted by the address feed's `type` filter. */
|
|
1269
|
+
schema.ActivityType = z
|
|
1270
|
+
.enum(schema.items.map((item) => item.shape.type.def.values[0]))
|
|
1271
|
+
.check(z.describe('A classified activity type.'));
|
|
1269
1272
|
/** A folded access-key group: consecutive same-signer items on one UTC day. */
|
|
1270
1273
|
schema.Group = z
|
|
1271
1274
|
.object({
|
|
@@ -1306,6 +1309,14 @@ export var schema;
|
|
|
1306
1309
|
.check(z.describe('Additional activity resources and selection modes to include.'));
|
|
1307
1310
|
/** Parses comma-separated optional activity resources and selection modes. */
|
|
1308
1311
|
schema.includeQuery = Schema.includeQuery(schema.Include, 'Comma-separated activity options. `zones` combines the selected parent chain with every readable Zone.');
|
|
1312
|
+
/** Parses comma-separated activity types with OR semantics. */
|
|
1313
|
+
schema.typeQuery = Schema.includeQuery(schema.ActivityType, 'Only include these activity types, such as `transfer,swap`. Multiple values use OR semantics.');
|
|
1314
|
+
const RawAmountBound = z
|
|
1315
|
+
.optional(Schema.DecimalString)
|
|
1316
|
+
.check(z.describe("A token quantity in the token's smallest unit."));
|
|
1317
|
+
const ValuationAmountBound = z
|
|
1318
|
+
.optional(z.string().check(z.regex(/^\d+(\.\d{1,6})?$/)))
|
|
1319
|
+
.check(z.describe('A non-negative decimal amount in `valuation.currency`, with up to six decimal places.'), z.meta({ examples: ['1'] }));
|
|
1309
1320
|
/** Schemas for the getAddressActivities operation. */
|
|
1310
1321
|
let getAddressActivities;
|
|
1311
1322
|
(function (getAddressActivities) {
|
|
@@ -1318,6 +1329,8 @@ export var schema;
|
|
|
1318
1329
|
/** Query parameters for address activity requests. */
|
|
1319
1330
|
getAddressActivities.Query = z
|
|
1320
1331
|
.strictObject({
|
|
1332
|
+
'amount.from': RawAmountBound.check(z.describe('Only include activities with at least one token amount greater than or equal to this base-unit quantity.')),
|
|
1333
|
+
'amount.to': RawAmountBound.check(z.describe('Only include activities with at least one token amount less than or equal to this base-unit quantity.')),
|
|
1321
1334
|
chainId: Schema.ChainIdQuery,
|
|
1322
1335
|
cursor: Schema.Cursor,
|
|
1323
1336
|
// Folding is opt-in: by default every item is returned at the root.
|
|
@@ -1331,9 +1344,39 @@ export var schema;
|
|
|
1331
1344
|
logs: z
|
|
1332
1345
|
._default(Schema.booleanQuery(), false)
|
|
1333
1346
|
.check(z.describe('Set to `true` to attach each item’s full transaction log set (decoded when possible) as a top-level `events` array, so no co-located log is hidden. Defaults to `false`. `unknown` items always include it.'), z.meta({ examples: [true] })),
|
|
1347
|
+
recipient: z
|
|
1348
|
+
.optional(Schema.Address)
|
|
1349
|
+
.check(z.describe('Only include activities sent to this recipient address.')),
|
|
1350
|
+
sender: z
|
|
1351
|
+
.optional(Schema.Address)
|
|
1352
|
+
.check(z.describe('Only include activities sent from this sender address.')),
|
|
1353
|
+
token: z
|
|
1354
|
+
.optional(Schema.TokenAddress)
|
|
1355
|
+
.check(z.describe('Only include activities with a source, destination, or refund token for this TIP-20 contract.')),
|
|
1356
|
+
type: schema.typeQuery,
|
|
1357
|
+
'valuation.amount.from': ValuationAmountBound.check(z.describe('Only include activities with at least one valued amount greater than or equal to this amount. Requires `valuation.currency`.')),
|
|
1358
|
+
'valuation.amount.to': ValuationAmountBound.check(z.describe('Only include activities with at least one valued amount less than or equal to this amount. Requires `valuation.currency`.')),
|
|
1334
1359
|
'valuation.currency': Schema.Denomination,
|
|
1335
1360
|
})
|
|
1336
|
-
.check(z.
|
|
1361
|
+
.check(z.refine((query) => {
|
|
1362
|
+
const from = parseRawAmount(query['amount.from']);
|
|
1363
|
+
const to = parseRawAmount(query['amount.to']);
|
|
1364
|
+
return from === undefined || to === undefined || from <= to;
|
|
1365
|
+
}, {
|
|
1366
|
+
error: '`amount.from` must be less than or equal to `amount.to`.',
|
|
1367
|
+
path: ['amount.from'],
|
|
1368
|
+
}), z.refine((query) => (query['valuation.amount.from'] === undefined &&
|
|
1369
|
+
query['valuation.amount.to'] === undefined) ||
|
|
1370
|
+
query['valuation.currency'] !== undefined, {
|
|
1371
|
+
error: '`valuation.currency` is required when filtering by valuation amount.',
|
|
1372
|
+
path: ['valuation.currency'],
|
|
1373
|
+
}), z.refine((query) => query['valuation.amount.from'] === undefined ||
|
|
1374
|
+
query['valuation.amount.to'] === undefined ||
|
|
1375
|
+
parseValuationAmount(query['valuation.amount.from']) <=
|
|
1376
|
+
parseValuationAmount(query['valuation.amount.to']), {
|
|
1377
|
+
error: '`valuation.amount.from` must be less than or equal to `valuation.amount.to`.',
|
|
1378
|
+
path: ['valuation.amount.from'],
|
|
1379
|
+
}), z.describe('Query parameters for the address activity request. This feed uses cursor pagination only because activity classification can fold a variable number of rows into each entry, so positional `page` pagination would not be stable.'));
|
|
1337
1380
|
/**
|
|
1338
1381
|
* Page of classified activity. Mirrors the wallet activity feed: a
|
|
1339
1382
|
* newest-first list of `data` entries (items, or access-key groups when
|
|
@@ -1546,8 +1589,6 @@ const closeRequestedSelector = '0xf5a36fc00a96cbb9cf1f8f59299165e1d8ffffe94396d8
|
|
|
1546
1589
|
// by the accountKeychain whenever a tx is signed by an access key. topic2 is the
|
|
1547
1590
|
// access-key publicKey, i.e. the real signer.
|
|
1548
1591
|
const accessKeySpendSelector = '0xe0815e3aaadddf4dd75bde97fc060f0c38afe18e87a169be86a3f5c28247f192';
|
|
1549
|
-
/** TIP-20 / ERC-20 `Transfer` event signature for the decoded CTE. */
|
|
1550
|
-
const transferSignature = 'event Transfer(address indexed from, address indexed to, uint256 value)';
|
|
1551
1592
|
// Standard ERC-4626 vault events, absent from the merged `viem/tempo` ABI.
|
|
1552
1593
|
// Decoding them lets external vault deposits/withdrawals classify instead of
|
|
1553
1594
|
// falling through to the share-token mint/burn legs.
|
|
@@ -1574,21 +1615,17 @@ const erc4626Events = [
|
|
|
1574
1615
|
type: 'event',
|
|
1575
1616
|
},
|
|
1576
1617
|
];
|
|
1577
|
-
|
|
1578
|
-
// `Addresses`, so the known address is pinned here: channel events
|
|
1579
|
-
// (`ChannelOpened`/`Settled`/`TopUp`/`ChannelClosed`) are emitted here, and
|
|
1580
|
-
// their paired TIP-20 `Transfer` legs use it as the funding counterparty, which
|
|
1581
|
-
// is how `channel-funded`/`channel-settled`/`channel-closed` recover the token.
|
|
1582
|
-
const tip20ChannelReserve = '0x4d50500000000000000000000000000000000000';
|
|
1618
|
+
const tip20ChannelReserve = Addresses.tip20ChannelReserve;
|
|
1583
1619
|
// Tempo system addresses other than the DEX are never swap-route
|
|
1584
1620
|
// counterparties; a newly shipped precompile joins the exclusion automatically.
|
|
1585
|
-
const nonRouteSystemAddresses = new Set(
|
|
1586
|
-
.filter((value) => value !== Addresses.stablecoinDex)
|
|
1621
|
+
const nonRouteSystemAddresses = new Set(Object.values(Addresses)
|
|
1622
|
+
.filter((value) => typeof value === 'string' && value !== Addresses.stablecoinDex)
|
|
1587
1623
|
.map((value) => value.toLowerCase()));
|
|
1588
1624
|
/** Number of grouped entries to target before stopping the page-fetch loop. */
|
|
1589
1625
|
const minGroupEntries = 5;
|
|
1590
1626
|
/** Largest number of items folded into a single access-key group. */
|
|
1591
1627
|
const maxGroupSize = 50;
|
|
1628
|
+
const maxTokenAmount = 2n ** 256n - 1n;
|
|
1592
1629
|
/** Token-bearing keys on an item's `data` payload, walked for enrichment. */
|
|
1593
1630
|
const tokenKeys = ['destinationToken', 'refund', 'sourceToken'];
|
|
1594
1631
|
const amountKeyByTokenKey = {
|
|
@@ -1596,6 +1633,72 @@ const amountKeyByTokenKey = {
|
|
|
1596
1633
|
refund: 'refundAmount',
|
|
1597
1634
|
sourceToken: 'sourceAmount',
|
|
1598
1635
|
};
|
|
1636
|
+
function parseRawAmount(value) {
|
|
1637
|
+
return value !== undefined && /^\d+$/.test(value) ? BigInt(value) : undefined;
|
|
1638
|
+
}
|
|
1639
|
+
/** Converts a decimal valuation amount to the API's fixed six-decimal scale. */
|
|
1640
|
+
function parseValuationAmount(value) {
|
|
1641
|
+
const [whole, fraction = ''] = value.split('.');
|
|
1642
|
+
return BigInt(whole) * 1000000n + BigInt(fraction.padEnd(6, '0'));
|
|
1643
|
+
}
|
|
1644
|
+
/** Returns whether an activity satisfies its participant and same-leg token predicates. */
|
|
1645
|
+
function matchesActivityFilter(item, filter) {
|
|
1646
|
+
const data = item.data;
|
|
1647
|
+
const recipient = data['recipient'];
|
|
1648
|
+
if (filter.recipient !== undefined &&
|
|
1649
|
+
(typeof recipient !== 'string' ||
|
|
1650
|
+
!Address.isEqual(recipient, filter.recipient)))
|
|
1651
|
+
return false;
|
|
1652
|
+
const sender = data['sender'];
|
|
1653
|
+
if (filter.sender !== undefined &&
|
|
1654
|
+
(typeof sender !== 'string' || !Address.isEqual(sender, filter.sender)))
|
|
1655
|
+
return false;
|
|
1656
|
+
const amount = filter.amount;
|
|
1657
|
+
if (amount === undefined && filter.token === undefined)
|
|
1658
|
+
return true;
|
|
1659
|
+
for (const key of tokenKeys) {
|
|
1660
|
+
const token = data[key];
|
|
1661
|
+
if (!token)
|
|
1662
|
+
continue;
|
|
1663
|
+
if (filter.token !== undefined && !Address.isEqual(token.address, filter.token))
|
|
1664
|
+
continue;
|
|
1665
|
+
const value = BigInt(token.amount);
|
|
1666
|
+
if (amount?.from !== undefined && value < amount.from)
|
|
1667
|
+
continue;
|
|
1668
|
+
if (amount?.to !== undefined && value > amount.to)
|
|
1669
|
+
continue;
|
|
1670
|
+
return true;
|
|
1671
|
+
}
|
|
1672
|
+
return false;
|
|
1673
|
+
}
|
|
1674
|
+
/** Applies exact participant and same-leg token predicates after classification. */
|
|
1675
|
+
export function filterActivities(options) {
|
|
1676
|
+
const { filter, items } = options;
|
|
1677
|
+
return items.filter((item) => matchesActivityFilter(item, filter));
|
|
1678
|
+
}
|
|
1679
|
+
/** Returns whether any valued token leg in an activity falls within the requested range. */
|
|
1680
|
+
function matchesValuationAmount(item, bounds) {
|
|
1681
|
+
if (bounds.from === undefined && bounds.to === undefined)
|
|
1682
|
+
return true;
|
|
1683
|
+
const data = item.data;
|
|
1684
|
+
for (const key of Object.values(amountKeyByTokenKey)) {
|
|
1685
|
+
const amount = data[key];
|
|
1686
|
+
if (!amount || typeof amount !== 'object' || !('valuation' in amount))
|
|
1687
|
+
continue;
|
|
1688
|
+
const valuation = amount.valuation;
|
|
1689
|
+
if (!valuation || typeof valuation !== 'object' || !('amount' in valuation))
|
|
1690
|
+
continue;
|
|
1691
|
+
if (typeof valuation.amount !== 'string')
|
|
1692
|
+
continue;
|
|
1693
|
+
const value = parseValuationAmount(valuation.amount);
|
|
1694
|
+
if (bounds.from !== undefined && value < bounds.from)
|
|
1695
|
+
continue;
|
|
1696
|
+
if (bounds.to !== undefined && value > bounds.to)
|
|
1697
|
+
continue;
|
|
1698
|
+
return true;
|
|
1699
|
+
}
|
|
1700
|
+
return false;
|
|
1701
|
+
}
|
|
1599
1702
|
/** Builds common public activity fields from the normalized transaction hash and representative log. */
|
|
1600
1703
|
function baseFor(options) {
|
|
1601
1704
|
return {
|
|
@@ -1672,17 +1775,67 @@ export function addresses(options = {}) {
|
|
|
1672
1775
|
Cache.setPolicy(c, query.cursor === undefined ? Cache.policies.feed : Cache.policies.metadata);
|
|
1673
1776
|
try {
|
|
1674
1777
|
const chainId = query.chainId ?? c.get('chainId');
|
|
1778
|
+
const amountBounds = {
|
|
1779
|
+
from: parseRawAmount(query['amount.from']),
|
|
1780
|
+
to: parseRawAmount(query['amount.to']),
|
|
1781
|
+
};
|
|
1782
|
+
const valuationBounds = {
|
|
1783
|
+
from: query['valuation.amount.from'] === undefined
|
|
1784
|
+
? undefined
|
|
1785
|
+
: parseValuationAmount(query['valuation.amount.from']),
|
|
1786
|
+
to: query['valuation.amount.to'] === undefined
|
|
1787
|
+
? undefined
|
|
1788
|
+
: parseValuationAmount(query['valuation.amount.to']),
|
|
1789
|
+
};
|
|
1790
|
+
const filterByValuation = valuationBounds.from !== undefined || valuationBounds.to !== undefined;
|
|
1791
|
+
const activityFilter = {
|
|
1792
|
+
...(amountBounds.from !== undefined || amountBounds.to !== undefined
|
|
1793
|
+
? { amount: amountBounds }
|
|
1794
|
+
: {}),
|
|
1795
|
+
...(query.recipient ? { recipient: query.recipient } : {}),
|
|
1796
|
+
...(query.sender ? { sender: query.sender } : {}),
|
|
1797
|
+
...(query.token ? { token: query.token } : {}),
|
|
1798
|
+
};
|
|
1799
|
+
const candidate = Object.keys(activityFilter).length > 0 ? activityFilter : undefined;
|
|
1800
|
+
const types = new Set(query.type);
|
|
1801
|
+
const refine = types.size > 0 || candidate ? (items) => filterActivities({ filter: activityFilter, items: items.filter((item) => types.size === 0 || types.has(item.type)) }) : undefined; // prettier-ignore
|
|
1675
1802
|
const listed = await Timing.time(c, 'address_activities', async () => {
|
|
1676
1803
|
if (!query.include.includes('zones')) {
|
|
1677
|
-
const result = await Store.memoize((signal) => list(tidx({
|
|
1804
|
+
const result = await Store.memoize((signal) => list(tidx({
|
|
1805
|
+
chainId,
|
|
1806
|
+
signal,
|
|
1807
|
+
tidx: c.get('getTidx')(chainId),
|
|
1808
|
+
time: (name, fn) => Timing.sum(c, name, fn),
|
|
1809
|
+
}), {
|
|
1678
1810
|
address: address,
|
|
1679
1811
|
cursor: query.cursor,
|
|
1812
|
+
...(refine || filterByValuation || candidate
|
|
1813
|
+
? {
|
|
1814
|
+
filter: {
|
|
1815
|
+
candidate,
|
|
1816
|
+
refine: async (items) => {
|
|
1817
|
+
const filtered = refine ? refine(items) : [...items];
|
|
1818
|
+
if (!filterByValuation)
|
|
1819
|
+
return filtered;
|
|
1820
|
+
const enriched = await enrichTokens(c, {
|
|
1821
|
+
chainId,
|
|
1822
|
+
denomination: query['valuation.currency'],
|
|
1823
|
+
include: query.include,
|
|
1824
|
+
items: filtered,
|
|
1825
|
+
oracle,
|
|
1826
|
+
});
|
|
1827
|
+
return filtered.filter((_, index) => matchesValuationAmount(enriched.items[index], valuationBounds));
|
|
1828
|
+
},
|
|
1829
|
+
},
|
|
1830
|
+
}
|
|
1831
|
+
: {}),
|
|
1680
1832
|
group: query.group,
|
|
1681
1833
|
limit: query.limit,
|
|
1682
1834
|
logs: query.logs,
|
|
1683
1835
|
store: c.get('store'),
|
|
1836
|
+
time: (name, fn) => Timing.sum(c, name, fn),
|
|
1684
1837
|
}), {
|
|
1685
|
-
key: `activities:
|
|
1838
|
+
key: `activities:v4:${chainId}:${address.toLowerCase()}:${query.type.join(',')}:${query['amount.from'] ?? ''}:${query['amount.to'] ?? ''}:${query.recipient ?? ''}:${query.sender ?? ''}:${query.token ?? ''}:${query['valuation.amount.from'] ?? ''}:${query['valuation.amount.to'] ?? ''}:${query['valuation.currency'] ?? ''}:${query.group ?? false}:${query.logs ?? false}:${query.cursor ?? 'head'}:${query.limit}`,
|
|
1686
1839
|
store: c.get('store'),
|
|
1687
1840
|
ttl: Ttl.seconds(15),
|
|
1688
1841
|
});
|
|
@@ -1695,6 +1848,25 @@ export function addresses(options = {}) {
|
|
|
1695
1848
|
const result = await Store.memoize((signal) => listChains({
|
|
1696
1849
|
address: address,
|
|
1697
1850
|
cursor: query.cursor,
|
|
1851
|
+
...(refine || filterByValuation || candidate
|
|
1852
|
+
? {
|
|
1853
|
+
filter: {
|
|
1854
|
+
candidate,
|
|
1855
|
+
refine: async (items) => {
|
|
1856
|
+
const filtered = refine ? refine(items) : [...items];
|
|
1857
|
+
if (!filterByValuation)
|
|
1858
|
+
return filtered;
|
|
1859
|
+
const enriched = await enrichChainTokens(c, {
|
|
1860
|
+
denomination: query['valuation.currency'],
|
|
1861
|
+
include: query.include,
|
|
1862
|
+
items: filtered,
|
|
1863
|
+
oracle,
|
|
1864
|
+
});
|
|
1865
|
+
return filtered.filter((_, index) => matchesValuationAmount(enriched.items[index], valuationBounds));
|
|
1866
|
+
},
|
|
1867
|
+
},
|
|
1868
|
+
}
|
|
1869
|
+
: {}),
|
|
1698
1870
|
group: query.group,
|
|
1699
1871
|
limit: query.limit,
|
|
1700
1872
|
logs: query.logs,
|
|
@@ -1704,11 +1876,13 @@ export function addresses(options = {}) {
|
|
|
1704
1876
|
chainId,
|
|
1705
1877
|
signal,
|
|
1706
1878
|
tidx: c.get('getTidx')(chainId),
|
|
1879
|
+
time: (name, fn) => Timing.sum(c, name, fn),
|
|
1707
1880
|
}),
|
|
1708
1881
|
})),
|
|
1709
1882
|
store: c.get('store'),
|
|
1883
|
+
time: (name, fn) => Timing.sum(c, name, fn),
|
|
1710
1884
|
}), {
|
|
1711
|
-
key: `activities:zones:
|
|
1885
|
+
key: `activities:zones:v5:${chainIds.join(',')}:${address.toLowerCase()}:${query.type.join(',')}:${query['amount.from'] ?? ''}:${query['amount.to'] ?? ''}:${query.recipient ?? ''}:${query.sender ?? ''}:${query.token ?? ''}:${query['valuation.amount.from'] ?? ''}:${query['valuation.amount.to'] ?? ''}:${query['valuation.currency'] ?? ''}:${query.group ?? false}:${query.logs ?? false}:${query.cursor ?? 'head'}:${query.limit}`,
|
|
1712
1886
|
store: c.get('store'),
|
|
1713
1887
|
ttl: Ttl.seconds(15),
|
|
1714
1888
|
});
|
|
@@ -2013,6 +2187,7 @@ async function classifyTransactionActivities(options) {
|
|
|
2013
2187
|
const group = groupByTx(rows)[0];
|
|
2014
2188
|
return classifyGroup(group, viewer, fingerprintMap, logs).map(withTitle);
|
|
2015
2189
|
}
|
|
2190
|
+
const noAddressActivityTiming = async (_name, fn) => fn();
|
|
2016
2191
|
/**
|
|
2017
2192
|
* Lists classified activity for an address by running the shared pipeline
|
|
2018
2193
|
* (`groupByTx` → `classifyGroup` → `enrichItem`) over rows from a
|
|
@@ -2021,10 +2196,11 @@ async function classifyTransactionActivities(options) {
|
|
|
2021
2196
|
*/
|
|
2022
2197
|
export async function list(provider, options) {
|
|
2023
2198
|
const { address, cursor, group = false, limit = 20, logs = false } = options;
|
|
2199
|
+
const time = options.time ?? noAddressActivityTiming;
|
|
2024
2200
|
const viewer = address.toLowerCase();
|
|
2025
2201
|
// Best-effort MPP service directory: a fetch failure yields an empty map, so
|
|
2026
2202
|
// enrichment never blocks the feed.
|
|
2027
|
-
const fingerprintMap_promise = Mpp.fingerprintMap({ store: options.store }).catch(() => ({}));
|
|
2203
|
+
const fingerprintMap_promise = time('address_activity_mpp', () => Mpp.fingerprintMap({ store: options.store })).catch(() => ({}));
|
|
2028
2204
|
let currentCursor = cursor;
|
|
2029
2205
|
const allItems = [];
|
|
2030
2206
|
let hasMore = false;
|
|
@@ -2034,7 +2210,12 @@ export async function list(provider, options) {
|
|
|
2034
2210
|
// measured against grouped entries (folding can collapse a page to very few),
|
|
2035
2211
|
// otherwise against the raw item count.
|
|
2036
2212
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
2037
|
-
const { rows } = await provider.fetchRows({
|
|
2213
|
+
const { rows } = await provider.fetchRows({
|
|
2214
|
+
address: viewer,
|
|
2215
|
+
cursor: currentCursor,
|
|
2216
|
+
...(options.filter?.candidate ? { filter: options.filter.candidate } : {}),
|
|
2217
|
+
limit,
|
|
2218
|
+
});
|
|
2038
2219
|
const grouped = groupByTx(rows);
|
|
2039
2220
|
const txGroups = grouped.slice(0, limit + 1);
|
|
2040
2221
|
hasMore = txGroups.length > limit;
|
|
@@ -2042,7 +2223,8 @@ export async function list(provider, options) {
|
|
|
2042
2223
|
const fingerprintMap = await fingerprintMap_promise;
|
|
2043
2224
|
if (page.length === 0)
|
|
2044
2225
|
break;
|
|
2045
|
-
|
|
2226
|
+
const classified = await time('address_activity_classify', () => page.flatMap((txGroup) => classifyGroup(txGroup, viewer, fingerprintMap, logs).map(withTitle)));
|
|
2227
|
+
allItems.push(...(options.filter?.refine ? await options.filter.refine(classified) : classified));
|
|
2046
2228
|
lastGroup = page[page.length - 1];
|
|
2047
2229
|
const enough = group
|
|
2048
2230
|
? groupByAccessKeyItems(allItems).length >= minGroupEntries
|
|
@@ -2067,11 +2249,12 @@ const chainCursorVersion = 2;
|
|
|
2067
2249
|
export async function listChains(options) {
|
|
2068
2250
|
const { address, cursor, limit = 20, logs = false, providers, store } = options;
|
|
2069
2251
|
const group = options.group ?? false;
|
|
2252
|
+
const time = options.time ?? noAddressActivityTiming;
|
|
2070
2253
|
const orderedProviders = [...providers].sort((a, b) => a.chainId - b.chainId);
|
|
2071
2254
|
const chainIds = orderedProviders.map(({ chainId }) => chainId);
|
|
2072
2255
|
const cursors = decodeChainCursor(cursor, chainIds);
|
|
2073
2256
|
const viewer = address.toLowerCase();
|
|
2074
|
-
const fingerprintMap_promise = Mpp.fingerprintMap({ store }).catch(() => ({}));
|
|
2257
|
+
const fingerprintMap_promise = time('address_activity_mpp', () => Mpp.fingerprintMap({ store })).catch(() => ({}));
|
|
2075
2258
|
const states = orderedProviders.map(({ chainId, provider }) => ({
|
|
2076
2259
|
chainId,
|
|
2077
2260
|
exhausted: false,
|
|
@@ -2087,6 +2270,7 @@ export async function listChains(options) {
|
|
|
2087
2270
|
const { rows } = await state.provider.fetchRows({
|
|
2088
2271
|
address: viewer,
|
|
2089
2272
|
cursor: cursors.get(state.chainId),
|
|
2273
|
+
...(options.filter?.candidate ? { filter: options.filter.candidate } : {}),
|
|
2090
2274
|
limit,
|
|
2091
2275
|
});
|
|
2092
2276
|
const groups = groupByTx(rows).slice(0, limit + 1);
|
|
@@ -2108,14 +2292,19 @@ export async function listChains(options) {
|
|
|
2108
2292
|
const fingerprintMap = await fingerprintMap_promise;
|
|
2109
2293
|
if (page.length === 0)
|
|
2110
2294
|
break;
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2295
|
+
const classified = await time('address_activity_classify', () => {
|
|
2296
|
+
const items = [];
|
|
2297
|
+
for (const { state, txGroup } of page) {
|
|
2298
|
+
state.groups.splice(state.groups.indexOf(txGroup), 1);
|
|
2299
|
+
cursors.set(state.chainId, state.provider.cursorForGroup(txGroup));
|
|
2300
|
+
items.push(...classifyGroup(txGroup, viewer, fingerprintMap, logs).map((item) => ({
|
|
2301
|
+
...withTitle(item),
|
|
2302
|
+
chainId: state.chainId,
|
|
2303
|
+
})));
|
|
2304
|
+
}
|
|
2305
|
+
return items;
|
|
2306
|
+
});
|
|
2307
|
+
allItems.push(...(options.filter?.refine ? await options.filter.refine(classified) : classified));
|
|
2119
2308
|
hasMore = states.some((state) => !state.exhausted || state.groups.length > 0);
|
|
2120
2309
|
const enough = group
|
|
2121
2310
|
? groupByAccessKeyItems(allItems).length >= minGroupEntries
|
|
@@ -2131,6 +2320,7 @@ export async function listChains(options) {
|
|
|
2131
2320
|
const { rows } = await state.provider.fetchRows({
|
|
2132
2321
|
address: viewer,
|
|
2133
2322
|
cursor: cursors.get(state.chainId),
|
|
2323
|
+
...(options.filter?.candidate ? { filter: options.filter.candidate } : {}),
|
|
2134
2324
|
limit: 1,
|
|
2135
2325
|
});
|
|
2136
2326
|
const group = groupByTx(rows)[0];
|
|
@@ -2171,16 +2361,13 @@ function encodeChainCursor(cursors, chainIds) {
|
|
|
2171
2361
|
]);
|
|
2172
2362
|
}
|
|
2173
2363
|
/**
|
|
2174
|
-
* Creates a TIDX-backed {@link Provider} that runs
|
|
2175
|
-
*
|
|
2176
|
-
*
|
|
2177
|
-
* then fetch the selected transactions' logs with a bounded lookup.
|
|
2178
|
-
* - Q2 (inbound): decoded `Transfer` events to the address.
|
|
2179
|
-
* - Q3 (outbound transfers): decoded `Transfer` events from the address
|
|
2180
|
-
* (catches access-key-signed sends where `tx.from` differs from the address).
|
|
2364
|
+
* Creates a TIDX-backed {@link Provider} that runs two sub-queries in parallel:
|
|
2365
|
+
* one joins bounded outbound transactions to their logs, and one reads inbound
|
|
2366
|
+
* and outbound `Transfer` logs.
|
|
2181
2367
|
*/
|
|
2182
2368
|
export function tidx(deps) {
|
|
2183
2369
|
const { chainId, signal, tidx: tidxClient } = deps;
|
|
2370
|
+
const time = deps.time ?? noAddressActivityTiming;
|
|
2184
2371
|
const fetch = (options) => {
|
|
2185
2372
|
const requestSignal = signal && options.signal
|
|
2186
2373
|
? AbortSignal.any([signal, options.signal])
|
|
@@ -2199,179 +2386,287 @@ export function tidx(deps) {
|
|
|
2199
2386
|
return undefined;
|
|
2200
2387
|
return { blockNum: decoded[0], txIdx: decoded[1] };
|
|
2201
2388
|
}
|
|
2202
|
-
/**
|
|
2203
|
-
* Q1 pages outbound receipts, then fetches their logs by bounded block range
|
|
2204
|
-
* and transaction hash. The cursor preserves block and transaction index order.
|
|
2205
|
-
*/
|
|
2389
|
+
/** Q1 joins bounded outbound transactions to their logs. */
|
|
2206
2390
|
async function queryOutbound(options) {
|
|
2207
2391
|
const { address, cursor, limit } = options;
|
|
2208
|
-
const
|
|
2392
|
+
const receiptKeyset = cursor
|
|
2209
2393
|
? `AND block_num <= ${cursor.blockNum} AND (block_num < ${cursor.blockNum} OR tx_idx < ${cursor.txIdx})`
|
|
2210
2394
|
: '';
|
|
2211
2395
|
const queryLimit = limit + 1;
|
|
2212
|
-
const
|
|
2396
|
+
const txKeyset = cursor
|
|
2397
|
+
? `AND block_num <= ${cursor.blockNum} AND (block_num < ${cursor.blockNum} OR idx < ${cursor.txIdx})`
|
|
2398
|
+
: '';
|
|
2399
|
+
const result = await time('address_activity_outbound', () => fetch({
|
|
2213
2400
|
chainId,
|
|
2214
2401
|
// Raw-table query (no signature-decoded CTE), so the inline SQL is cast
|
|
2215
2402
|
// to `string`.
|
|
2216
2403
|
query: `
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2404
|
+
WITH outbound_candidates AS (
|
|
2405
|
+
(SELECT hash AS tx_hash, block_num, block_timestamp, idx AS tx_idx, "from", fee_payer
|
|
2406
|
+
FROM txs
|
|
2407
|
+
WHERE "from" = '${address}' ${txKeyset}
|
|
2408
|
+
ORDER BY block_num DESC, idx DESC
|
|
2409
|
+
LIMIT ${queryLimit})
|
|
2410
|
+
UNION
|
|
2411
|
+
(SELECT tx_hash, block_num, block_timestamp, tx_idx, "from", fee_payer
|
|
2412
|
+
FROM receipts
|
|
2413
|
+
WHERE fee_payer = '${address}' ${receiptKeyset}
|
|
2414
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2415
|
+
LIMIT ${queryLimit})
|
|
2416
|
+
), outbound AS (
|
|
2417
|
+
SELECT tx_hash, block_num, block_timestamp, tx_idx, "from", fee_payer
|
|
2418
|
+
FROM outbound_candidates
|
|
2419
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2420
|
+
LIMIT ${queryLimit}
|
|
2421
|
+
)
|
|
2422
|
+
SELECT outbound.tx_hash, outbound.block_num, outbound.block_timestamp,
|
|
2423
|
+
outbound.tx_idx, outbound."from", outbound.fee_payer, logs.log_idx,
|
|
2424
|
+
logs.address, logs.selector, logs.topic1, logs.topic2, logs.topic3, logs.data
|
|
2425
|
+
FROM outbound
|
|
2426
|
+
INNER JOIN logs
|
|
2427
|
+
ON logs.tx_hash = outbound.tx_hash AND logs.block_num = outbound.block_num
|
|
2428
|
+
ORDER BY outbound.block_num DESC, outbound.tx_idx DESC, logs.log_idx ASC
|
|
2222
2429
|
`,
|
|
2223
|
-
});
|
|
2224
|
-
|
|
2225
|
-
// `limit + 1` transactions after the two ordered sets are merged.
|
|
2226
|
-
const [paid, sent] = await Promise.all([fetchReceipts('fee_payer'), fetchReceipts('from')]);
|
|
2227
|
-
const seen = new Set();
|
|
2228
|
-
const receipts = [...paid.rows, ...sent.rows]
|
|
2229
|
-
.map((r) => ({
|
|
2430
|
+
}));
|
|
2431
|
+
return result.rows.map((r) => ({
|
|
2230
2432
|
blockNum: Number(Value.toNumber(r['block_num'])),
|
|
2231
2433
|
blockTimestamp: Number(Value.toNumber(r['block_timestamp'])),
|
|
2434
|
+
data: Value.toText(r['data']) ?? null,
|
|
2232
2435
|
feePayer: lowerOrNull(r['fee_payer']),
|
|
2436
|
+
logAddress: lower(r['address']),
|
|
2437
|
+
logIdx: Number(Value.toNumber(r['log_idx'])),
|
|
2438
|
+
selector: Value.toText(r['selector']) ?? null,
|
|
2439
|
+
source: 'q1',
|
|
2440
|
+
topic1: Value.toText(r['topic1']) ?? null,
|
|
2441
|
+
topic2: Value.toText(r['topic2']) ?? null,
|
|
2442
|
+
topic3: Value.toText(r['topic3']) ?? null,
|
|
2233
2443
|
txHash: lowerHash(r['tx_hash']),
|
|
2234
2444
|
txIdx: Number(Value.toNumber(r['tx_idx'])),
|
|
2235
2445
|
txSender: lowerOrNull(r['from']),
|
|
2236
|
-
}))
|
|
2237
|
-
.filter((receipt) => {
|
|
2238
|
-
if (seen.has(receipt.txHash))
|
|
2239
|
-
return false;
|
|
2240
|
-
seen.add(receipt.txHash);
|
|
2241
|
-
return true;
|
|
2242
|
-
})
|
|
2243
|
-
.sort((a, b) => {
|
|
2244
|
-
if (a.blockNum !== b.blockNum)
|
|
2245
|
-
return b.blockNum - a.blockNum;
|
|
2246
|
-
return b.txIdx - a.txIdx;
|
|
2247
|
-
})
|
|
2248
|
-
.slice(0, queryLimit);
|
|
2249
|
-
if (receipts.length === 0)
|
|
2250
|
-
return [];
|
|
2251
|
-
const blocks = receipts.map((receipt) => receipt.blockNum);
|
|
2252
|
-
const receiptByHash = new Map(receipts.map((receipt) => [receipt.txHash, receipt]));
|
|
2253
|
-
const txHashes = receipts.map((receipt) => `'${receipt.txHash}'`).join(', ');
|
|
2254
|
-
// `logs` is not keyed by transaction hash, so pair the bounded hash list
|
|
2255
|
-
// with the selected receipts' block range to avoid a full archive scan.
|
|
2256
|
-
const logs = await fetch({
|
|
2257
|
-
chainId,
|
|
2258
|
-
// Raw-table query (no signature-decoded CTE), so the inline SQL is cast
|
|
2259
|
-
// to `string`.
|
|
2260
|
-
query: `
|
|
2261
|
-
SELECT tx_hash, block_num, tx_idx, log_idx, address, selector, topic1, topic2, topic3, data
|
|
2262
|
-
FROM logs
|
|
2263
|
-
WHERE block_num BETWEEN ${Math.min(...blocks)} AND ${Math.max(...blocks)}
|
|
2264
|
-
AND tx_hash IN (${txHashes})
|
|
2265
|
-
ORDER BY block_num DESC, tx_idx DESC, log_idx ASC
|
|
2266
|
-
`,
|
|
2267
|
-
});
|
|
2268
|
-
const rows = logs.rows.flatMap((r) => {
|
|
2269
|
-
const receipt = receiptByHash.get(lowerHash(r['tx_hash']));
|
|
2270
|
-
if (!receipt)
|
|
2271
|
-
return [];
|
|
2272
|
-
return [
|
|
2273
|
-
{
|
|
2274
|
-
blockNum: receipt.blockNum,
|
|
2275
|
-
blockTimestamp: receipt.blockTimestamp,
|
|
2276
|
-
data: Value.toText(r['data']) ?? null,
|
|
2277
|
-
feePayer: receipt.feePayer,
|
|
2278
|
-
logAddress: lower(r['address']),
|
|
2279
|
-
logIdx: Number(Value.toNumber(r['log_idx'])),
|
|
2280
|
-
selector: Value.toText(r['selector']) ?? null,
|
|
2281
|
-
source: 'q1',
|
|
2282
|
-
topic1: Value.toText(r['topic1']) ?? null,
|
|
2283
|
-
topic2: Value.toText(r['topic2']) ?? null,
|
|
2284
|
-
topic3: Value.toText(r['topic3']) ?? null,
|
|
2285
|
-
txHash: receipt.txHash,
|
|
2286
|
-
txIdx: receipt.txIdx,
|
|
2287
|
-
txSender: receipt.txSender,
|
|
2288
|
-
},
|
|
2289
|
-
];
|
|
2290
|
-
});
|
|
2291
|
-
return mergeAndSort(rows, [], []);
|
|
2446
|
+
}));
|
|
2292
2447
|
}
|
|
2293
|
-
/** Q2
|
|
2448
|
+
/** Q2 reads inbound and outbound `Transfer` logs in one request. */
|
|
2294
2449
|
async function queryTransfers(options) {
|
|
2295
|
-
const { address, cursor,
|
|
2296
|
-
const
|
|
2297
|
-
? `
|
|
2298
|
-
:
|
|
2299
|
-
const
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2450
|
+
const { address, cursor, filter, limit } = options;
|
|
2451
|
+
const keyset = cursor
|
|
2452
|
+
? `AND (block_num < ${cursor.blockNum} OR (block_num = ${cursor.blockNum} AND tx_idx < ${cursor.txIdx}))`
|
|
2453
|
+
: '';
|
|
2454
|
+
const amount = filter?.amount;
|
|
2455
|
+
const participantPredicates = [
|
|
2456
|
+
...(filter?.recipient !== undefined ? [`"to" = '${filter.recipient}'`] : []),
|
|
2457
|
+
...(filter?.sender !== undefined ? [`"from" = '${filter.sender}'`] : []),
|
|
2458
|
+
];
|
|
2459
|
+
const materializedPredicate = [
|
|
2460
|
+
...participantPredicates,
|
|
2461
|
+
...(filter?.token !== undefined ? [`token = '${filter.token}'`] : []),
|
|
2462
|
+
...(amount?.from !== undefined
|
|
2463
|
+
? amount.from > maxTokenAmount
|
|
2464
|
+
? ['0']
|
|
2465
|
+
: [`toUInt256(amount) >= toUInt256('${amount.from}')`]
|
|
2466
|
+
: []),
|
|
2467
|
+
...(amount?.to !== undefined && amount.to < maxTokenAmount
|
|
2468
|
+
? [`toUInt256(amount) <= toUInt256('${amount.to}')`]
|
|
2469
|
+
: []),
|
|
2470
|
+
]
|
|
2471
|
+
.map((predicate) => `AND ${predicate}`)
|
|
2472
|
+
.join(' ');
|
|
2473
|
+
const decodedPredicate = [
|
|
2474
|
+
...participantPredicates,
|
|
2475
|
+
...(filter?.token !== undefined ? [`address = '${filter.token}'`] : []),
|
|
2476
|
+
...(amount?.from !== undefined
|
|
2477
|
+
? amount.from > maxTokenAmount
|
|
2478
|
+
? ['0']
|
|
2479
|
+
: [`value >= ${amount.from}`]
|
|
2480
|
+
: []),
|
|
2481
|
+
...(amount?.to !== undefined && amount.to < maxTokenAmount ? [`value <= ${amount.to}`] : []),
|
|
2482
|
+
]
|
|
2483
|
+
.map((predicate) => `AND ${predicate}`)
|
|
2484
|
+
.join(' ');
|
|
2485
|
+
const queryLimit = limit + 1;
|
|
2486
|
+
const result = await time('address_activity_transfers', async () => {
|
|
2308
2487
|
try {
|
|
2309
2488
|
return await fetch({
|
|
2310
2489
|
chainId,
|
|
2311
|
-
|
|
2312
|
-
|
|
2490
|
+
engine: 'clickhouse',
|
|
2491
|
+
// Bound transaction candidates first, then return every matching row
|
|
2492
|
+
// for each selected transaction so the group cursor cannot split one.
|
|
2493
|
+
query: `
|
|
2494
|
+
WITH transfer_candidates AS (
|
|
2495
|
+
(SELECT DISTINCT tx_hash, block_num, tx_idx
|
|
2496
|
+
FROM token_transfers
|
|
2497
|
+
WHERE "to" = '${address}' AND "from" != '${address}' ${materializedPredicate} ${keyset}
|
|
2498
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2499
|
+
LIMIT ${queryLimit})
|
|
2500
|
+
UNION DISTINCT
|
|
2501
|
+
(SELECT DISTINCT tx_hash, block_num, tx_idx
|
|
2502
|
+
FROM token_transfers
|
|
2503
|
+
WHERE "from" = '${address}' AND "to" != '${address}' ${materializedPredicate} ${keyset}
|
|
2504
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2505
|
+
LIMIT ${queryLimit})
|
|
2506
|
+
), selected_transactions AS (
|
|
2507
|
+
SELECT tx_hash, block_num, tx_idx
|
|
2508
|
+
FROM transfer_candidates
|
|
2509
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2510
|
+
LIMIT ${queryLimit}
|
|
2511
|
+
)
|
|
2512
|
+
SELECT DISTINCT indexed.token AS address,
|
|
2513
|
+
toString(toUInt256(indexed.amount)) AS amount, indexed.tx_hash, indexed.block_num,
|
|
2514
|
+
toUnixTimestamp(indexed.block_timestamp) AS block_timestamp_unix,
|
|
2515
|
+
indexed.log_idx, indexed.tx_idx, indexed."from", indexed."to"
|
|
2516
|
+
FROM token_transfers AS indexed
|
|
2517
|
+
INNER JOIN selected_transactions AS selected
|
|
2518
|
+
ON selected.tx_hash = indexed.tx_hash AND selected.block_num = indexed.block_num
|
|
2519
|
+
AND selected.tx_idx = indexed.tx_idx
|
|
2520
|
+
WHERE (indexed."to" = '${address}' AND indexed."from" != '${address}')
|
|
2521
|
+
OR (indexed."from" = '${address}' AND indexed."to" != '${address}')
|
|
2522
|
+
ORDER BY indexed.block_num DESC, indexed.tx_idx DESC, indexed.log_idx DESC
|
|
2523
|
+
`,
|
|
2313
2524
|
});
|
|
2314
2525
|
}
|
|
2315
2526
|
catch (error) {
|
|
2316
|
-
|
|
2527
|
+
// Older indexers reject materialized address scans. Retain the decoded
|
|
2528
|
+
// Transfer source so activity feeds remain available on those chains.
|
|
2529
|
+
if (!Tidx.isQueryRejection(error))
|
|
2317
2530
|
throw error;
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2531
|
+
const predicates = [
|
|
2532
|
+
`"to" = '${address}' AND "from" != '${address}'`,
|
|
2533
|
+
`"from" = '${address}' AND "to" != '${address}'`,
|
|
2534
|
+
];
|
|
2535
|
+
const fetchDecoded = async (predicate, queryLimit) => {
|
|
2536
|
+
const where = `WHERE ${predicate} ${decodedPredicate}`;
|
|
2537
|
+
try {
|
|
2538
|
+
return await fetch({
|
|
2539
|
+
chainId,
|
|
2540
|
+
query: `
|
|
2541
|
+
SELECT DISTINCT tx_hash, block_num, tx_idx
|
|
2542
|
+
FROM Transfer
|
|
2543
|
+
${where}
|
|
2544
|
+
ORDER BY block_num DESC, tx_idx DESC
|
|
2545
|
+
LIMIT ${queryLimit}
|
|
2546
|
+
`,
|
|
2547
|
+
signatures: [Transfers.signature],
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
catch (error) {
|
|
2551
|
+
// Match the transfer feed's bounded fallback when sparse decoded
|
|
2552
|
+
// top-N queries are rejected by an older indexer.
|
|
2553
|
+
if (!Tidx.isDeterministicError(error))
|
|
2554
|
+
throw error;
|
|
2555
|
+
const sample = await fetch({
|
|
2556
|
+
chainId,
|
|
2557
|
+
query: `
|
|
2558
|
+
SELECT DISTINCT tx_hash, block_num, tx_idx
|
|
2559
|
+
FROM Transfer
|
|
2560
|
+
${where}
|
|
2561
|
+
LIMIT ${Schema.countCap}
|
|
2562
|
+
`,
|
|
2563
|
+
signatures: [Transfers.signature],
|
|
2564
|
+
});
|
|
2565
|
+
// An unordered sample is safe only when complete. At the cap,
|
|
2566
|
+
// preserve the rejection rather than issue a cursor that can skip rows.
|
|
2567
|
+
if (sample.rows.length >= Schema.countCap)
|
|
2568
|
+
throw error;
|
|
2569
|
+
return {
|
|
2570
|
+
rows: sample.rows
|
|
2571
|
+
.sort((a, b) => Number(b['block_num']) - Number(a['block_num']) ||
|
|
2572
|
+
Number(b['tx_idx']) - Number(a['tx_idx']))
|
|
2573
|
+
.slice(0, queryLimit),
|
|
2574
|
+
};
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
const rows = await Promise.all(predicates.map(async (predicate) => {
|
|
2578
|
+
const sameBlock = cursor
|
|
2579
|
+
? `AND block_num = ${cursor.blockNum} AND tx_idx < ${cursor.txIdx}`
|
|
2580
|
+
: '';
|
|
2581
|
+
const first = await fetchDecoded(`${predicate} ${sameBlock}`, queryLimit);
|
|
2582
|
+
if (!cursor || first.rows.length >= queryLimit)
|
|
2583
|
+
return first.rows;
|
|
2584
|
+
const older = await fetchDecoded(`${predicate} AND block_num < ${cursor.blockNum}`, queryLimit - first.rows.length);
|
|
2585
|
+
return [...first.rows, ...older.rows];
|
|
2586
|
+
}));
|
|
2587
|
+
const candidates = rows
|
|
2588
|
+
.flat()
|
|
2589
|
+
.sort((a, b) => Number(b['block_num']) - Number(a['block_num']) ||
|
|
2590
|
+
Number(b['tx_idx']) - Number(a['tx_idx']));
|
|
2591
|
+
const hashes = [...new Set(candidates.map((row) => lowerHash(row['tx_hash'])))].slice(0, queryLimit);
|
|
2592
|
+
if (hashes.length === 0)
|
|
2593
|
+
return { rows: [] };
|
|
2594
|
+
// Candidate limits count transactions. Hydrate all viewer transfers,
|
|
2595
|
+
// including rows outside candidate filters, before classification.
|
|
2596
|
+
const transfers = await fetch({
|
|
2597
|
+
chainId,
|
|
2598
|
+
query: `
|
|
2599
|
+
SELECT address, value AS amount, tx_hash, block_num, block_timestamp,
|
|
2600
|
+
log_idx, tx_idx, "from", "to"
|
|
2601
|
+
FROM Transfer
|
|
2602
|
+
WHERE tx_hash IN (${hashes.map((hash) => `'${hash}'`).join(', ')})
|
|
2603
|
+
AND (("to" = '${address}' AND "from" != '${address}')
|
|
2604
|
+
OR ("from" = '${address}' AND "to" != '${address}'))
|
|
2605
|
+
LIMIT ${Schema.countCap}
|
|
2606
|
+
`,
|
|
2607
|
+
signatures: [Transfers.signature],
|
|
2608
|
+
});
|
|
2609
|
+
// TIDX caps results even without a SQL limit. Never publish a page
|
|
2610
|
+
// whose selected transactions might have been truncated by that cap.
|
|
2611
|
+
if (transfers.rows.length >= Schema.countCap)
|
|
2612
|
+
throw error;
|
|
2613
|
+
return transfers;
|
|
2339
2614
|
}
|
|
2340
|
-
})
|
|
2341
|
-
const rows = result.rows.
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2615
|
+
});
|
|
2616
|
+
const rows = result.rows.flatMap((r) => {
|
|
2617
|
+
const transferAmount = Value.toIntegerString(r['amount']);
|
|
2618
|
+
const transferFrom = lowerOrNull(r['from']);
|
|
2619
|
+
const transferTo = lowerOrNull(r['to']);
|
|
2620
|
+
const blockTimestamp = (() => {
|
|
2621
|
+
const value = r['block_timestamp_unix'] ?? r['block_timestamp'];
|
|
2622
|
+
const numeric = Value.toNumber(value);
|
|
2623
|
+
if (numeric !== undefined && Number.isFinite(numeric))
|
|
2624
|
+
return numeric;
|
|
2625
|
+
const timestamp = Value.toIsoDateTime(value);
|
|
2626
|
+
return timestamp === undefined ? undefined : Date.parse(timestamp) / 1_000;
|
|
2627
|
+
})();
|
|
2628
|
+
if (transferAmount === undefined ||
|
|
2629
|
+
!transferFrom ||
|
|
2630
|
+
!transferTo ||
|
|
2631
|
+
blockTimestamp === undefined ||
|
|
2632
|
+
!Number.isFinite(blockTimestamp))
|
|
2633
|
+
return [];
|
|
2634
|
+
return [
|
|
2635
|
+
{
|
|
2636
|
+
blockNum: Number(Value.toNumber(r['block_num'])),
|
|
2637
|
+
blockTimestamp,
|
|
2638
|
+
data: null,
|
|
2639
|
+
feePayer: null,
|
|
2640
|
+
logAddress: lower(r['address']),
|
|
2641
|
+
logIdx: Number(Value.toNumber(r['log_idx'])),
|
|
2642
|
+
selector: null,
|
|
2643
|
+
source: 'q2',
|
|
2644
|
+
topic1: null,
|
|
2645
|
+
topic2: null,
|
|
2646
|
+
topic3: null,
|
|
2647
|
+
transferAmount: BigInt(transferAmount),
|
|
2648
|
+
transferFrom,
|
|
2649
|
+
transferTo,
|
|
2650
|
+
transferToken: lower(r['address']),
|
|
2651
|
+
txHash: lowerHash(r['tx_hash']),
|
|
2652
|
+
txIdx: Number(Value.toNumber(r['tx_idx'])),
|
|
2653
|
+
txSender: null,
|
|
2654
|
+
},
|
|
2655
|
+
];
|
|
2656
|
+
});
|
|
2657
|
+
return mergeAndSort([], rows, []);
|
|
2362
2658
|
}
|
|
2363
2659
|
return {
|
|
2364
2660
|
cursorForGroup(group) {
|
|
2365
2661
|
return Cursor.encode([group.blockNum, group.txIdx]);
|
|
2366
2662
|
},
|
|
2367
|
-
async fetchRows({ address, cursor, limit }) {
|
|
2663
|
+
async fetchRows({ address, cursor, filter, limit }) {
|
|
2368
2664
|
const parsed = cursor ? parseCursor(cursor) : undefined;
|
|
2369
|
-
const [q1, q2
|
|
2665
|
+
const [q1, q2] = await Promise.all([
|
|
2370
2666
|
queryOutbound({ address, cursor: parsed, limit }),
|
|
2371
|
-
queryTransfers({ address, cursor: parsed,
|
|
2372
|
-
queryTransfers({ address, cursor: parsed, limit, side: 'outbound' }),
|
|
2667
|
+
queryTransfers({ address, cursor: parsed, filter, limit }),
|
|
2373
2668
|
]);
|
|
2374
|
-
return { rows: mergeAndSort(q1, q2,
|
|
2669
|
+
return { rows: mergeAndSort(q1, q2, []) };
|
|
2375
2670
|
},
|
|
2376
2671
|
};
|
|
2377
2672
|
}
|
|
@@ -2742,7 +3037,7 @@ function classifyFromLogsCore(rows, ctx, events = decodeRows(rows)) {
|
|
|
2742
3037
|
else
|
|
2743
3038
|
takeEvent((e) => e.eventName === 'Deposited' && Address.isEqual(e.address, vault));
|
|
2744
3039
|
claimVaultLegs(vault, [args.inputAmount, args.vaultAssets, args.earnShares]);
|
|
2745
|
-
// The
|
|
3040
|
+
// The routes leg pays the router (the emitting contract), not the vault.
|
|
2746
3041
|
claimVaultLegs(event.address, [args.inputAmount]);
|
|
2747
3042
|
return { ...itemBase(event.logIndex), data, type: 'private-assets-deposited' };
|
|
2748
3043
|
});
|
|
@@ -3435,7 +3730,7 @@ function classifyFromLogsCore(rows, ctx, events = decodeRows(rows)) {
|
|
|
3435
3730
|
};
|
|
3436
3731
|
});
|
|
3437
3732
|
// Reward pool funded: the funded token is the emitting contract itself;
|
|
3438
|
-
// claim the
|
|
3733
|
+
// claim the route transfer.
|
|
3439
3734
|
recognize(named('RewardDistributed'), (event) => {
|
|
3440
3735
|
const args = event.args;
|
|
3441
3736
|
takeTransfer((leg) => Address.isEqual(leg.address, event.address) &&
|
|
@@ -4030,7 +4325,7 @@ function decodeRows(rows) {
|
|
|
4030
4325
|
// logs per log and can yield `args: undefined`; normalize so `in`-guards
|
|
4031
4326
|
// never throw.
|
|
4032
4327
|
return parseEventLogs({
|
|
4033
|
-
abi: [...Abis.
|
|
4328
|
+
abi: [...Abis.core, ...Abis.earnRouter, ...Abis.earnVault, ...erc4626Events],
|
|
4034
4329
|
logs,
|
|
4035
4330
|
strict: false,
|
|
4036
4331
|
}).map((event) => ({ ...event, args: event.args ?? {} }));
|
|
@@ -4119,9 +4414,15 @@ function collectTokens(item, set) {
|
|
|
4119
4414
|
function getActivityTokenMetadata(c, options) {
|
|
4120
4415
|
const { address, chainId } = options;
|
|
4121
4416
|
if (address.startsWith(tip20AddressPrefix))
|
|
4122
|
-
return Tokens.getTokenMetadata(c, {
|
|
4123
|
-
|
|
4124
|
-
|
|
4417
|
+
return Tokens.getTokenMetadata(c, {
|
|
4418
|
+
address,
|
|
4419
|
+
chainId,
|
|
4420
|
+
timeOrigin: (fn) => Timing.sum(c, 'activity_token_metadata_origin', fn),
|
|
4421
|
+
});
|
|
4422
|
+
return Store.memoize(() => Timing.sum(c, 'activity_token_metadata_origin', async () => {
|
|
4423
|
+
const metadata = await viem_Token.getMetadata(c.get('getClient')(chainId), {
|
|
4424
|
+
token: address,
|
|
4425
|
+
});
|
|
4125
4426
|
// ERC-20 has no currency field; its symbol is the amount's unit label.
|
|
4126
4427
|
return {
|
|
4127
4428
|
currency: metadata.symbol,
|
|
@@ -4129,7 +4430,7 @@ function getActivityTokenMetadata(c, options) {
|
|
|
4129
4430
|
name: metadata.name,
|
|
4130
4431
|
symbol: metadata.symbol,
|
|
4131
4432
|
};
|
|
4132
|
-
}, { key: `token:erc20:v1:${chainId}:${address}:metadata`, store: c.get('store'), ttl: Ttl.minutes(1) });
|
|
4433
|
+
}), { key: `token:erc20:v1:${chainId}:${address}:metadata`, store: c.get('store'), ttl: Ttl.minutes(1) });
|
|
4133
4434
|
}
|
|
4134
4435
|
/** Resolves core metadata into immutable items. Optional logo and verification sources are best-effort. */
|
|
4135
4436
|
async function enrichTokens(c, options) {
|
|
@@ -4139,16 +4440,20 @@ async function enrichTokens(c, options) {
|
|
|
4139
4440
|
collectTokens(item, addresses);
|
|
4140
4441
|
const includeLogoUri = include.includes('token.logoUri');
|
|
4141
4442
|
const includeVerified = include.includes('token.verified');
|
|
4142
|
-
const
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
]);
|
|
4150
|
-
return
|
|
4151
|
-
|
|
4443
|
+
const tokenAddresses = [...addresses];
|
|
4444
|
+
const resolved_promise = tokenAddresses.length > 0
|
|
4445
|
+
? Timing.time(c, 'tokens', async () => {
|
|
4446
|
+
const metadata_promise = Timing.sum(c, 'activity_token_metadata', () => Promise.all(tokenAddresses.map((address) => getActivityTokenMetadata(c, { address, chainId }))));
|
|
4447
|
+
const logoUris_promise = includeLogoUri
|
|
4448
|
+
? Timing.sum(c, 'activity_token_logos', () => Promise.all(tokenAddresses.map((address) => Tokens.getTokenLogo(c, { address, chainId }).catch(() => undefined))))
|
|
4449
|
+
: Promise.resolve(tokenAddresses.map(() => undefined));
|
|
4450
|
+
const [metadata, logoUris] = await Promise.all([metadata_promise, logoUris_promise]);
|
|
4451
|
+
return tokenAddresses.map((address, index) => ({
|
|
4452
|
+
address: address.toLowerCase(),
|
|
4453
|
+
logoUri: logoUris[index],
|
|
4454
|
+
metadata: metadata[index],
|
|
4455
|
+
}));
|
|
4456
|
+
})
|
|
4152
4457
|
: undefined;
|
|
4153
4458
|
// Curated data is needed only for requested valuation or token fields.
|
|
4154
4459
|
const snapshot_promise = addresses.size > 0 && (denomination !== undefined || includeLogoUri || includeVerified)
|