tapimo 0.13.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 +21383 -18056
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +301 -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 +2 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +3936 -1337
- 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 +1446 -0
- package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
- package/dist/admin/apps/earn-vaults.js +465 -8
- package/dist/admin/apps/earn-vaults.js.map +1 -1
- package/dist/admin/apps/organizations.d.ts +344 -3
- package/dist/admin/apps/organizations.d.ts.map +1 -1
- package/dist/admin/apps/organizations.js +288 -10
- 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 +16 -16
- 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 +40 -8
- package/dist/apps/Zones.js.map +1 -1
- package/dist/apps/data/App.d.ts +4310 -2548
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +86 -26
- 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 +94 -22
- 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 +1641 -352
- package/dist/apps/data/routes/earn.d.ts.map +1 -1
- package/dist/apps/data/routes/earn.js +1561 -120
- package/dist/apps/data/routes/earn.js.map +1 -1
- package/dist/apps/data/routes/exchanges.d.ts +15 -0
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
- package/dist/apps/data/routes/exchanges.js +180 -114
- package/dist/apps/data/routes/exchanges.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 +49 -38
- 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 +95 -93
- 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 +16 -0
- 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/verified-tokens.d.ts +4 -4
- 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 +1210 -70
- package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/data/routes/webhooks.js +301 -163
- 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 +4119 -3297
- 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 +49 -8
- package/dist/apps/management/Billing.d.ts.map +1 -1
- package/dist/apps/management/Billing.js +221 -26
- package/dist/apps/management/Billing.js.map +1 -1
- package/dist/apps/management/routes/api-keys.d.ts +174 -72
- 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 +364 -78
- 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 +99 -24
- 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 +42 -42
- 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 +16 -16
- package/dist/apps/management/routes/orgs.d.ts +36 -20
- 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 +40 -40
- 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 +8 -8
- 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 +16 -16
- package/dist/apps/management/routes/webhooks.d.ts +931 -215
- package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/management/routes/webhooks.js +71 -25
- 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 +177 -26
- 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 +232 -25
- 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 +841 -136
- package/dist/apps/{funding → routes}/App.d.ts.map +1 -1
- package/dist/apps/{funding → routes}/App.js +17 -17
- 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 +123 -59
- package/dist/apps/routes/routes/deposit-addresses.d.ts.map +1 -0
- package/dist/apps/{funding → routes}/routes/deposit-addresses.js +498 -223
- 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 +957 -71
- 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 +1052 -15
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +785 -133
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +590 -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 +51 -5
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +135 -47
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +27 -1
- package/dist/db/tables/projects.d.ts.map +1 -1
- package/dist/db/tables/projects.js +38 -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/routesTransferTransactions.js +86 -0
- 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 +112 -13
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
- package/dist/db/tables/sponsoredTransactions.js +241 -38
- 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 +22 -10
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
- package/dist/db/tables/webhookSubscriptions.js +50 -15
- 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 +31 -14
- 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 +46 -2068
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Viem.js +171 -11
- 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 -3
- 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 +9 -17
- 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 +350 -104
- package/dist/internal/routes/Provider.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/Provider.js +233 -97
- 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 +13 -15
- 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 +324 -34
- 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/routes/TransferReconciliation.d.ts +55 -0
- 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/routes/TransferWebhook.d.ts +21 -0
- package/dist/internal/routes/TransferWebhook.d.ts.map +1 -0
- package/dist/internal/routes/TransferWebhook.js +43 -0
- package/dist/internal/routes/TransferWebhook.js.map +1 -0
- package/dist/internal/{funding → routes}/index.d.ts +3 -0
- package/dist/internal/routes/index.d.ts.map +1 -0
- package/dist/internal/{funding → routes}/index.js +3 -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 +197 -122
- 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/routes/providers/stargate.d.ts +165 -0
- 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.d.ts.map +1 -1
- package/dist/internal/webhookDestinations/slack.js +22 -6
- 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 +335 -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 +611 -101
- package/src/Handler.ts +0 -1
- package/src/OpenApi.contract.test.ts +195 -0
- package/src/Scope.ts +17 -5
- package/src/Webhooks.ts +2 -2
- 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 +681 -7
- package/src/admin/apps/organizations.test.ts +342 -1
- package/src/admin/apps/organizations.ts +368 -8
- 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 +147 -3
- package/src/admin/ui/src/lib/organizations.ts +136 -0
- 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 +334 -2
- 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 +18 -3
- package/src/apps/Zones.ts +55 -8
- package/src/apps/composition.test.ts +68 -59
- package/src/apps/data/App.test.ts +154 -2
- package/src/apps/data/App.ts +102 -33
- 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 +1661 -29
- package/src/apps/data/routes/earn.ts +2314 -328
- package/src/apps/data/routes/exchanges.test.ts +752 -30
- package/src/apps/data/routes/exchanges.ts +954 -753
- package/src/apps/data/routes/fee-amm.test.ts +224 -0
- package/src/apps/data/routes/fee-amm.ts +208 -178
- 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 +659 -81
- package/src/apps/data/routes/webhooks.ts +1104 -817
- 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 +283 -34
- 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 +93 -38
- 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 +1024 -38
- package/src/apps/relay/App.ts +228 -32
- 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 +253 -29
- 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 +1362 -462
- package/src/apps/{funding → routes}/routes/deposit-addresses.ts +568 -248
- 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/routes/routes/transfers.test.ts +2876 -0
- 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 +1511 -34
- package/src/db/Schema.ts +744 -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 +725 -7
- package/src/db/tables/organizations.ts +182 -49
- package/src/db/tables/projects.test.ts +71 -0
- package/src/db/tables/projects.ts +59 -4
- 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/routesTransferTransactions.ts +158 -0
- package/src/db/tables/routesTransfers.test.ts +338 -0
- package/src/db/tables/routesTransfers.ts +662 -0
- package/src/db/tables/sponsoredTransactions.test.ts +563 -1
- package/src/db/tables/sponsoredTransactions.ts +386 -42
- 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 +103 -21
- 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 +37 -15
- package/src/internal/Email.ts +54 -0
- package/src/internal/Idempotency.test.ts +2 -2
- package/src/internal/Log.test-d.ts +10 -7
- package/src/internal/Log.test.ts +114 -16
- package/src/internal/Log.ts +55 -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 +249 -17
- package/src/internal/Webhooks.test.ts +125 -1
- 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 -8
- 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 +11 -22
- 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 +531 -185
- 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 +18 -22
- 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/routes/TransferWebhook.test.ts +128 -0
- package/src/internal/routes/TransferWebhook.ts +67 -0
- package/src/internal/{funding → routes}/index.test.ts +6 -3
- package/src/internal/{funding → routes}/index.ts +3 -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 +231 -136
- 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 +20 -5
- 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 -622
- 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 -15
- package/dist/db/tables/fundingTransferTransactions.d.ts.map +0 -1
- package/dist/db/tables/fundingTransferTransactions.js +0 -27
- package/dist/db/tables/fundingTransferTransactions.js.map +0 -1
- package/dist/db/tables/fundingTransfers.d.ts +0 -82
- package/dist/db/tables/fundingTransfers.d.ts.map +0 -1
- package/dist/db/tables/fundingTransfers.js +0 -89
- 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 -334
- package/dist/internal/funding/Transfer.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 +0 -38
- package/dist/internal/funding/providers/stargate.d.ts.map +0 -1
- package/dist/internal/funding/providers/stargate.js +0 -277
- 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 -78
- package/src/apps/funding/ProviderAttempts.ts +0 -26
- package/src/apps/funding/index.ts +0 -1
- package/src/apps/funding/routes/transfers.test.ts +0 -1638
- package/src/apps/funding/routes/transfers.ts +0 -721
- 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 -69
- package/src/db/tables/fundingTransferTransactions.ts +0 -37
- package/src/db/tables/fundingTransfers.test.ts +0 -89
- package/src/db/tables/fundingTransfers.ts +0 -153
- 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 -369
- package/src/internal/funding/Transfer.ts +0 -545
- package/src/internal/funding/providers/stargate.test.ts +0 -163
- package/src/internal/funding/providers/stargate.ts +0 -409
- /package/dist/apps/{funding → routes}/Inventory.d.ts +0 -0
- /package/src/internal/{funding → routes}/Route.test.ts +0 -0
|
@@ -0,0 +1,1615 @@
|
|
|
1
|
+
import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible'
|
|
2
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog'
|
|
3
|
+
import { Menu as BaseMenu } from '@base-ui/react/menu'
|
|
4
|
+
import { useInfiniteQuery, useQuery } from '@tanstack/react-query'
|
|
5
|
+
import { createFileRoute, Link, useNavigate } from '@tanstack/react-router'
|
|
6
|
+
import { type ReactNode, useCallback, useEffect, useRef, useState } from 'react'
|
|
7
|
+
import { Button, Input, Select, Tabs, Tag, useCopy } from 'regen-ui'
|
|
8
|
+
import {
|
|
9
|
+
ArrowLeftRight,
|
|
10
|
+
ArrowRight,
|
|
11
|
+
Check,
|
|
12
|
+
ChevronDown,
|
|
13
|
+
CircleDollarSign,
|
|
14
|
+
Copy as CopyIcon,
|
|
15
|
+
ExternalLink,
|
|
16
|
+
SlidersHorizontal,
|
|
17
|
+
WalletCards,
|
|
18
|
+
X,
|
|
19
|
+
} from 'lucide-react'
|
|
20
|
+
import { base, mainnet } from 'viem/chains'
|
|
21
|
+
import { tempo } from 'viem/tempo/chains'
|
|
22
|
+
|
|
23
|
+
import { Notice, Page } from '../components/Page.js'
|
|
24
|
+
import * as Routes from '../lib/routes.js'
|
|
25
|
+
|
|
26
|
+
type Resource = NonNullable<Routes.Search['resource']>
|
|
27
|
+
const transferStatuses = [
|
|
28
|
+
'awaiting-source',
|
|
29
|
+
'processing',
|
|
30
|
+
'refunding',
|
|
31
|
+
'completed',
|
|
32
|
+
'refunded',
|
|
33
|
+
'action-required',
|
|
34
|
+
'expired',
|
|
35
|
+
] as const satisfies readonly Routes.listTransfers.Item['status'][]
|
|
36
|
+
const defaultTransferStatuses = [
|
|
37
|
+
'processing',
|
|
38
|
+
'refunding',
|
|
39
|
+
'completed',
|
|
40
|
+
'refunded',
|
|
41
|
+
'action-required',
|
|
42
|
+
'expired',
|
|
43
|
+
] as const satisfies readonly Routes.listTransfers.Item['status'][]
|
|
44
|
+
const depositStatuses = [
|
|
45
|
+
'detected',
|
|
46
|
+
'bridging',
|
|
47
|
+
'settling',
|
|
48
|
+
'refunding',
|
|
49
|
+
'completed',
|
|
50
|
+
'refunded',
|
|
51
|
+
'action-required',
|
|
52
|
+
] as const satisfies readonly Routes.listDeposits.Item['status'][]
|
|
53
|
+
const depositAddressStatuses = [
|
|
54
|
+
'active',
|
|
55
|
+
'action-required',
|
|
56
|
+
'deactivated',
|
|
57
|
+
] as const satisfies readonly Routes.listDepositAddresses.Item['status'][]
|
|
58
|
+
type Explorer = { address: string; tx: string }
|
|
59
|
+
const explorers: Record<string, Explorer> = {
|
|
60
|
+
[`eip155:${base.id}`]: {
|
|
61
|
+
address: `${base.blockExplorers.default.url}/address`,
|
|
62
|
+
tx: `${base.blockExplorers.default.url}/tx`,
|
|
63
|
+
},
|
|
64
|
+
[`eip155:${mainnet.id}`]: {
|
|
65
|
+
address: `${mainnet.blockExplorers.default.url}/address`,
|
|
66
|
+
tx: `${mainnet.blockExplorers.default.url}/tx`,
|
|
67
|
+
},
|
|
68
|
+
[`eip155:${tempo.id}`]: {
|
|
69
|
+
address: `${tempo.blockExplorers.default.url}/address`,
|
|
70
|
+
tx: `${tempo.blockExplorers.default.url}/tx`,
|
|
71
|
+
},
|
|
72
|
+
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': {
|
|
73
|
+
address: 'https://solscan.io/account',
|
|
74
|
+
tx: 'https://solscan.io/tx',
|
|
75
|
+
},
|
|
76
|
+
'tron:0x2b6653dc': {
|
|
77
|
+
address: 'https://tronscan.org/address',
|
|
78
|
+
tx: 'https://tronscan.org/transaction',
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
const providerItems = [
|
|
82
|
+
{ label: 'Across', value: 'across' },
|
|
83
|
+
{ label: 'Relay', value: 'relay' },
|
|
84
|
+
{ label: 'Rhino', value: 'rhino' },
|
|
85
|
+
{ label: 'Squid', value: 'squid' },
|
|
86
|
+
{ label: 'Stargate', value: 'stargate' },
|
|
87
|
+
{ label: 'Symbiosis', value: 'symbiosis' },
|
|
88
|
+
] as const
|
|
89
|
+
|
|
90
|
+
export const Route = createFileRoute('/routes')({
|
|
91
|
+
validateSearch: Routes.schema.Search,
|
|
92
|
+
component: PageComponent,
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
function PageComponent() {
|
|
96
|
+
const navigate = useNavigate({ from: Route.fullPath })
|
|
97
|
+
const search = Route.useSearch()
|
|
98
|
+
const resource = search.resource ?? 'transfers'
|
|
99
|
+
const summary = useQuery(Routes.summary.options(summaryFilters(search)))
|
|
100
|
+
|
|
101
|
+
const applyFilters = useCallback(
|
|
102
|
+
(filters: Routes.Search) =>
|
|
103
|
+
void navigate({
|
|
104
|
+
replace: true,
|
|
105
|
+
search: { ...filters, resource, selected: undefined },
|
|
106
|
+
}),
|
|
107
|
+
[navigate, resource],
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
function selectResource(value: string) {
|
|
111
|
+
void navigate({
|
|
112
|
+
search: (current) => ({
|
|
113
|
+
...current,
|
|
114
|
+
depositAddressId: value === 'deposits' ? current.depositAddressId : undefined,
|
|
115
|
+
methods: value === 'transfers' ? current.methods : undefined,
|
|
116
|
+
resource: value as Resource,
|
|
117
|
+
selected: undefined,
|
|
118
|
+
statuses: undefined,
|
|
119
|
+
}),
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function select(id: string) {
|
|
124
|
+
void navigate({ search: (current) => ({ ...current, selected: id }) })
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function closeDetail() {
|
|
128
|
+
void navigate({ replace: true, search: (current) => ({ ...current, selected: undefined }) })
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function filterByWork(work: 'inProgress' | 'needsAttention') {
|
|
132
|
+
void navigate({
|
|
133
|
+
replace: true,
|
|
134
|
+
search: (current) => ({
|
|
135
|
+
...current,
|
|
136
|
+
inProgress: work === 'inProgress' && !current.inProgress ? 'true' : undefined,
|
|
137
|
+
needsAttention: work === 'needsAttention' && !current.needsAttention ? 'true' : undefined,
|
|
138
|
+
selected: undefined,
|
|
139
|
+
statuses: undefined,
|
|
140
|
+
}),
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<Page
|
|
146
|
+
title="Routes"
|
|
147
|
+
description="Inspect transfers, deposits, and reusable deposit addresses"
|
|
148
|
+
action={<Button render={<Link to="/routes/support" />}>Support matrix</Button>}
|
|
149
|
+
>
|
|
150
|
+
<SummaryCards
|
|
151
|
+
error={summary.error}
|
|
152
|
+
loading={summary.isPending}
|
|
153
|
+
onSelect={filterByWork}
|
|
154
|
+
selected={
|
|
155
|
+
search.inProgress ? 'inProgress' : search.needsAttention ? 'needsAttention' : null
|
|
156
|
+
}
|
|
157
|
+
summary={
|
|
158
|
+
resource === 'transfers'
|
|
159
|
+
? summary.data?.resources.transfers
|
|
160
|
+
: resource === 'deposits'
|
|
161
|
+
? summary.data?.resources.deposits
|
|
162
|
+
: summary.data?.resources.depositAddresses
|
|
163
|
+
}
|
|
164
|
+
/>
|
|
165
|
+
<div className="flex min-w-0 flex-col">
|
|
166
|
+
<Filters
|
|
167
|
+
onChange={applyFilters}
|
|
168
|
+
resource={resource}
|
|
169
|
+
search={search}
|
|
170
|
+
tabs={
|
|
171
|
+
<Tabs
|
|
172
|
+
active={resource}
|
|
173
|
+
className="min-w-max border-b-0"
|
|
174
|
+
onChange={selectResource}
|
|
175
|
+
tabs={[
|
|
176
|
+
{
|
|
177
|
+
icon: <ArrowLeftRight className="size-4" />,
|
|
178
|
+
id: 'transfers',
|
|
179
|
+
label: 'Transfers',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
icon: <CircleDollarSign className="size-4" />,
|
|
183
|
+
id: 'deposits',
|
|
184
|
+
label: 'Deposits',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
icon: <WalletCards className="size-4" />,
|
|
188
|
+
id: 'deposit-addresses',
|
|
189
|
+
label: 'Deposit addresses',
|
|
190
|
+
},
|
|
191
|
+
]}
|
|
192
|
+
/>
|
|
193
|
+
}
|
|
194
|
+
/>
|
|
195
|
+
{search.depositAddressId && resource === 'deposits' ? (
|
|
196
|
+
<div className="flex min-w-0 items-center justify-between gap-3 border-x border-b border-border bg-surface px-3 py-2 text-label-13">
|
|
197
|
+
<span className="min-w-0 truncate text-foreground-secondary">
|
|
198
|
+
Deposits for <code className="text-foreground">{search.depositAddressId}</code>
|
|
199
|
+
</span>
|
|
200
|
+
<Button
|
|
201
|
+
aria-label="Show all deposits"
|
|
202
|
+
onClick={() =>
|
|
203
|
+
void navigate({
|
|
204
|
+
replace: true,
|
|
205
|
+
search: (current) => ({ ...current, depositAddressId: undefined }),
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
size="small"
|
|
209
|
+
>
|
|
210
|
+
Clear
|
|
211
|
+
</Button>
|
|
212
|
+
</div>
|
|
213
|
+
) : null}
|
|
214
|
+
{resource === 'transfers' ? (
|
|
215
|
+
<TransferList onSelect={select} search={search} />
|
|
216
|
+
) : resource === 'deposits' ? (
|
|
217
|
+
<DepositList onSelect={select} search={search} />
|
|
218
|
+
) : (
|
|
219
|
+
<DepositAddressList onSelect={select} search={search} />
|
|
220
|
+
)}
|
|
221
|
+
</div>
|
|
222
|
+
{search.selected ? (
|
|
223
|
+
resource === 'transfers' ? (
|
|
224
|
+
<TransferDetail id={search.selected} onClose={closeDetail} />
|
|
225
|
+
) : resource === 'deposits' ? (
|
|
226
|
+
<DepositDetail id={search.selected} onClose={closeDetail} />
|
|
227
|
+
) : (
|
|
228
|
+
<DepositAddressDetail
|
|
229
|
+
id={search.selected}
|
|
230
|
+
onClose={closeDetail}
|
|
231
|
+
onViewDeposits={() =>
|
|
232
|
+
void navigate({
|
|
233
|
+
search: (current) => ({
|
|
234
|
+
...current,
|
|
235
|
+
depositAddressId: search.selected,
|
|
236
|
+
resource: 'deposits',
|
|
237
|
+
selected: undefined,
|
|
238
|
+
statuses: undefined,
|
|
239
|
+
}),
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
/>
|
|
243
|
+
)
|
|
244
|
+
) : null}
|
|
245
|
+
</Page>
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function SummaryCards(options: SummaryCards.Props) {
|
|
250
|
+
if (options.error)
|
|
251
|
+
return (
|
|
252
|
+
<div
|
|
253
|
+
className="border border-negative bg-negative-subtle px-4 py-3 text-copy-14 text-negative"
|
|
254
|
+
role="alert"
|
|
255
|
+
>
|
|
256
|
+
{options.error.message}
|
|
257
|
+
</div>
|
|
258
|
+
)
|
|
259
|
+
return (
|
|
260
|
+
<div className="grid divide-y divide-border border border-border sm:grid-cols-2 sm:divide-x sm:divide-y-0">
|
|
261
|
+
<SummaryCard
|
|
262
|
+
label="In progress"
|
|
263
|
+
loading={options.loading}
|
|
264
|
+
onClick={() => options.onSelect('inProgress')}
|
|
265
|
+
selected={options.selected === 'inProgress'}
|
|
266
|
+
>
|
|
267
|
+
{options.summary?.inProgress.toLocaleString() ?? '0'}
|
|
268
|
+
</SummaryCard>
|
|
269
|
+
<SummaryCard
|
|
270
|
+
label="Needs attention"
|
|
271
|
+
loading={options.loading}
|
|
272
|
+
onClick={() => options.onSelect('needsAttention')}
|
|
273
|
+
selected={options.selected === 'needsAttention'}
|
|
274
|
+
tone="negative"
|
|
275
|
+
>
|
|
276
|
+
{options.summary?.actionRequired.toLocaleString() ?? '0'}
|
|
277
|
+
</SummaryCard>
|
|
278
|
+
</div>
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare namespace SummaryCards {
|
|
283
|
+
type Props = {
|
|
284
|
+
error: Error | null
|
|
285
|
+
loading: boolean
|
|
286
|
+
onSelect: (work: 'inProgress' | 'needsAttention') => void
|
|
287
|
+
selected: 'inProgress' | 'needsAttention' | null
|
|
288
|
+
summary: Routes.summary.Data['resources'][keyof Routes.summary.Data['resources']] | undefined
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function SummaryCard(options: SummaryCard.Props) {
|
|
293
|
+
return (
|
|
294
|
+
<button
|
|
295
|
+
aria-pressed={options.selected}
|
|
296
|
+
className="flex min-h-24 min-w-0 cursor-pointer flex-col justify-between gap-3 bg-surface p-4 text-left transition-colors hover:bg-surface-hover focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus aria-pressed:bg-secondary"
|
|
297
|
+
onClick={options.onClick}
|
|
298
|
+
type="button"
|
|
299
|
+
>
|
|
300
|
+
<span className="text-label-12 text-foreground-secondary">{options.label}</span>
|
|
301
|
+
<span
|
|
302
|
+
className={
|
|
303
|
+
options.tone === 'negative'
|
|
304
|
+
? 'truncate text-heading-24 text-negative'
|
|
305
|
+
: 'truncate text-heading-24 text-foreground'
|
|
306
|
+
}
|
|
307
|
+
>
|
|
308
|
+
{options.loading ? '—' : options.children}
|
|
309
|
+
</span>
|
|
310
|
+
</button>
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
declare namespace SummaryCard {
|
|
315
|
+
type Props = {
|
|
316
|
+
children: ReactNode
|
|
317
|
+
label: string
|
|
318
|
+
loading: boolean
|
|
319
|
+
onClick: () => void
|
|
320
|
+
selected: boolean
|
|
321
|
+
tone?: 'negative' | undefined
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function Filters(options: Filters.Props) {
|
|
326
|
+
const [draft, setDraft] = useState<Routes.Search>(options.search)
|
|
327
|
+
const timeout = useRef<ReturnType<typeof setTimeout>>(undefined)
|
|
328
|
+
const statuses = statusItems(options.resource)
|
|
329
|
+
const count = Object.values(filterSearch(options.search, options.resource)).filter(Boolean).length
|
|
330
|
+
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
if (timeout.current) clearTimeout(timeout.current)
|
|
333
|
+
setDraft(options.search)
|
|
334
|
+
}, [options.search])
|
|
335
|
+
useEffect(
|
|
336
|
+
() => () => {
|
|
337
|
+
if (timeout.current) clearTimeout(timeout.current)
|
|
338
|
+
},
|
|
339
|
+
[],
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
function update(next: Routes.Search) {
|
|
343
|
+
setDraft(next)
|
|
344
|
+
if (timeout.current) clearTimeout(timeout.current)
|
|
345
|
+
timeout.current = setTimeout(() => options.onChange(filterSearch(next, options.resource)), 300)
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return (
|
|
349
|
+
<BaseCollapsible.Root className="min-w-0">
|
|
350
|
+
<div className="flex min-w-0 items-stretch border-b border-border">
|
|
351
|
+
<div className="min-w-0 flex-1 overflow-x-auto overflow-y-hidden">{options.tabs}</div>
|
|
352
|
+
<BaseCollapsible.Trigger className="group flex shrink-0 cursor-pointer items-center gap-2 px-3 text-label-13 text-foreground-secondary hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus data-[panel-open]:text-foreground">
|
|
353
|
+
<SlidersHorizontal className="size-4 text-foreground-secondary" />
|
|
354
|
+
<span>Filters</span>
|
|
355
|
+
{count ? <Tag>{count} active</Tag> : null}
|
|
356
|
+
<ChevronDown className="size-4 text-foreground-secondary transition-transform group-data-[panel-open]:rotate-180" />
|
|
357
|
+
</BaseCollapsible.Trigger>
|
|
358
|
+
</div>
|
|
359
|
+
<BaseCollapsible.Panel>
|
|
360
|
+
<div className="flex flex-col gap-3 border-b border-border p-4">
|
|
361
|
+
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
|
362
|
+
<label className="flex min-w-0 flex-col gap-1.5 lg:col-span-2">
|
|
363
|
+
<span className="text-label-12 text-foreground-secondary">Search</span>
|
|
364
|
+
<Input
|
|
365
|
+
aria-label="Search routes"
|
|
366
|
+
onChange={(event) => update({ ...draft, query: event.target.value })}
|
|
367
|
+
placeholder="Resource id, address, or transaction"
|
|
368
|
+
value={draft.query ?? ''}
|
|
369
|
+
/>
|
|
370
|
+
</label>
|
|
371
|
+
<FilterMenu
|
|
372
|
+
empty="All environments"
|
|
373
|
+
label="Environment"
|
|
374
|
+
onChange={(environments) =>
|
|
375
|
+
update({
|
|
376
|
+
...draft,
|
|
377
|
+
environments: environments as Routes.Search['environments'],
|
|
378
|
+
})
|
|
379
|
+
}
|
|
380
|
+
items={[
|
|
381
|
+
{ label: 'Production', value: 'production' },
|
|
382
|
+
{ label: 'Sandbox', value: 'sandbox' },
|
|
383
|
+
]}
|
|
384
|
+
value={draft.environments ?? []}
|
|
385
|
+
/>
|
|
386
|
+
<FilterMenu
|
|
387
|
+
empty={options.resource === 'transfers' ? 'Default statuses' : 'All statuses'}
|
|
388
|
+
label="Status"
|
|
389
|
+
onChange={(statuses) =>
|
|
390
|
+
update({
|
|
391
|
+
...draft,
|
|
392
|
+
inProgress: undefined,
|
|
393
|
+
needsAttention: undefined,
|
|
394
|
+
statuses: statuses as Routes.Search['statuses'],
|
|
395
|
+
})
|
|
396
|
+
}
|
|
397
|
+
items={statuses}
|
|
398
|
+
value={draft.statuses ?? []}
|
|
399
|
+
/>
|
|
400
|
+
<FilterMenu
|
|
401
|
+
empty="All providers"
|
|
402
|
+
label="Provider"
|
|
403
|
+
onChange={(providers) => update({ ...draft, providers })}
|
|
404
|
+
items={providerItems}
|
|
405
|
+
value={draft.providers ?? []}
|
|
406
|
+
/>
|
|
407
|
+
<FilterMenu
|
|
408
|
+
empty="All source chains"
|
|
409
|
+
label="Source chain"
|
|
410
|
+
onChange={(sourceChains) => update({ ...draft, sourceChains })}
|
|
411
|
+
items={[
|
|
412
|
+
{ label: 'Ethereum', value: `eip155:${mainnet.id}` },
|
|
413
|
+
{ label: 'Base', value: `eip155:${base.id}` },
|
|
414
|
+
{ label: 'Tempo', value: `eip155:${tempo.id}` },
|
|
415
|
+
]}
|
|
416
|
+
value={draft.sourceChains ?? []}
|
|
417
|
+
/>
|
|
418
|
+
<label className="flex min-w-0 flex-col gap-1.5">
|
|
419
|
+
<span className="text-label-12 text-foreground-secondary">Organization ID</span>
|
|
420
|
+
<Input
|
|
421
|
+
aria-label="Organization ID"
|
|
422
|
+
onChange={(event) => update({ ...draft, orgId: event.target.value })}
|
|
423
|
+
placeholder="org_…"
|
|
424
|
+
value={draft.orgId ?? ''}
|
|
425
|
+
/>
|
|
426
|
+
</label>
|
|
427
|
+
<label className="flex min-w-0 flex-col gap-1.5">
|
|
428
|
+
<span className="text-label-12 text-foreground-secondary">Project ID</span>
|
|
429
|
+
<Input
|
|
430
|
+
aria-label="Project ID"
|
|
431
|
+
onChange={(event) => update({ ...draft, projectId: event.target.value })}
|
|
432
|
+
placeholder="prj_…"
|
|
433
|
+
value={draft.projectId ?? ''}
|
|
434
|
+
/>
|
|
435
|
+
</label>
|
|
436
|
+
<FilterSelect
|
|
437
|
+
label="Work"
|
|
438
|
+
onChange={(work) =>
|
|
439
|
+
update({
|
|
440
|
+
...draft,
|
|
441
|
+
inProgress: work === 'inProgress' ? 'true' : undefined,
|
|
442
|
+
needsAttention: work === 'needsAttention' ? 'true' : undefined,
|
|
443
|
+
statuses: undefined,
|
|
444
|
+
})
|
|
445
|
+
}
|
|
446
|
+
items={[
|
|
447
|
+
{ label: 'All work', value: '' },
|
|
448
|
+
{ label: 'In progress', value: 'inProgress' },
|
|
449
|
+
{ label: 'Needs attention', value: 'needsAttention' },
|
|
450
|
+
]}
|
|
451
|
+
value={draft.inProgress ? 'inProgress' : draft.needsAttention ? 'needsAttention' : ''}
|
|
452
|
+
/>
|
|
453
|
+
{options.resource === 'transfers' ? (
|
|
454
|
+
<FilterMenu
|
|
455
|
+
empty="All methods"
|
|
456
|
+
label="Method"
|
|
457
|
+
onChange={(methods) =>
|
|
458
|
+
update({ ...draft, methods: methods as Routes.Search['methods'] })
|
|
459
|
+
}
|
|
460
|
+
items={[
|
|
461
|
+
{ label: 'Wallet transaction', value: 'transaction' },
|
|
462
|
+
{ label: 'Deposit address', value: 'depositAddress' },
|
|
463
|
+
]}
|
|
464
|
+
value={draft.methods ?? []}
|
|
465
|
+
/>
|
|
466
|
+
) : null}
|
|
467
|
+
<div className="flex items-end justify-end lg:col-start-4">
|
|
468
|
+
<Button onClick={() => update({})} type="button">
|
|
469
|
+
Clear filters
|
|
470
|
+
</Button>
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
</BaseCollapsible.Panel>
|
|
475
|
+
</BaseCollapsible.Root>
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare namespace Filters {
|
|
480
|
+
type Props = {
|
|
481
|
+
onChange: (search: Routes.Search) => void
|
|
482
|
+
resource: Resource
|
|
483
|
+
search: Routes.Search
|
|
484
|
+
tabs: ReactNode
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function FilterMenu(options: FilterMenu.Props) {
|
|
489
|
+
const selected = options.items.filter((item) => options.value.includes(item.value))
|
|
490
|
+
const value =
|
|
491
|
+
selected.length === 0
|
|
492
|
+
? options.empty
|
|
493
|
+
: selected.length === 1
|
|
494
|
+
? selected[0]!.label
|
|
495
|
+
: `${selected.length} selected`
|
|
496
|
+
return (
|
|
497
|
+
<div className="flex min-w-0 flex-col gap-1.5">
|
|
498
|
+
<span className="text-label-12 text-foreground-secondary">{options.label}</span>
|
|
499
|
+
<BaseMenu.Root>
|
|
500
|
+
<BaseMenu.Trigger
|
|
501
|
+
aria-label={options.label}
|
|
502
|
+
className="flex h-10 w-full cursor-pointer items-center gap-2 border-2 border-transparent bg-secondary px-3 text-copy-14 text-foreground outline-none hover:bg-secondary-hover active:bg-secondary-active focus-visible:border-focus focus-visible:bg-secondary-hover"
|
|
503
|
+
>
|
|
504
|
+
<span className="min-w-0 flex-1 truncate text-left">{value}</span>
|
|
505
|
+
<ChevronDown className="size-4 shrink-0 text-foreground-secondary" />
|
|
506
|
+
</BaseMenu.Trigger>
|
|
507
|
+
<BaseMenu.Portal>
|
|
508
|
+
<BaseMenu.Positioner align="start" className="z-50 outline-none" sideOffset={4}>
|
|
509
|
+
<BaseMenu.Popup className="max-h-72 min-w-[var(--anchor-width)] overflow-auto border border-border bg-surface py-1 shadow-lg outline-none">
|
|
510
|
+
{options.items.map((item) => (
|
|
511
|
+
<BaseMenu.CheckboxItem
|
|
512
|
+
checked={options.value.includes(item.value)}
|
|
513
|
+
className="flex cursor-pointer items-center gap-2 px-3 py-2 text-label-14 text-foreground outline-none data-[highlighted]:bg-secondary-hover"
|
|
514
|
+
closeOnClick={false}
|
|
515
|
+
key={item.value}
|
|
516
|
+
label={item.label}
|
|
517
|
+
onCheckedChange={(checked) =>
|
|
518
|
+
options.onChange(
|
|
519
|
+
checked
|
|
520
|
+
? [...options.value, item.value]
|
|
521
|
+
: options.value.filter((value) => value !== item.value),
|
|
522
|
+
)
|
|
523
|
+
}
|
|
524
|
+
>
|
|
525
|
+
<span className="grid size-4 shrink-0 place-items-center border border-border">
|
|
526
|
+
<BaseMenu.CheckboxItemIndicator>
|
|
527
|
+
<Check className="size-3" />
|
|
528
|
+
</BaseMenu.CheckboxItemIndicator>
|
|
529
|
+
</span>
|
|
530
|
+
{item.label}
|
|
531
|
+
</BaseMenu.CheckboxItem>
|
|
532
|
+
))}
|
|
533
|
+
</BaseMenu.Popup>
|
|
534
|
+
</BaseMenu.Positioner>
|
|
535
|
+
</BaseMenu.Portal>
|
|
536
|
+
</BaseMenu.Root>
|
|
537
|
+
</div>
|
|
538
|
+
)
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
declare namespace FilterMenu {
|
|
542
|
+
type Props = {
|
|
543
|
+
empty: string
|
|
544
|
+
items: readonly { label: string; value: string }[]
|
|
545
|
+
label: string
|
|
546
|
+
onChange: (value: readonly string[]) => void
|
|
547
|
+
value: readonly string[]
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function FilterSelect(options: FilterSelect.Props) {
|
|
552
|
+
return (
|
|
553
|
+
<label className="flex min-w-0 flex-col gap-1.5">
|
|
554
|
+
<span className="text-label-12 text-foreground-secondary">{options.label}</span>
|
|
555
|
+
<Select
|
|
556
|
+
aria-label={options.label}
|
|
557
|
+
className="w-full"
|
|
558
|
+
items={options.items}
|
|
559
|
+
onChange={options.onChange}
|
|
560
|
+
value={options.value}
|
|
561
|
+
/>
|
|
562
|
+
</label>
|
|
563
|
+
)
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare namespace FilterSelect {
|
|
567
|
+
type Props = {
|
|
568
|
+
items: readonly { label: string; value: string }[]
|
|
569
|
+
label: string
|
|
570
|
+
onChange: (value: string) => void
|
|
571
|
+
value: string
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function TransferList(options: ResourceList.Props) {
|
|
576
|
+
const selectedStatuses = transferStatuses.filter((status) =>
|
|
577
|
+
options.search.statuses?.includes(status),
|
|
578
|
+
)
|
|
579
|
+
const statuses =
|
|
580
|
+
selectedStatuses.length > 0
|
|
581
|
+
? selectedStatuses
|
|
582
|
+
: options.search.inProgress || options.search.needsAttention
|
|
583
|
+
? undefined
|
|
584
|
+
: defaultTransferStatuses
|
|
585
|
+
const query = useInfiniteQuery(
|
|
586
|
+
Routes.listTransfers.options({
|
|
587
|
+
...commonFilters(options.search, 'transfers'),
|
|
588
|
+
query: options.search.query,
|
|
589
|
+
statuses,
|
|
590
|
+
}),
|
|
591
|
+
)
|
|
592
|
+
const records = query.data?.pages.flatMap((page) => page.data) ?? []
|
|
593
|
+
return (
|
|
594
|
+
<ResourceList
|
|
595
|
+
empty="No route transfers match these filters."
|
|
596
|
+
error={query.error}
|
|
597
|
+
hasNextPage={query.hasNextPage}
|
|
598
|
+
loading={query.isPending}
|
|
599
|
+
loadingMore={query.isFetchingNextPage}
|
|
600
|
+
onLoadMore={() => query.fetchNextPage()}
|
|
601
|
+
>
|
|
602
|
+
{records.length ? (
|
|
603
|
+
<table className="w-full min-w-[720px] border-collapse text-left">
|
|
604
|
+
<TableHead
|
|
605
|
+
columns={['Status', 'Route', 'Source amount', 'Provider', 'Organization', 'Updated']}
|
|
606
|
+
/>
|
|
607
|
+
<tbody>
|
|
608
|
+
{records.map((record) => (
|
|
609
|
+
<ResourceRow id={record.id} key={record.id} onSelect={options.onSelect}>
|
|
610
|
+
<StatusCell status={record.status} />
|
|
611
|
+
<RouteCell record={record} />
|
|
612
|
+
<td className="px-3 py-3 text-label-13 text-foreground">
|
|
613
|
+
{amountLabel(record.sourceAmount, record.sourceToken.symbol)}
|
|
614
|
+
</td>
|
|
615
|
+
<td className="px-3 py-3 text-label-13 text-foreground-secondary">
|
|
616
|
+
{record.provider.name}
|
|
617
|
+
</td>
|
|
618
|
+
<AttributionCell organization={record.organization} project={record.project} />
|
|
619
|
+
<td className="whitespace-nowrap px-3 py-3 text-label-12 text-foreground-secondary">
|
|
620
|
+
<time dateTime={record.updatedAt} title={dateTime(record.updatedAt)}>
|
|
621
|
+
{age(record.updatedAt)}
|
|
622
|
+
</time>
|
|
623
|
+
</td>
|
|
624
|
+
</ResourceRow>
|
|
625
|
+
))}
|
|
626
|
+
</tbody>
|
|
627
|
+
</table>
|
|
628
|
+
) : undefined}
|
|
629
|
+
</ResourceList>
|
|
630
|
+
)
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function DepositList(options: ResourceList.Props) {
|
|
634
|
+
const statuses = depositStatuses.filter((status) => options.search.statuses?.includes(status))
|
|
635
|
+
const query = useInfiniteQuery(
|
|
636
|
+
Routes.listDeposits.options({
|
|
637
|
+
...commonFilters(options.search, 'deposits'),
|
|
638
|
+
depositAddressId: options.search.depositAddressId,
|
|
639
|
+
query: options.search.query,
|
|
640
|
+
statuses: statuses.length ? statuses : undefined,
|
|
641
|
+
}),
|
|
642
|
+
)
|
|
643
|
+
const records = query.data?.pages.flatMap((page) => page.data) ?? []
|
|
644
|
+
return (
|
|
645
|
+
<ResourceList
|
|
646
|
+
empty="No route deposits match these filters."
|
|
647
|
+
error={query.error}
|
|
648
|
+
hasNextPage={query.hasNextPage}
|
|
649
|
+
loading={query.isPending}
|
|
650
|
+
loadingMore={query.isFetchingNextPage}
|
|
651
|
+
onLoadMore={() => query.fetchNextPage()}
|
|
652
|
+
>
|
|
653
|
+
{records.length ? (
|
|
654
|
+
<table className="w-full min-w-[720px] border-collapse text-left">
|
|
655
|
+
<TableHead
|
|
656
|
+
columns={['Status', 'Route', 'Source amount', 'Provider', 'Organization', 'Updated']}
|
|
657
|
+
/>
|
|
658
|
+
<tbody>
|
|
659
|
+
{records.map((record) => (
|
|
660
|
+
<ResourceRow id={record.id} key={record.id} onSelect={options.onSelect}>
|
|
661
|
+
<StatusCell status={record.status} />
|
|
662
|
+
<RouteCell record={record} />
|
|
663
|
+
<td className="px-3 py-3 text-label-13 text-foreground">
|
|
664
|
+
{record.sourceAmount
|
|
665
|
+
? amountLabel(record.sourceAmount, record.sourceToken.symbol)
|
|
666
|
+
: 'Pending'}
|
|
667
|
+
</td>
|
|
668
|
+
<td className="px-3 py-3 text-label-13 text-foreground-secondary">
|
|
669
|
+
{record.provider.name}
|
|
670
|
+
</td>
|
|
671
|
+
<AttributionCell organization={record.organization} project={record.project} />
|
|
672
|
+
<td className="whitespace-nowrap px-3 py-3 text-label-12 text-foreground-secondary">
|
|
673
|
+
<time dateTime={record.updatedAt} title={dateTime(record.updatedAt)}>
|
|
674
|
+
{age(record.updatedAt)}
|
|
675
|
+
</time>
|
|
676
|
+
</td>
|
|
677
|
+
</ResourceRow>
|
|
678
|
+
))}
|
|
679
|
+
</tbody>
|
|
680
|
+
</table>
|
|
681
|
+
) : undefined}
|
|
682
|
+
</ResourceList>
|
|
683
|
+
)
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function DepositAddressList(options: ResourceList.Props) {
|
|
687
|
+
const statuses = depositAddressStatuses.filter((status) =>
|
|
688
|
+
options.search.statuses?.includes(status),
|
|
689
|
+
)
|
|
690
|
+
const query = useInfiniteQuery(
|
|
691
|
+
Routes.listDepositAddresses.options({
|
|
692
|
+
...commonFilters(options.search, 'deposit-addresses'),
|
|
693
|
+
query: options.search.query,
|
|
694
|
+
statuses: statuses.length ? statuses : undefined,
|
|
695
|
+
}),
|
|
696
|
+
)
|
|
697
|
+
const records = query.data?.pages.flatMap((page) => page.data) ?? []
|
|
698
|
+
return (
|
|
699
|
+
<ResourceList
|
|
700
|
+
empty="No route deposit addresses match these filters."
|
|
701
|
+
error={query.error}
|
|
702
|
+
hasNextPage={query.hasNextPage}
|
|
703
|
+
loading={query.isPending}
|
|
704
|
+
loadingMore={query.isFetchingNextPage}
|
|
705
|
+
onLoadMore={() => query.fetchNextPage()}
|
|
706
|
+
>
|
|
707
|
+
{records.length ? (
|
|
708
|
+
<table className="w-full min-w-[820px] border-collapse text-left">
|
|
709
|
+
<TableHead
|
|
710
|
+
columns={[
|
|
711
|
+
'Status',
|
|
712
|
+
'Deposit address',
|
|
713
|
+
'Route',
|
|
714
|
+
'Provider',
|
|
715
|
+
'Polling',
|
|
716
|
+
'Organization',
|
|
717
|
+
'Updated',
|
|
718
|
+
]}
|
|
719
|
+
/>
|
|
720
|
+
<tbody>
|
|
721
|
+
{records.map((record) => (
|
|
722
|
+
<ResourceRow id={record.id} key={record.id} onSelect={options.onSelect}>
|
|
723
|
+
<StatusCell status={record.status} />
|
|
724
|
+
<td className="px-3 py-3">
|
|
725
|
+
<CopyAddress value={record.address} />
|
|
726
|
+
</td>
|
|
727
|
+
<RouteCell record={record} />
|
|
728
|
+
<td className="px-3 py-3 text-label-13 text-foreground-secondary">
|
|
729
|
+
{record.provider.name}
|
|
730
|
+
</td>
|
|
731
|
+
<td className="whitespace-nowrap px-3 py-3 text-label-12 text-foreground-secondary">
|
|
732
|
+
{record.consecutivePollFailures
|
|
733
|
+
? `${record.consecutivePollFailures} failed checks`
|
|
734
|
+
: `Next ${age(record.nextPollAt)}`}
|
|
735
|
+
</td>
|
|
736
|
+
<AttributionCell organization={record.organization} project={record.project} />
|
|
737
|
+
<td className="whitespace-nowrap px-3 py-3 text-label-12 text-foreground-secondary">
|
|
738
|
+
<time dateTime={record.updatedAt} title={dateTime(record.updatedAt)}>
|
|
739
|
+
{age(record.updatedAt)}
|
|
740
|
+
</time>
|
|
741
|
+
</td>
|
|
742
|
+
</ResourceRow>
|
|
743
|
+
))}
|
|
744
|
+
</tbody>
|
|
745
|
+
</table>
|
|
746
|
+
) : undefined}
|
|
747
|
+
</ResourceList>
|
|
748
|
+
)
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
function ResourceList(options: ResourceList.ContainerProps) {
|
|
752
|
+
if (options.loading) return <Notice>Loading routes records…</Notice>
|
|
753
|
+
if (options.error)
|
|
754
|
+
return (
|
|
755
|
+
<div
|
|
756
|
+
className="flex items-center justify-center gap-3 border-y border-border px-4 py-12 text-copy-14 text-negative"
|
|
757
|
+
role="alert"
|
|
758
|
+
>
|
|
759
|
+
{options.error.message}
|
|
760
|
+
</div>
|
|
761
|
+
)
|
|
762
|
+
return (
|
|
763
|
+
<div className="flex flex-col gap-4">
|
|
764
|
+
<div className="overflow-x-auto border-b border-border">
|
|
765
|
+
{options.children ?? <Notice>{options.empty}</Notice>}
|
|
766
|
+
</div>
|
|
767
|
+
{options.hasNextPage ? (
|
|
768
|
+
<Button className="self-center" loading={options.loadingMore} onClick={options.onLoadMore}>
|
|
769
|
+
Load more
|
|
770
|
+
</Button>
|
|
771
|
+
) : null}
|
|
772
|
+
</div>
|
|
773
|
+
)
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
declare namespace ResourceList {
|
|
777
|
+
type Props = {
|
|
778
|
+
onSelect: (id: string) => void
|
|
779
|
+
search: Routes.Search
|
|
780
|
+
}
|
|
781
|
+
type ContainerProps = {
|
|
782
|
+
children?: ReactNode | undefined
|
|
783
|
+
empty: string
|
|
784
|
+
error: Error | null
|
|
785
|
+
hasNextPage: boolean
|
|
786
|
+
loading: boolean
|
|
787
|
+
loadingMore: boolean
|
|
788
|
+
onLoadMore: () => unknown
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function TableHead(options: TableHead.Props) {
|
|
793
|
+
return (
|
|
794
|
+
<thead>
|
|
795
|
+
<tr className="border-b border-border">
|
|
796
|
+
{options.columns.map((column) => (
|
|
797
|
+
<th
|
|
798
|
+
className="whitespace-nowrap px-3 py-2 text-label-12 font-normal text-foreground-secondary"
|
|
799
|
+
key={column}
|
|
800
|
+
scope="col"
|
|
801
|
+
>
|
|
802
|
+
{column}
|
|
803
|
+
</th>
|
|
804
|
+
))}
|
|
805
|
+
</tr>
|
|
806
|
+
</thead>
|
|
807
|
+
)
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
declare namespace TableHead {
|
|
811
|
+
type Props = { columns: readonly string[] }
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
function ResourceRow(options: ResourceRow.Props) {
|
|
815
|
+
return (
|
|
816
|
+
<tr
|
|
817
|
+
aria-label={`View ${options.id}`}
|
|
818
|
+
className="cursor-pointer border-b border-border transition-colors last:border-b-0 hover:bg-surface-hover focus-visible:bg-surface-hover focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus"
|
|
819
|
+
onClick={() => options.onSelect(options.id)}
|
|
820
|
+
onKeyDown={(event) => {
|
|
821
|
+
if (event.currentTarget !== event.target || !['Enter', ' '].includes(event.key)) return
|
|
822
|
+
event.preventDefault()
|
|
823
|
+
options.onSelect(options.id)
|
|
824
|
+
}}
|
|
825
|
+
tabIndex={0}
|
|
826
|
+
>
|
|
827
|
+
{options.children}
|
|
828
|
+
</tr>
|
|
829
|
+
)
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
declare namespace ResourceRow {
|
|
833
|
+
type Props = {
|
|
834
|
+
children: ReactNode
|
|
835
|
+
id: string
|
|
836
|
+
onSelect: (id: string) => void
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function CopyAddress(options: CopyAddress.Props) {
|
|
841
|
+
return (
|
|
842
|
+
<span
|
|
843
|
+
className="flex max-w-44 items-center gap-1.5 font-mono text-label-12 text-foreground-secondary"
|
|
844
|
+
title={options.value}
|
|
845
|
+
>
|
|
846
|
+
<span className="truncate">{truncate(options.value)}</span>
|
|
847
|
+
<CopyButton value={options.value} />
|
|
848
|
+
</span>
|
|
849
|
+
)
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
declare namespace CopyAddress {
|
|
853
|
+
type Props = { value: string }
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function CopyButton(options: CopyButton.Props) {
|
|
857
|
+
const { copy, notifying } = useCopy()
|
|
858
|
+
return (
|
|
859
|
+
<button
|
|
860
|
+
aria-label={`Copy ${options.value}`}
|
|
861
|
+
className="shrink-0 cursor-pointer text-foreground-secondary hover:text-foreground"
|
|
862
|
+
onClick={(event) => {
|
|
863
|
+
event.stopPropagation()
|
|
864
|
+
void copy(options.value)
|
|
865
|
+
}}
|
|
866
|
+
title="Copy address"
|
|
867
|
+
type="button"
|
|
868
|
+
>
|
|
869
|
+
{notifying ? <Check className="size-3 shrink-0" /> : <CopyIcon className="size-3 shrink-0" />}
|
|
870
|
+
</button>
|
|
871
|
+
)
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
declare namespace CopyButton {
|
|
875
|
+
type Props = { value: string }
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
function StatusCell(options: StatusCell.Props) {
|
|
879
|
+
return (
|
|
880
|
+
<td className="px-3 py-3">
|
|
881
|
+
<StatusBadge status={options.status} />
|
|
882
|
+
</td>
|
|
883
|
+
)
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
declare namespace StatusCell {
|
|
887
|
+
type Props = { status: string }
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function RouteCell(options: RouteCell.Props) {
|
|
891
|
+
const { destinationChain, destinationToken, sourceChain, sourceToken } = options.record
|
|
892
|
+
return (
|
|
893
|
+
<td className="px-3 py-3">
|
|
894
|
+
<span className="flex items-center gap-1.5 whitespace-nowrap">
|
|
895
|
+
<Tag>{sourceChain.name}</Tag>
|
|
896
|
+
<Tag>{sourceToken.symbol}</Tag>
|
|
897
|
+
<ArrowRight className="mx-0.5 size-3.5 shrink-0 text-foreground-secondary" />
|
|
898
|
+
<Tag>{destinationChain.name}</Tag>
|
|
899
|
+
<Tag>{destinationToken.symbol}</Tag>
|
|
900
|
+
</span>
|
|
901
|
+
</td>
|
|
902
|
+
)
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
declare namespace RouteCell {
|
|
906
|
+
type Props = {
|
|
907
|
+
record: Pick<
|
|
908
|
+
Routes.listTransfers.Item,
|
|
909
|
+
'destinationChain' | 'destinationToken' | 'sourceChain' | 'sourceToken'
|
|
910
|
+
>
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function AttributionCell(options: AttributionCell.Props) {
|
|
915
|
+
return (
|
|
916
|
+
<td className="px-3 py-3">
|
|
917
|
+
<span className="flex min-w-32 flex-col gap-0.5">
|
|
918
|
+
<Link
|
|
919
|
+
className="truncate text-label-13 text-foreground hover:underline"
|
|
920
|
+
onClick={(event) => event.stopPropagation()}
|
|
921
|
+
params={{ orgId: options.organization.id }}
|
|
922
|
+
search={{}}
|
|
923
|
+
to="/organizations/$orgId"
|
|
924
|
+
>
|
|
925
|
+
{options.organization.name ?? options.organization.id}
|
|
926
|
+
</Link>
|
|
927
|
+
{options.project ? (
|
|
928
|
+
<span className="truncate text-label-12 text-foreground-secondary">
|
|
929
|
+
{options.project.name ?? options.project.id}
|
|
930
|
+
</span>
|
|
931
|
+
) : null}
|
|
932
|
+
</span>
|
|
933
|
+
</td>
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
declare namespace AttributionCell {
|
|
938
|
+
type Props = Pick<Routes.listTransfers.Item, 'organization' | 'project'>
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function StatusBadge(options: StatusBadge.Props) {
|
|
942
|
+
const intent =
|
|
943
|
+
options.status === 'completed'
|
|
944
|
+
? 'positive'
|
|
945
|
+
: options.status === 'active' || options.status === 'awaiting-source'
|
|
946
|
+
? 'info'
|
|
947
|
+
: options.status === 'action-required'
|
|
948
|
+
? 'negative'
|
|
949
|
+
: isWorking(options.status)
|
|
950
|
+
? 'warning'
|
|
951
|
+
: 'neutral'
|
|
952
|
+
return <Tag intent={intent}>{label(options.status)}</Tag>
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
declare namespace StatusBadge {
|
|
956
|
+
type Props = { status: string }
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function TransferDetail(options: DetailProps) {
|
|
960
|
+
const query = useQuery(Routes.getTransfer.options(options.id))
|
|
961
|
+
const record = query.data
|
|
962
|
+
return (
|
|
963
|
+
<DetailDrawer
|
|
964
|
+
error={query.error}
|
|
965
|
+
loading={query.isPending}
|
|
966
|
+
onClose={options.onClose}
|
|
967
|
+
title="Route transfer"
|
|
968
|
+
>
|
|
969
|
+
{record ? (
|
|
970
|
+
<>
|
|
971
|
+
<DetailHeader id={record.id} status={record.status} />
|
|
972
|
+
{record.statusReason ? <Reason reason={record.statusReason.message} /> : null}
|
|
973
|
+
<DetailSection title="Route">
|
|
974
|
+
<Detail label="Provider">{record.provider.name}</Detail>
|
|
975
|
+
<Detail label="Environment">{label(record.environment)}</Detail>
|
|
976
|
+
<Detail label="Source">{routeSource(record)}</Detail>
|
|
977
|
+
<Detail label="Destination">{routeDestination(record)}</Detail>
|
|
978
|
+
<Detail label="Source amount">
|
|
979
|
+
{amountLabel(record.sourceAmount, record.sourceToken.symbol)}
|
|
980
|
+
</Detail>
|
|
981
|
+
<Detail label="Destination amount">
|
|
982
|
+
{record.destinationAmount
|
|
983
|
+
? amountLabel(record.destinationAmount, record.destinationToken.symbol)
|
|
984
|
+
: 'Pending'}
|
|
985
|
+
</Detail>
|
|
986
|
+
<Detail label="Method">{label(record.method)}</Detail>
|
|
987
|
+
<Detail label="Mode">{label(record.mode)}</Detail>
|
|
988
|
+
</DetailSection>
|
|
989
|
+
<Ownership organization={record.organization} project={record.project} />
|
|
990
|
+
<DetailSection title="Accounts">
|
|
991
|
+
<Detail label="Sender">
|
|
992
|
+
{record.sender ? (
|
|
993
|
+
<ExplorerLink
|
|
994
|
+
chainId={record.sourceChain.id}
|
|
995
|
+
type="address"
|
|
996
|
+
value={record.sender}
|
|
997
|
+
/>
|
|
998
|
+
) : (
|
|
999
|
+
'Not recorded'
|
|
1000
|
+
)}
|
|
1001
|
+
</Detail>
|
|
1002
|
+
<Detail label="Recipient">
|
|
1003
|
+
<ExplorerLink
|
|
1004
|
+
chainId={record.destinationChain.id}
|
|
1005
|
+
type="address"
|
|
1006
|
+
value={record.recipient}
|
|
1007
|
+
/>
|
|
1008
|
+
</Detail>
|
|
1009
|
+
<Detail label="Refund address">
|
|
1010
|
+
{record.refundAddress ? (
|
|
1011
|
+
<ExplorerLink
|
|
1012
|
+
chainId={record.sourceChain.id}
|
|
1013
|
+
type="address"
|
|
1014
|
+
value={record.refundAddress}
|
|
1015
|
+
/>
|
|
1016
|
+
) : (
|
|
1017
|
+
'Not configured'
|
|
1018
|
+
)}
|
|
1019
|
+
</Detail>
|
|
1020
|
+
</DetailSection>
|
|
1021
|
+
<DetailSection title="Processing">
|
|
1022
|
+
<Detail label="Subsidies">
|
|
1023
|
+
{record.subsidies.length ? (
|
|
1024
|
+
<ul className="flex flex-col gap-1">
|
|
1025
|
+
{record.subsidies.map((subsidy) => (
|
|
1026
|
+
<li key={`${subsidy.provider}:${subsidy.token.tokenKey}`}>
|
|
1027
|
+
{label(subsidy.provider)}: {amountLabel(subsidy.amount, subsidy.token.symbol)}
|
|
1028
|
+
</li>
|
|
1029
|
+
))}
|
|
1030
|
+
</ul>
|
|
1031
|
+
) : (
|
|
1032
|
+
'None'
|
|
1033
|
+
)}
|
|
1034
|
+
</Detail>
|
|
1035
|
+
</DetailSection>
|
|
1036
|
+
<TransactionList
|
|
1037
|
+
transactions={record.transactions.map(({ chainId, role, transactionRef }) => ({
|
|
1038
|
+
chainId,
|
|
1039
|
+
roles: [role],
|
|
1040
|
+
transactionRef,
|
|
1041
|
+
}))}
|
|
1042
|
+
/>
|
|
1043
|
+
<section className="flex flex-col gap-3">
|
|
1044
|
+
<h3 className="text-heading-16 text-foreground">Lifecycle</h3>
|
|
1045
|
+
<ol className="flex flex-col border-l border-border pl-4">
|
|
1046
|
+
{record.events.map((event) => (
|
|
1047
|
+
<li className="relative flex flex-col gap-1 pb-4 last:pb-0" key={event.version}>
|
|
1048
|
+
<span className="absolute -left-[19px] top-1.5 size-2 bg-foreground-secondary" />
|
|
1049
|
+
<span className="text-label-13 text-foreground">{label(event.status)}</span>
|
|
1050
|
+
<time
|
|
1051
|
+
className="text-label-12 text-foreground-secondary"
|
|
1052
|
+
dateTime={event.createdAt}
|
|
1053
|
+
>
|
|
1054
|
+
{dateTime(event.createdAt)}
|
|
1055
|
+
</time>
|
|
1056
|
+
{event.statusReason ? (
|
|
1057
|
+
<span className="text-copy-13 text-foreground-secondary">
|
|
1058
|
+
{event.statusReason.message}
|
|
1059
|
+
</span>
|
|
1060
|
+
) : null}
|
|
1061
|
+
</li>
|
|
1062
|
+
))}
|
|
1063
|
+
</ol>
|
|
1064
|
+
</section>
|
|
1065
|
+
</>
|
|
1066
|
+
) : null}
|
|
1067
|
+
</DetailDrawer>
|
|
1068
|
+
)
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
function DepositDetail(options: DetailProps) {
|
|
1072
|
+
const navigate = useNavigate({ from: Route.fullPath })
|
|
1073
|
+
const query = useQuery(Routes.getDeposit.options(options.id))
|
|
1074
|
+
const record = query.data
|
|
1075
|
+
return (
|
|
1076
|
+
<DetailDrawer
|
|
1077
|
+
error={query.error}
|
|
1078
|
+
loading={query.isPending}
|
|
1079
|
+
onClose={options.onClose}
|
|
1080
|
+
title="Route deposit"
|
|
1081
|
+
>
|
|
1082
|
+
{record ? (
|
|
1083
|
+
<>
|
|
1084
|
+
<DetailHeader id={record.id} status={record.status} />
|
|
1085
|
+
{record.statusReason ? <Reason reason={record.statusReason.message} /> : null}
|
|
1086
|
+
<DetailSection title="Route">
|
|
1087
|
+
<Detail label="Provider">{record.provider.name}</Detail>
|
|
1088
|
+
<Detail label="Environment">{label(record.environment)}</Detail>
|
|
1089
|
+
<Detail label="Source">{routeSource(record)}</Detail>
|
|
1090
|
+
<Detail label="Destination">{routeDestination(record)}</Detail>
|
|
1091
|
+
<Detail label="Source amount">
|
|
1092
|
+
{record.sourceAmount
|
|
1093
|
+
? amountLabel(record.sourceAmount, record.sourceToken.symbol)
|
|
1094
|
+
: 'Pending'}
|
|
1095
|
+
</Detail>
|
|
1096
|
+
<Detail label="Destination amount">
|
|
1097
|
+
{record.destinationAmount
|
|
1098
|
+
? amountLabel(record.destinationAmount, record.destinationToken.symbol)
|
|
1099
|
+
: 'Pending'}
|
|
1100
|
+
</Detail>
|
|
1101
|
+
</DetailSection>
|
|
1102
|
+
<Ownership organization={record.organization} project={record.project} />
|
|
1103
|
+
<DetailSection title="Accounts">
|
|
1104
|
+
<Detail label="Sender">
|
|
1105
|
+
{record.sender ? (
|
|
1106
|
+
<ExplorerLink
|
|
1107
|
+
chainId={record.sourceChain.id}
|
|
1108
|
+
type="address"
|
|
1109
|
+
value={record.sender}
|
|
1110
|
+
/>
|
|
1111
|
+
) : (
|
|
1112
|
+
'Not recorded'
|
|
1113
|
+
)}
|
|
1114
|
+
</Detail>
|
|
1115
|
+
<Detail label="Recipient">
|
|
1116
|
+
<ExplorerLink
|
|
1117
|
+
chainId={record.destinationChain.id}
|
|
1118
|
+
type="address"
|
|
1119
|
+
value={record.recipient}
|
|
1120
|
+
/>
|
|
1121
|
+
</Detail>
|
|
1122
|
+
<Detail label="Refund address">
|
|
1123
|
+
<ExplorerLink
|
|
1124
|
+
chainId={record.sourceChain.id}
|
|
1125
|
+
type="address"
|
|
1126
|
+
value={record.refundAddress}
|
|
1127
|
+
/>
|
|
1128
|
+
</Detail>
|
|
1129
|
+
</DetailSection>
|
|
1130
|
+
<DetailSection title="Processing">
|
|
1131
|
+
<Detail label="Detected by">
|
|
1132
|
+
{record.detectionTrigger ? label(record.detectionTrigger) : 'Unknown'}
|
|
1133
|
+
</Detail>
|
|
1134
|
+
<Detail label="Poll observed">
|
|
1135
|
+
{record.pollObservedAt ? dateTime(record.pollObservedAt) : 'Not recorded'}
|
|
1136
|
+
</Detail>
|
|
1137
|
+
<Detail label="Provider delivered">
|
|
1138
|
+
{record.providerDeliveredAt ? dateTime(record.providerDeliveredAt) : 'Pending'}
|
|
1139
|
+
</Detail>
|
|
1140
|
+
<Detail label="Subsidies">
|
|
1141
|
+
{record.subsidies.length ? (
|
|
1142
|
+
<ul className="flex flex-col gap-1">
|
|
1143
|
+
{record.subsidies.map((subsidy) => (
|
|
1144
|
+
<li key={`${subsidy.provider}:${subsidy.token.tokenKey}`}>
|
|
1145
|
+
{label(subsidy.provider)}: {amountLabel(subsidy.amount, subsidy.token.symbol)}
|
|
1146
|
+
</li>
|
|
1147
|
+
))}
|
|
1148
|
+
</ul>
|
|
1149
|
+
) : (
|
|
1150
|
+
'None'
|
|
1151
|
+
)}
|
|
1152
|
+
</Detail>
|
|
1153
|
+
<Detail label="Webhook received">
|
|
1154
|
+
{record.webhookReceivedAt ? dateTime(record.webhookReceivedAt) : 'Not received'}
|
|
1155
|
+
</Detail>
|
|
1156
|
+
<Detail label="Retry attempts">{record.retryAttempts ?? 'None'}</Detail>
|
|
1157
|
+
<Detail label="Tempo gas paid">{record.tempoGasPaid ?? 'None'}</Detail>
|
|
1158
|
+
</DetailSection>
|
|
1159
|
+
<button
|
|
1160
|
+
className="w-fit text-label-13 text-foreground-secondary hover:text-foreground hover:underline"
|
|
1161
|
+
onClick={() =>
|
|
1162
|
+
void navigate({
|
|
1163
|
+
search: (current) => ({
|
|
1164
|
+
...current,
|
|
1165
|
+
resource: 'deposit-addresses',
|
|
1166
|
+
selected: record.depositAddress.id,
|
|
1167
|
+
statuses: undefined,
|
|
1168
|
+
}),
|
|
1169
|
+
})
|
|
1170
|
+
}
|
|
1171
|
+
type="button"
|
|
1172
|
+
>
|
|
1173
|
+
View deposit address
|
|
1174
|
+
</button>
|
|
1175
|
+
<TransactionList transactions={depositTransactions(record)} />
|
|
1176
|
+
</>
|
|
1177
|
+
) : null}
|
|
1178
|
+
</DetailDrawer>
|
|
1179
|
+
)
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
function DepositAddressDetail(options: DepositAddressDetail.Props) {
|
|
1183
|
+
const query = useQuery(Routes.getDepositAddress.options(options.id))
|
|
1184
|
+
const record = query.data
|
|
1185
|
+
return (
|
|
1186
|
+
<DetailDrawer
|
|
1187
|
+
error={query.error}
|
|
1188
|
+
loading={query.isPending}
|
|
1189
|
+
onClose={options.onClose}
|
|
1190
|
+
title="Deposit address"
|
|
1191
|
+
>
|
|
1192
|
+
{record ? (
|
|
1193
|
+
<>
|
|
1194
|
+
<DetailHeader id={record.id} status={record.status} />
|
|
1195
|
+
<DetailSection title="Route">
|
|
1196
|
+
<Detail label="Provider">{record.provider.name}</Detail>
|
|
1197
|
+
<Detail label="Environment">{label(record.environment)}</Detail>
|
|
1198
|
+
<Detail label="Source">{routeSource(record)}</Detail>
|
|
1199
|
+
<Detail label="Destination">{routeDestination(record)}</Detail>
|
|
1200
|
+
<Detail label="Delivery">{label(record.deliveryStrategy)}</Detail>
|
|
1201
|
+
<Detail label="Subsidized">{record.subsidize ? 'Yes' : 'No'}</Detail>
|
|
1202
|
+
</DetailSection>
|
|
1203
|
+
<Ownership organization={record.organization} project={record.project} />
|
|
1204
|
+
<DetailSection title="Accounts">
|
|
1205
|
+
<Detail label="Deposit address">
|
|
1206
|
+
<span className="flex items-center gap-1.5">
|
|
1207
|
+
<ExplorerLink
|
|
1208
|
+
chainId={record.sourceChain.id}
|
|
1209
|
+
type="address"
|
|
1210
|
+
value={record.address}
|
|
1211
|
+
/>
|
|
1212
|
+
<CopyButton value={record.address} />
|
|
1213
|
+
</span>
|
|
1214
|
+
</Detail>
|
|
1215
|
+
<Detail label="Recipient">
|
|
1216
|
+
<ExplorerLink
|
|
1217
|
+
chainId={record.destinationChain.id}
|
|
1218
|
+
type="address"
|
|
1219
|
+
value={record.recipient}
|
|
1220
|
+
/>
|
|
1221
|
+
</Detail>
|
|
1222
|
+
<Detail label="Refund address">
|
|
1223
|
+
<ExplorerLink
|
|
1224
|
+
chainId={record.sourceChain.id}
|
|
1225
|
+
type="address"
|
|
1226
|
+
value={record.refundAddress}
|
|
1227
|
+
/>
|
|
1228
|
+
</Detail>
|
|
1229
|
+
</DetailSection>
|
|
1230
|
+
<DetailSection title="Polling">
|
|
1231
|
+
<Detail label="Last checked">
|
|
1232
|
+
{record.lastPolledAt ? dateTime(record.lastPolledAt) : 'Never'}
|
|
1233
|
+
</Detail>
|
|
1234
|
+
<Detail label="Next check">{dateTime(record.nextPollAt)}</Detail>
|
|
1235
|
+
<Detail label="Consecutive failures">{record.consecutivePollFailures}</Detail>
|
|
1236
|
+
<Detail label="Lease expires">
|
|
1237
|
+
{record.pollLeaseUntil ? dateTime(record.pollLeaseUntil) : 'No active lease'}
|
|
1238
|
+
</Detail>
|
|
1239
|
+
</DetailSection>
|
|
1240
|
+
<Button onClick={options.onViewDeposits}>View deposits</Button>
|
|
1241
|
+
{record.providerRequestIds.length ? (
|
|
1242
|
+
<DetailSection title="Provider request IDs">
|
|
1243
|
+
{record.providerRequestIds.map((id) => (
|
|
1244
|
+
<Detail key={id} label="Request">
|
|
1245
|
+
{id}
|
|
1246
|
+
</Detail>
|
|
1247
|
+
))}
|
|
1248
|
+
</DetailSection>
|
|
1249
|
+
) : null}
|
|
1250
|
+
</>
|
|
1251
|
+
) : null}
|
|
1252
|
+
</DetailDrawer>
|
|
1253
|
+
)
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
type DetailProps = { id: string; onClose: () => void }
|
|
1257
|
+
|
|
1258
|
+
declare namespace DepositAddressDetail {
|
|
1259
|
+
type Props = DetailProps & { onViewDeposits: () => void }
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
function DetailDrawer(options: DetailDrawer.Props) {
|
|
1263
|
+
return (
|
|
1264
|
+
<BaseDialog.Root onOpenChange={(open) => !open && options.onClose()} open>
|
|
1265
|
+
<BaseDialog.Portal>
|
|
1266
|
+
<BaseDialog.Backdrop className="fixed inset-0 z-40 bg-black/60 transition-opacity duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0" />
|
|
1267
|
+
<BaseDialog.Popup className="fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l border-border bg-surface outline-none transition-transform duration-200 data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full">
|
|
1268
|
+
<div className="flex shrink-0 items-start justify-between gap-4 border-b border-border px-5 py-4">
|
|
1269
|
+
<div className="min-w-0">
|
|
1270
|
+
<BaseDialog.Title className="text-heading-20 text-foreground">
|
|
1271
|
+
{options.title}
|
|
1272
|
+
</BaseDialog.Title>
|
|
1273
|
+
<BaseDialog.Description className="mt-1 text-copy-13 text-foreground-secondary">
|
|
1274
|
+
Operational details and verified evidence
|
|
1275
|
+
</BaseDialog.Description>
|
|
1276
|
+
</div>
|
|
1277
|
+
<BaseDialog.Close
|
|
1278
|
+
aria-label="Close details"
|
|
1279
|
+
className="flex size-8 shrink-0 items-center justify-center text-foreground-secondary hover:bg-surface-hover hover:text-foreground"
|
|
1280
|
+
>
|
|
1281
|
+
<X className="size-4" />
|
|
1282
|
+
</BaseDialog.Close>
|
|
1283
|
+
</div>
|
|
1284
|
+
<div className="flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto px-5 py-5">
|
|
1285
|
+
{options.loading ? (
|
|
1286
|
+
<Notice>Loading details…</Notice>
|
|
1287
|
+
) : options.error ? (
|
|
1288
|
+
<div
|
|
1289
|
+
className="border border-negative bg-negative-subtle p-4 text-copy-14 text-negative"
|
|
1290
|
+
role="alert"
|
|
1291
|
+
>
|
|
1292
|
+
{options.error.message}
|
|
1293
|
+
</div>
|
|
1294
|
+
) : (
|
|
1295
|
+
options.children
|
|
1296
|
+
)}
|
|
1297
|
+
</div>
|
|
1298
|
+
</BaseDialog.Popup>
|
|
1299
|
+
</BaseDialog.Portal>
|
|
1300
|
+
</BaseDialog.Root>
|
|
1301
|
+
)
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
declare namespace DetailDrawer {
|
|
1305
|
+
type Props = {
|
|
1306
|
+
children: ReactNode
|
|
1307
|
+
error: Error | null
|
|
1308
|
+
loading: boolean
|
|
1309
|
+
onClose: () => void
|
|
1310
|
+
title: string
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
function DetailHeader(options: DetailHeader.Props) {
|
|
1315
|
+
return (
|
|
1316
|
+
<div className="flex min-w-0 items-center justify-between gap-3">
|
|
1317
|
+
<code className="truncate text-label-12 text-foreground-secondary" title={options.id}>
|
|
1318
|
+
{options.id}
|
|
1319
|
+
</code>
|
|
1320
|
+
<StatusBadge status={options.status} />
|
|
1321
|
+
</div>
|
|
1322
|
+
)
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
declare namespace DetailHeader {
|
|
1326
|
+
type Props = { id: string; status: string }
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
function DetailSection(options: DetailSection.Props) {
|
|
1330
|
+
return (
|
|
1331
|
+
<section className="flex flex-col gap-3">
|
|
1332
|
+
<h3 className="text-heading-16 text-foreground">{options.title}</h3>
|
|
1333
|
+
<dl className="grid gap-x-6 gap-y-4 sm:grid-cols-2">{options.children}</dl>
|
|
1334
|
+
</section>
|
|
1335
|
+
)
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
declare namespace DetailSection {
|
|
1339
|
+
type Props = { children: ReactNode; title: string }
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
function Detail(options: Detail.Props) {
|
|
1343
|
+
return (
|
|
1344
|
+
<div className="flex min-w-0 flex-col gap-1">
|
|
1345
|
+
<dt className="text-label-12 text-foreground-secondary">{options.label}</dt>
|
|
1346
|
+
<dd className="min-w-0 break-words text-label-13 text-foreground">{options.children}</dd>
|
|
1347
|
+
</div>
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
declare namespace Detail {
|
|
1352
|
+
type Props = { children: ReactNode; label: string }
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
function Ownership(options: AttributionCell.Props) {
|
|
1356
|
+
return (
|
|
1357
|
+
<DetailSection title="Ownership">
|
|
1358
|
+
<Detail label="Organization">
|
|
1359
|
+
<Link
|
|
1360
|
+
className="hover:underline"
|
|
1361
|
+
params={{ orgId: options.organization.id }}
|
|
1362
|
+
search={{}}
|
|
1363
|
+
to="/organizations/$orgId"
|
|
1364
|
+
>
|
|
1365
|
+
{options.organization.name ?? options.organization.id}
|
|
1366
|
+
</Link>
|
|
1367
|
+
</Detail>
|
|
1368
|
+
<Detail label="Project">
|
|
1369
|
+
{options.project?.name ?? options.project?.id ?? 'Organization scoped'}
|
|
1370
|
+
</Detail>
|
|
1371
|
+
</DetailSection>
|
|
1372
|
+
)
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
function Reason(options: Reason.Props) {
|
|
1376
|
+
return (
|
|
1377
|
+
<div className="border border-negative bg-negative-subtle p-3 text-copy-13 text-negative">
|
|
1378
|
+
{options.reason}
|
|
1379
|
+
</div>
|
|
1380
|
+
)
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
declare namespace Reason {
|
|
1384
|
+
type Props = { reason: string }
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function TransactionList(options: TransactionList.Props) {
|
|
1388
|
+
return (
|
|
1389
|
+
<section className="flex flex-col gap-3">
|
|
1390
|
+
<h3 className="text-heading-16 text-foreground">Transactions</h3>
|
|
1391
|
+
{options.transactions.length ? (
|
|
1392
|
+
<ul className="divide-y divide-border border-y border-border">
|
|
1393
|
+
{options.transactions.map((transaction) => (
|
|
1394
|
+
<li
|
|
1395
|
+
className="flex items-center justify-between gap-3 py-3"
|
|
1396
|
+
key={`${transaction.chainId}:${transaction.transactionRef}`}
|
|
1397
|
+
>
|
|
1398
|
+
<span className="text-copy-13 text-foreground-secondary">
|
|
1399
|
+
{transaction.roles.map(label).join(', ')}
|
|
1400
|
+
</span>
|
|
1401
|
+
<ExplorerLink chainId={transaction.chainId} value={transaction.transactionRef} />
|
|
1402
|
+
</li>
|
|
1403
|
+
))}
|
|
1404
|
+
</ul>
|
|
1405
|
+
) : (
|
|
1406
|
+
<p className="text-copy-13 text-foreground-secondary">No verified transactions.</p>
|
|
1407
|
+
)}
|
|
1408
|
+
</section>
|
|
1409
|
+
)
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
declare namespace TransactionList {
|
|
1413
|
+
type Props = { transactions: readonly Transaction[] }
|
|
1414
|
+
type Transaction = {
|
|
1415
|
+
chainId: string
|
|
1416
|
+
roles: readonly ('destination' | 'provider' | 'refund' | 'source' | 'subsidizer')[]
|
|
1417
|
+
transactionRef: string
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
function ExplorerLink(options: ExplorerLink.Props) {
|
|
1422
|
+
const explorer = options.chainId ? explorers[options.chainId] : undefined
|
|
1423
|
+
if (!explorer)
|
|
1424
|
+
return (
|
|
1425
|
+
<code
|
|
1426
|
+
className="max-w-64 truncate text-label-12 text-foreground-secondary"
|
|
1427
|
+
title={options.value}
|
|
1428
|
+
>
|
|
1429
|
+
{truncate(options.value)}
|
|
1430
|
+
</code>
|
|
1431
|
+
)
|
|
1432
|
+
return (
|
|
1433
|
+
<a
|
|
1434
|
+
className="flex min-w-0 items-center gap-1.5 font-mono text-label-12 text-foreground-secondary hover:text-foreground"
|
|
1435
|
+
href={`${explorer[options.type ?? 'tx']}/${options.value}`}
|
|
1436
|
+
rel="noreferrer"
|
|
1437
|
+
target="_blank"
|
|
1438
|
+
title={options.value}
|
|
1439
|
+
>
|
|
1440
|
+
<span className="truncate">{truncate(options.value)}</span>
|
|
1441
|
+
<ExternalLink className="size-3 shrink-0" />
|
|
1442
|
+
</a>
|
|
1443
|
+
)
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
declare namespace ExplorerLink {
|
|
1447
|
+
type Props = {
|
|
1448
|
+
chainId?: string | undefined
|
|
1449
|
+
type?: 'address' | 'tx' | undefined
|
|
1450
|
+
value: string
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
function depositTransactions(record: Routes.getDeposit.Data): TransactionList.Transaction[] {
|
|
1455
|
+
const destinationHashes = record.destinationTransactionHashes ?? []
|
|
1456
|
+
const destinationTransactions = new Set(destinationHashes.map((hash) => hash.toLowerCase()))
|
|
1457
|
+
const transactions: TransactionList.Transaction[] = [
|
|
1458
|
+
...record.sourceTransactionHashes.map((transactionRef) => ({
|
|
1459
|
+
chainId: record.sourceChain.id,
|
|
1460
|
+
roles: ['source'] as const,
|
|
1461
|
+
transactionRef,
|
|
1462
|
+
})),
|
|
1463
|
+
...record.providerTransactionHashes.map((transactionRef) => ({
|
|
1464
|
+
chainId: destinationTransactions.has(transactionRef.toLowerCase())
|
|
1465
|
+
? record.destinationChain.id
|
|
1466
|
+
: record.sourceChain.id,
|
|
1467
|
+
roles: ['provider'] as const,
|
|
1468
|
+
transactionRef,
|
|
1469
|
+
})),
|
|
1470
|
+
...destinationHashes.map((transactionRef) => ({
|
|
1471
|
+
chainId: record.destinationChain.id,
|
|
1472
|
+
roles: ['destination'] as const,
|
|
1473
|
+
transactionRef,
|
|
1474
|
+
})),
|
|
1475
|
+
...(record.settlementTransactionHash
|
|
1476
|
+
? [
|
|
1477
|
+
{
|
|
1478
|
+
chainId: record.destinationChain.id,
|
|
1479
|
+
roles: ['subsidizer'] as const,
|
|
1480
|
+
transactionRef: record.settlementTransactionHash,
|
|
1481
|
+
},
|
|
1482
|
+
]
|
|
1483
|
+
: []),
|
|
1484
|
+
]
|
|
1485
|
+
const unique = new Map<string, TransactionList.Transaction>()
|
|
1486
|
+
for (const transaction of transactions) {
|
|
1487
|
+
const reference = transaction.chainId.startsWith('eip155:')
|
|
1488
|
+
? transaction.transactionRef.toLowerCase()
|
|
1489
|
+
: transaction.transactionRef
|
|
1490
|
+
const key = `${transaction.chainId}:${reference}`
|
|
1491
|
+
const current = unique.get(key)
|
|
1492
|
+
unique.set(
|
|
1493
|
+
key,
|
|
1494
|
+
current
|
|
1495
|
+
? {
|
|
1496
|
+
...current,
|
|
1497
|
+
roles:
|
|
1498
|
+
current.roles.includes('subsidizer') || transaction.roles.includes('subsidizer')
|
|
1499
|
+
? ['subsidizer']
|
|
1500
|
+
: [...new Set([...current.roles, ...transaction.roles])],
|
|
1501
|
+
}
|
|
1502
|
+
: transaction,
|
|
1503
|
+
)
|
|
1504
|
+
}
|
|
1505
|
+
return [...unique.values()]
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
function commonFilters(search: Routes.Search, resource: Resource) {
|
|
1509
|
+
return {
|
|
1510
|
+
environments: search.environments?.length ? search.environments : undefined,
|
|
1511
|
+
inProgress: search.inProgress,
|
|
1512
|
+
methods: resource === 'transfers' && search.methods?.length ? search.methods : undefined,
|
|
1513
|
+
needsAttention: search.needsAttention,
|
|
1514
|
+
orgId: search.orgId,
|
|
1515
|
+
projectId: search.projectId,
|
|
1516
|
+
providers: search.providers?.length ? search.providers : undefined,
|
|
1517
|
+
sourceChains: search.sourceChains?.length ? search.sourceChains : undefined,
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
function summaryFilters(search: Routes.Search) {
|
|
1522
|
+
return {
|
|
1523
|
+
environments: search.environments?.length ? search.environments : undefined,
|
|
1524
|
+
methods: search.methods?.length ? search.methods : undefined,
|
|
1525
|
+
orgId: search.orgId,
|
|
1526
|
+
projectId: search.projectId,
|
|
1527
|
+
providers: search.providers?.length ? search.providers : undefined,
|
|
1528
|
+
sourceChains: search.sourceChains?.length ? search.sourceChains : undefined,
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
function filterSearch(search: Routes.Search, resource: Resource): Routes.Search {
|
|
1533
|
+
return {
|
|
1534
|
+
environments: search.environments?.length ? search.environments : undefined,
|
|
1535
|
+
inProgress: search.inProgress,
|
|
1536
|
+
methods: resource === 'transfers' && search.methods?.length ? search.methods : undefined,
|
|
1537
|
+
needsAttention: search.needsAttention,
|
|
1538
|
+
orgId: search.orgId?.trim() || undefined,
|
|
1539
|
+
projectId: search.projectId?.trim() || undefined,
|
|
1540
|
+
providers: search.providers?.length ? search.providers : undefined,
|
|
1541
|
+
query: search.query?.trim() || undefined,
|
|
1542
|
+
sourceChains: search.sourceChains?.length ? search.sourceChains : undefined,
|
|
1543
|
+
statuses: search.statuses?.length ? search.statuses : undefined,
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
function statusItems(resource: Resource) {
|
|
1548
|
+
const values =
|
|
1549
|
+
resource === 'transfers'
|
|
1550
|
+
? transferStatuses
|
|
1551
|
+
: resource === 'deposits'
|
|
1552
|
+
? depositStatuses
|
|
1553
|
+
: depositAddressStatuses
|
|
1554
|
+
return values.map((status) => ({ label: label(status), value: status }))
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
function isWorking(status: string) {
|
|
1558
|
+
return [
|
|
1559
|
+
'awaiting-source',
|
|
1560
|
+
'bridging',
|
|
1561
|
+
'detected',
|
|
1562
|
+
'processing',
|
|
1563
|
+
'refunding',
|
|
1564
|
+
'settling',
|
|
1565
|
+
].includes(status)
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
function label(value: string) {
|
|
1569
|
+
return value
|
|
1570
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
1571
|
+
.replaceAll('-', ' ')
|
|
1572
|
+
.replace(/^./, (character) => character.toUpperCase())
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
function routeSource(record: Pick<Routes.listTransfers.Item, 'sourceChain' | 'sourceToken'>) {
|
|
1576
|
+
return `${record.sourceToken.symbol} on ${record.sourceChain.name}`
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
function routeDestination(
|
|
1580
|
+
record: Pick<Routes.listTransfers.Item, 'destinationChain' | 'destinationToken'>,
|
|
1581
|
+
) {
|
|
1582
|
+
return `${record.destinationToken.symbol} on ${record.destinationChain.name}`
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
function amountLabel(amount: Routes.listTransfers.Item['sourceAmount'], symbol: string) {
|
|
1586
|
+
return `${amount.formatted} ${symbol}`
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
function dateTime(value: string) {
|
|
1590
|
+
return new Intl.DateTimeFormat('en', { dateStyle: 'medium', timeStyle: 'short' }).format(
|
|
1591
|
+
new Date(value),
|
|
1592
|
+
)
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
function age(value: string) {
|
|
1596
|
+
const delta = new Date(value).getTime() - Date.now()
|
|
1597
|
+
const absolute = Math.abs(delta)
|
|
1598
|
+
const [unit, size] =
|
|
1599
|
+
absolute >= 86_400_000
|
|
1600
|
+
? ['day', 86_400_000]
|
|
1601
|
+
: absolute >= 3_600_000
|
|
1602
|
+
? ['hour', 3_600_000]
|
|
1603
|
+
: absolute >= 60_000
|
|
1604
|
+
? ['minute', 60_000]
|
|
1605
|
+
: ['second', 1_000]
|
|
1606
|
+
return new Intl.RelativeTimeFormat('en', { numeric: 'auto' }).format(
|
|
1607
|
+
Math.round(delta / size),
|
|
1608
|
+
unit as Intl.RelativeTimeFormatUnit,
|
|
1609
|
+
)
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
function truncate(value: string) {
|
|
1613
|
+
if (value.length <= 20) return value
|
|
1614
|
+
return `${value.slice(0, 10)}…${value.slice(-8)}`
|
|
1615
|
+
}
|