tapimo 0.7.0 → 0.7.2
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/dist/ApiKeys.d.ts +24 -7
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +17 -5
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +12104 -7861
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +191 -128
- package/dist/App.js.map +1 -1
- package/dist/Assets.d.ts +10 -0
- package/dist/Assets.d.ts.map +1 -1
- package/dist/Assets.js +17 -4
- package/dist/Assets.js.map +1 -1
- package/dist/Scope.d.ts +19 -8
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +25 -9
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +1 -1
- package/dist/admin/App.d.ts +601 -20
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/App.js +12 -2
- package/dist/admin/App.js.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +94 -11
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +141 -32
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/earn-vaults.d.ts +1069 -0
- package/dist/admin/apps/earn-vaults.d.ts.map +1 -0
- package/dist/admin/apps/earn-vaults.js +409 -0
- package/dist/admin/apps/earn-vaults.js.map +1 -0
- package/dist/admin/apps/verified-tokens.d.ts +166 -166
- 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 +151 -95
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/analytics/Analytics.d.ts +2 -0
- package/dist/analytics/Analytics.d.ts.map +1 -1
- package/dist/analytics/Analytics.js +18 -2
- package/dist/analytics/Analytics.js.map +1 -1
- package/dist/analytics/tables/requestEvents.d.ts +22 -1
- package/dist/analytics/tables/requestEvents.d.ts.map +1 -1
- package/dist/analytics/tables/requestEvents.js +59 -39
- package/dist/analytics/tables/requestEvents.js.map +1 -1
- package/dist/apps/Zones.d.ts +8335 -0
- package/dist/apps/Zones.d.ts.map +1 -0
- package/dist/apps/Zones.js +38 -0
- package/dist/apps/Zones.js.map +1 -0
- package/dist/apps/data/App.d.ts +14377 -10165
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +91 -19
- package/dist/apps/data/App.js.map +1 -1
- package/dist/apps/data/FxOracle.d.ts +1 -1
- package/dist/apps/data/FxOracle.d.ts.map +1 -1
- package/dist/apps/data/index.d.ts +0 -1
- package/dist/apps/data/index.d.ts.map +1 -1
- package/dist/apps/data/index.js +0 -1
- package/dist/apps/data/index.js.map +1 -1
- package/dist/apps/data/routes/activities.d.ts +32 -32
- package/dist/apps/data/routes/activities.d.ts.map +1 -1
- package/dist/apps/data/routes/activities.js +130 -65
- package/dist/apps/data/routes/activities.js.map +1 -1
- package/dist/apps/data/routes/addresses.d.ts +312 -312
- package/dist/apps/data/routes/balances.d.ts +18 -18
- package/dist/apps/data/routes/balances.js +5 -5
- package/dist/apps/data/routes/balances.js.map +1 -1
- package/dist/apps/data/routes/coingecko.d.ts +176 -176
- package/dist/apps/data/routes/coingecko.d.ts.map +1 -1
- package/dist/apps/data/routes/coingecko.js +62 -35
- package/dist/apps/data/routes/coingecko.js.map +1 -1
- package/dist/apps/data/routes/earn.d.ts +2144 -0
- package/dist/apps/data/routes/earn.d.ts.map +1 -0
- package/dist/apps/data/routes/earn.js +947 -0
- package/dist/apps/data/routes/earn.js.map +1 -0
- package/dist/apps/data/routes/exchanges.d.ts +1231 -324
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
- package/dist/apps/data/routes/exchanges.js +656 -193
- package/dist/apps/data/routes/exchanges.js.map +1 -1
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
- package/dist/apps/data/routes/fee-amm.js +59 -8
- package/dist/apps/data/routes/fee-amm.js.map +1 -1
- package/dist/apps/data/routes/funding.d.ts +4092 -387
- package/dist/apps/data/routes/funding.d.ts.map +1 -1
- package/dist/apps/data/routes/funding.js +1403 -256
- package/dist/apps/data/routes/funding.js.map +1 -1
- package/dist/apps/data/routes/indexer.d.ts +5 -5
- package/dist/apps/data/routes/indexer.d.ts.map +1 -1
- package/dist/apps/data/routes/indexer.js +19 -2
- package/dist/apps/data/routes/indexer.js.map +1 -1
- package/dist/apps/data/routes/receipts.d.ts +265 -265
- package/dist/apps/data/routes/receipts.d.ts.map +1 -1
- package/dist/apps/data/routes/receipts.js +11 -11
- package/dist/apps/data/routes/receipts.js.map +1 -1
- package/dist/apps/data/routes/rpc.d.ts +5 -5
- package/dist/apps/data/routes/rpc.d.ts.map +1 -1
- package/dist/apps/data/routes/rpc.js +211 -22
- package/dist/apps/data/routes/rpc.js.map +1 -1
- package/dist/apps/data/routes/tokenlist.d.ts +36 -36
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
- package/dist/apps/data/routes/tokenlist.js +49 -9
- package/dist/apps/data/routes/tokenlist.js.map +1 -1
- package/dist/apps/data/routes/tokens.d.ts +116 -88
- package/dist/apps/data/routes/tokens.d.ts.map +1 -1
- package/dist/apps/data/routes/tokens.js +198 -91
- package/dist/apps/data/routes/tokens.js.map +1 -1
- package/dist/apps/data/routes/transactions.d.ts +55 -55
- package/dist/apps/data/routes/transactions.d.ts.map +1 -1
- package/dist/apps/data/routes/transactions.js +78 -39
- package/dist/apps/data/routes/transactions.js.map +1 -1
- package/dist/apps/data/routes/transfers.d.ts +78 -29
- package/dist/apps/data/routes/transfers.d.ts.map +1 -1
- package/dist/apps/data/routes/transfers.js +165 -67
- package/dist/apps/data/routes/transfers.js.map +1 -1
- package/dist/apps/data/routes/valuation.d.ts +10 -10
- package/dist/apps/data/routes/valuation.js +2 -2
- package/dist/apps/data/routes/valuation.js.map +1 -1
- package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -1
- package/dist/apps/data/routes/verified-tokens.js +34 -9
- package/dist/apps/data/routes/verified-tokens.js.map +1 -1
- package/dist/apps/data/routes/webhooks.d.ts +5 -3
- package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/data/routes/webhooks.js +175 -65
- package/dist/apps/data/routes/webhooks.js.map +1 -1
- package/dist/apps/data/routes/zones.d.ts +281 -0
- package/dist/apps/data/routes/zones.d.ts.map +1 -0
- package/dist/apps/data/routes/zones.js +252 -0
- package/dist/apps/data/routes/zones.js.map +1 -0
- package/dist/apps/docs/reference.js +6 -5
- package/dist/apps/docs/reference.js.map +1 -1
- package/dist/apps/index.d.ts +2 -1
- package/dist/apps/index.d.ts.map +1 -1
- package/dist/apps/index.js +2 -1
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/management/App.d.ts +670 -670
- package/dist/apps/management/Billing.d.ts +8 -0
- package/dist/apps/management/Billing.d.ts.map +1 -1
- package/dist/apps/management/Billing.js +12 -0
- package/dist/apps/management/Billing.js.map +1 -1
- package/dist/apps/management/Error.d.ts +12 -0
- package/dist/apps/management/Error.d.ts.map +1 -0
- package/dist/apps/management/Error.js +10 -0
- package/dist/apps/management/Error.js.map +1 -0
- package/dist/apps/management/routes/api-keys.d.ts +5 -5
- package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
- package/dist/apps/management/routes/api-keys.js +2 -8
- package/dist/apps/management/routes/api-keys.js.map +1 -1
- package/dist/apps/management/routes/billing.d.ts +119 -119
- package/dist/apps/management/routes/faucet.d.ts +35 -35
- package/dist/apps/management/routes/invitations.d.ts +62 -62
- package/dist/apps/management/routes/invitations.d.ts.map +1 -1
- package/dist/apps/management/routes/invitations.js +4 -10
- package/dist/apps/management/routes/invitations.js.map +1 -1
- package/dist/apps/management/routes/invite-links.d.ts +30 -30
- package/dist/apps/management/routes/me.d.ts +6 -6
- package/dist/apps/management/routes/members.d.ts +78 -78
- package/dist/apps/management/routes/orgs.d.ts +48 -48
- package/dist/apps/management/routes/orgs.d.ts.map +1 -1
- package/dist/apps/management/routes/orgs.js +2 -8
- package/dist/apps/management/routes/orgs.js.map +1 -1
- package/dist/apps/management/routes/projects.d.ts +9 -9
- package/dist/apps/management/routes/scopes.js +2 -2
- package/dist/apps/management/routes/scopes.js.map +1 -1
- package/dist/apps/management/routes/usage.d.ts +80 -80
- package/dist/apps/management/routes/verified-token-requests.d.ts +36 -36
- package/dist/apps/management/routes/webhooks.d.ts +50 -50
- package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/management/routes/webhooks.js +15 -3
- package/dist/apps/management/routes/webhooks.js.map +1 -1
- package/dist/apps/mpp/App.d.ts +55 -56
- package/dist/apps/mpp/App.d.ts.map +1 -1
- package/dist/apps/mpp/App.js +192 -27
- package/dist/apps/mpp/App.js.map +1 -1
- package/dist/apps/mpp/Mpp.d.ts +0 -20
- package/dist/apps/mpp/Mpp.d.ts.map +1 -1
- package/dist/apps/mpp/Mpp.js +0 -24
- package/dist/apps/mpp/Mpp.js.map +1 -1
- package/dist/apps/mpp/internal/Adapter.d.ts +40 -0
- package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Adapter.js +66 -0
- package/dist/apps/mpp/internal/Adapter.js.map +1 -0
- package/dist/apps/mpp/internal/Error.d.ts +4 -0
- package/dist/apps/mpp/internal/Error.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Error.js +41 -0
- package/dist/apps/mpp/internal/Error.js.map +1 -0
- package/dist/apps/mpp/internal/Idempotency.d.ts +33 -0
- package/dist/apps/mpp/internal/Idempotency.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Idempotency.js +28 -0
- package/dist/apps/mpp/internal/Idempotency.js.map +1 -0
- package/dist/apps/mpp/internal/Policy.d.ts +46 -0
- package/dist/apps/mpp/internal/Policy.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Policy.js +57 -0
- package/dist/apps/mpp/internal/Policy.js.map +1 -0
- package/dist/apps/mpp/internal/ScreenManager.d.ts +27 -0
- package/dist/apps/mpp/internal/ScreenManager.d.ts.map +1 -0
- package/dist/apps/mpp/internal/ScreenManager.js +18 -0
- package/dist/apps/mpp/internal/ScreenManager.js.map +1 -0
- package/dist/apps/mpp/internal/Screening.d.ts +35 -0
- package/dist/apps/mpp/internal/Screening.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Screening.js +20 -0
- package/dist/apps/mpp/internal/Screening.js.map +1 -0
- package/dist/apps/mpp/internal/Sponsorship.d.ts +36 -0
- package/dist/apps/mpp/internal/Sponsorship.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Sponsorship.js +103 -0
- package/dist/apps/mpp/internal/Sponsorship.js.map +1 -0
- package/dist/apps/mpp/internal/Utils.d.ts +7 -0
- package/dist/apps/mpp/internal/Utils.d.ts.map +1 -0
- package/dist/apps/mpp/internal/Utils.js +24 -0
- package/dist/apps/mpp/internal/Utils.js.map +1 -0
- package/dist/apps/relay/App.js +184 -24
- package/dist/apps/relay/App.js.map +1 -1
- package/dist/apps/relay/Sponsorships.d.ts +4 -0
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
- package/dist/apps/relay/Sponsorships.js +16 -7
- package/dist/apps/relay/Sponsorships.js.map +1 -1
- package/dist/db/Db.d.ts +20 -0
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +342 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +921 -1
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +269 -1
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/earnVaults.d.ts +68 -0
- package/dist/db/tables/earnVaults.d.ts.map +1 -0
- package/dist/db/tables/earnVaults.js +72 -0
- package/dist/db/tables/earnVaults.js.map +1 -0
- package/dist/db/tables/fundingCatalog.d.ts +56 -0
- package/dist/db/tables/fundingCatalog.d.ts.map +1 -0
- package/dist/db/tables/fundingCatalog.js +85 -0
- package/dist/db/tables/fundingCatalog.js.map +1 -0
- package/dist/db/tables/fundingDepositAddresses.d.ts +159 -0
- package/dist/db/tables/fundingDepositAddresses.d.ts.map +1 -0
- package/dist/db/tables/fundingDepositAddresses.js +206 -0
- package/dist/db/tables/fundingDepositAddresses.js.map +1 -0
- package/dist/db/tables/fundingDeposits.d.ts +115 -0
- package/dist/db/tables/fundingDeposits.d.ts.map +1 -0
- package/dist/db/tables/fundingDeposits.js +100 -0
- package/dist/db/tables/fundingDeposits.js.map +1 -0
- package/dist/db/tables/fundingIdempotency.d.ts +91 -0
- package/dist/db/tables/fundingIdempotency.d.ts.map +1 -0
- package/dist/db/tables/fundingIdempotency.js +103 -0
- package/dist/db/tables/fundingIdempotency.js.map +1 -0
- package/dist/db/tables/fundingTransferEvents.d.ts +12 -0
- package/dist/db/tables/fundingTransferEvents.d.ts.map +1 -0
- package/dist/db/tables/fundingTransferEvents.js +18 -0
- package/dist/db/tables/fundingTransferEvents.js.map +1 -0
- package/dist/db/tables/fundingTransferTransactions.d.ts +15 -0
- package/dist/db/tables/fundingTransferTransactions.d.ts.map +1 -0
- package/dist/db/tables/fundingTransferTransactions.js +27 -0
- package/dist/db/tables/fundingTransferTransactions.js.map +1 -0
- package/dist/db/tables/fundingTransfers.d.ts +82 -0
- package/dist/db/tables/fundingTransfers.d.ts.map +1 -0
- package/dist/db/tables/fundingTransfers.js +89 -0
- package/dist/db/tables/fundingTransfers.js.map +1 -0
- package/dist/db/tables/organizations.d.ts +8 -0
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +35 -0
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +8 -0
- package/dist/db/tables/projects.d.ts.map +1 -1
- package/dist/db/tables/projects.js +16 -0
- package/dist/db/tables/projects.js.map +1 -1
- package/dist/db/tables/requestUsage.d.ts +13 -0
- package/dist/db/tables/requestUsage.d.ts.map +1 -1
- package/dist/db/tables/requestUsage.js +16 -0
- package/dist/db/tables/requestUsage.js.map +1 -1
- package/dist/db/tables/sponsoredTransactions.d.ts +4 -2
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
- package/dist/db/tables/sponsoredTransactions.js +14 -4
- package/dist/db/tables/sponsoredTransactions.js.map +1 -1
- package/dist/db/tables/users.d.ts +8 -0
- package/dist/db/tables/users.d.ts.map +1 -1
- package/dist/db/tables/users.js +16 -0
- package/dist/db/tables/users.js.map +1 -1
- package/dist/db/tables/verifiedTokens.d.ts +14 -7
- package/dist/db/tables/verifiedTokens.d.ts.map +1 -1
- package/dist/db/tables/verifiedTokens.js +9 -7
- package/dist/db/tables/verifiedTokens.js.map +1 -1
- package/dist/db/tables/webhookSubscriptions.d.ts +31 -1
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
- package/dist/db/tables/webhookSubscriptions.js +24 -3
- package/dist/db/tables/webhookSubscriptions.js.map +1 -1
- package/dist/handlers/relay.js +108 -108
- package/dist/handlers/relay.js.map +1 -1
- package/dist/internal/Auth.d.ts +26 -0
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +35 -2
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Cache.d.ts.map +1 -1
- package/dist/internal/Cache.js +16 -10
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/Cursor.js +1 -1
- package/dist/internal/Cursor.js.map +1 -1
- package/dist/internal/EarnRates.d.ts +89 -0
- package/dist/internal/EarnRates.d.ts.map +1 -0
- package/dist/internal/EarnRates.js +266 -0
- package/dist/internal/EarnRates.js.map +1 -0
- package/dist/internal/EarnVaults.d.ts +171 -0
- package/dist/internal/EarnVaults.d.ts.map +1 -0
- package/dist/internal/EarnVaults.js +547 -0
- package/dist/internal/EarnVaults.js.map +1 -0
- package/dist/internal/EdgeCache.d.ts +9 -2
- package/dist/internal/EdgeCache.d.ts.map +1 -1
- package/dist/internal/EdgeCache.js +36 -9
- package/dist/internal/EdgeCache.js.map +1 -1
- package/dist/internal/Id.d.ts +11 -0
- package/dist/internal/Id.d.ts.map +1 -1
- package/dist/internal/Id.js +13 -0
- package/dist/internal/Id.js.map +1 -1
- package/dist/internal/Idempotency.d.ts +83 -0
- package/dist/internal/Idempotency.d.ts.map +1 -0
- package/dist/internal/Idempotency.js +113 -0
- package/dist/internal/Idempotency.js.map +1 -0
- package/dist/internal/Log.d.ts +64 -9
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +29 -7
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/MetricSink.d.ts.map +1 -1
- package/dist/internal/MetricSink.js +47 -1
- package/dist/internal/MetricSink.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +1 -1
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +3 -0
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/Provider.d.ts +14 -0
- package/dist/internal/Provider.d.ts.map +1 -0
- package/dist/internal/Provider.js +5 -0
- package/dist/internal/Provider.js.map +1 -0
- package/dist/internal/Schema.d.ts +8 -3
- package/dist/internal/Schema.d.ts.map +1 -1
- package/dist/internal/Schema.js +24 -13
- package/dist/internal/Schema.js.map +1 -1
- package/dist/internal/Store.d.ts +6 -0
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +35 -0
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Tidx.d.ts +43 -24
- package/dist/internal/Tidx.d.ts.map +1 -1
- package/dist/internal/Tidx.js +79 -11
- package/dist/internal/Tidx.js.map +1 -1
- package/dist/internal/Viem.d.ts +82 -65
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Viem.js +83 -12
- package/dist/internal/Viem.js.map +1 -1
- package/dist/internal/WebhookDestination.d.ts.map +1 -1
- package/dist/internal/WebhookDestination.js +34 -28
- package/dist/internal/WebhookDestination.js.map +1 -1
- package/dist/internal/Webhooks.d.ts +9 -0
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +15 -10
- package/dist/internal/Webhooks.js.map +1 -1
- package/dist/internal/exchange/Provider.d.ts +219 -0
- package/dist/internal/exchange/Provider.d.ts.map +1 -0
- package/dist/internal/exchange/Provider.js +117 -0
- package/dist/internal/exchange/Provider.js.map +1 -0
- package/dist/internal/exchange/index.d.ts +2 -0
- package/dist/internal/exchange/index.d.ts.map +1 -0
- package/dist/internal/exchange/index.js +2 -0
- package/dist/internal/exchange/index.js.map +1 -0
- package/dist/internal/exchange/providers/uniswap.d.ts +57 -0
- package/dist/internal/exchange/providers/uniswap.d.ts.map +1 -0
- package/dist/internal/exchange/providers/uniswap.js +553 -0
- package/dist/internal/exchange/providers/uniswap.js.map +1 -0
- package/dist/internal/funding/Action.d.ts +55 -0
- package/dist/internal/funding/Action.d.ts.map +1 -0
- package/dist/internal/funding/Action.js +74 -0
- package/dist/internal/funding/Action.js.map +1 -0
- package/dist/internal/funding/Catalog.d.ts +107 -0
- package/dist/internal/funding/Catalog.d.ts.map +1 -0
- package/dist/internal/funding/Catalog.js +270 -0
- package/dist/internal/funding/Catalog.js.map +1 -0
- package/dist/internal/funding/Chain.d.ts +76 -0
- package/dist/internal/funding/Chain.d.ts.map +1 -0
- package/dist/internal/funding/Chain.js +38 -0
- package/dist/internal/funding/Chain.js.map +1 -0
- package/dist/internal/funding/Deposit.d.ts +366 -0
- package/dist/internal/funding/Deposit.d.ts.map +1 -0
- package/dist/internal/funding/Deposit.js +286 -0
- package/dist/internal/funding/Deposit.js.map +1 -0
- package/dist/internal/funding/DepositAddress.d.ts +345 -0
- package/dist/internal/funding/DepositAddress.d.ts.map +1 -0
- package/dist/internal/funding/DepositAddress.js +189 -0
- package/dist/internal/funding/DepositAddress.js.map +1 -0
- package/dist/internal/funding/Evidence.d.ts +52 -0
- package/dist/internal/funding/Evidence.d.ts.map +1 -0
- package/dist/internal/funding/Evidence.js +314 -0
- package/dist/internal/funding/Evidence.js.map +1 -0
- package/dist/internal/funding/Provider.d.ts +1186 -0
- package/dist/internal/funding/Provider.d.ts.map +1 -0
- package/dist/internal/funding/Provider.js +1081 -0
- package/dist/internal/funding/Provider.js.map +1 -0
- package/dist/internal/funding/Reconciliation.d.ts +113 -0
- package/dist/internal/funding/Reconciliation.d.ts.map +1 -0
- package/dist/internal/funding/Reconciliation.js +676 -0
- package/dist/internal/funding/Reconciliation.js.map +1 -0
- package/dist/internal/funding/Route.d.ts +21 -0
- package/dist/internal/funding/Route.d.ts.map +1 -0
- package/dist/internal/funding/Route.js +5 -0
- package/dist/internal/funding/Route.js.map +1 -0
- package/dist/internal/funding/Subsidy.d.ts +113 -0
- package/dist/internal/funding/Subsidy.d.ts.map +1 -0
- package/dist/internal/funding/Subsidy.js +138 -0
- package/dist/internal/funding/Subsidy.js.map +1 -0
- package/dist/internal/funding/Token.d.ts +41 -0
- package/dist/internal/funding/Token.d.ts.map +1 -0
- package/dist/internal/funding/Token.js +22 -0
- package/dist/internal/funding/Token.js.map +1 -0
- package/dist/internal/funding/Transfer.d.ts +643 -0
- package/dist/internal/funding/Transfer.d.ts.map +1 -0
- package/dist/internal/funding/Transfer.js +332 -0
- package/dist/internal/funding/Transfer.js.map +1 -0
- package/dist/internal/funding/index.d.ts +13 -0
- package/dist/internal/funding/index.d.ts.map +1 -0
- package/dist/internal/funding/index.js +13 -0
- package/dist/internal/funding/index.js.map +1 -0
- package/dist/internal/funding/providers/across.d.ts +21 -0
- package/dist/internal/funding/providers/across.d.ts.map +1 -0
- package/dist/internal/funding/providers/across.js +117 -0
- package/dist/internal/funding/providers/across.js.map +1 -0
- package/dist/internal/funding/providers/relay.d.ts +46 -0
- package/dist/internal/funding/providers/relay.d.ts.map +1 -0
- package/dist/internal/funding/providers/relay.js +464 -0
- package/dist/internal/funding/providers/relay.js.map +1 -0
- package/dist/internal/funding/providers/rhino.d.ts +15 -0
- package/dist/internal/funding/providers/rhino.d.ts.map +1 -0
- package/dist/internal/funding/providers/rhino.js +116 -0
- package/dist/internal/funding/providers/rhino.js.map +1 -0
- package/dist/internal/funding/providers/squid.d.ts +19 -0
- package/dist/internal/funding/providers/squid.d.ts.map +1 -0
- package/dist/internal/funding/providers/squid.js +120 -0
- package/dist/internal/funding/providers/squid.js.map +1 -0
- package/dist/internal/funding/providers/symbiosis.d.ts +20 -0
- package/dist/internal/funding/providers/symbiosis.d.ts.map +1 -0
- package/dist/internal/funding/providers/symbiosis.js +176 -0
- package/dist/internal/funding/providers/symbiosis.js.map +1 -0
- package/dist/internal/index.d.ts +5 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +5 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/webhookDestinations/url.js +61 -57
- package/dist/internal/webhookDestinations/url.js.map +1 -1
- package/dist/providers/index.d.ts +43 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +19 -0
- package/dist/providers/index.js.map +1 -0
- package/package.json +9 -4
- package/src/ApiKeys.test.ts +11 -7
- package/src/ApiKeys.ts +37 -9
- package/src/App.test.ts +85 -10
- package/src/App.ts +224 -137
- package/src/Assets.ts +29 -4
- package/src/Client.test-d.ts +650 -30
- package/src/Scope.test.ts +19 -0
- package/src/Scope.ts +28 -11
- package/src/Webhooks.test.ts +25 -0
- package/src/Webhooks.ts +1 -1
- package/src/admin/App.test.ts +9 -2
- package/src/admin/App.ts +32 -9
- package/src/admin/apps/api-keys.test.ts +167 -23
- package/src/admin/apps/api-keys.ts +166 -28
- package/src/admin/apps/earn-vaults.test.ts +338 -0
- package/src/admin/apps/earn-vaults.ts +572 -0
- package/src/admin/apps/scopes.test.ts +16 -1
- package/src/admin/ui/plugin.ts +2 -2
- package/src/admin/ui/src/components/EarnVaultForm.tsx +137 -0
- package/src/admin/ui/src/components/MobileProfile.tsx +2 -2
- package/src/admin/ui/src/components/Page.tsx +1 -1
- package/src/admin/ui/src/components/ThemeToggle.tsx +1 -1
- package/src/admin/ui/src/lib/api-keys.ts +37 -7
- package/src/admin/ui/src/lib/client.ts +1 -1
- package/src/admin/ui/src/lib/config.ts +1 -1
- package/src/admin/ui/src/lib/early-access.ts +8 -9
- package/src/admin/ui/src/lib/earn-vaults.ts +207 -0
- package/src/admin/ui/src/lib/format.ts +13 -0
- package/src/admin/ui/src/lib/organizations.test.ts +14 -4
- package/src/admin/ui/src/lib/organizations.ts +7 -1
- package/src/admin/ui/src/lib/response.ts +22 -0
- package/src/admin/ui/src/lib/scopes.test.ts +19 -11
- package/src/admin/ui/src/lib/scopes.ts +28 -7
- package/src/admin/ui/src/lib/verified-tokens.ts +10 -9
- package/src/admin/ui/src/routeTree.gen.ts +70 -7
- package/src/admin/ui/src/router.tsx +2 -2
- package/src/admin/ui/src/routes/__root.tsx +9 -8
- package/src/admin/ui/src/routes/api-keys.tsx +475 -64
- package/src/admin/ui/src/routes/early-access.tsx +5 -12
- package/src/admin/ui/src/routes/earn.vaults.tsx +348 -0
- package/src/admin/ui/src/routes/earn.vaults_.$vaultId.edit.tsx +154 -0
- package/src/admin/ui/src/routes/earn.vaults_.new.tsx +190 -0
- package/src/admin/ui/src/routes/organizations.tsx +4 -7
- package/src/admin/ui/src/routes/organizations_.$orgId.tsx +56 -54
- package/src/admin/ui/src/routes/verified-tokens.tsx +4 -4
- package/src/admin/ui/vite.config.ts +4 -1
- package/src/admin/ui.generated.ts +189 -95
- package/src/analytics/Analytics.test.ts +69 -10
- package/src/analytics/Analytics.ts +20 -1
- package/src/analytics/tables/requestEvents.ts +79 -37
- package/src/apps/Zones.test.ts +33 -0
- package/src/apps/Zones.ts +40 -0
- package/src/apps/composition.test.ts +84 -1
- package/src/apps/data/App.test.ts +38 -9
- package/src/apps/data/App.ts +96 -33
- package/src/apps/data/FxOracle.ts +1 -1
- package/src/apps/data/index.ts +0 -1
- package/src/apps/data/routes/activities.test.ts +82 -6
- package/src/apps/data/routes/activities.ts +131 -71
- package/src/apps/data/routes/balances.test.ts +50 -37
- package/src/apps/data/routes/balances.ts +5 -5
- package/src/apps/data/routes/blocks.test.ts +2 -0
- package/src/apps/data/routes/coingecko.test.ts +22 -0
- package/src/apps/data/routes/coingecko.ts +84 -48
- package/src/apps/data/routes/earn.test.ts +1108 -0
- package/src/apps/data/routes/earn.ts +1391 -0
- package/src/apps/data/routes/exchanges.test.ts +82 -33
- package/src/apps/data/routes/exchanges.ts +842 -227
- package/src/apps/data/routes/fee-amm.test.ts +4 -6
- package/src/apps/data/routes/fee-amm.ts +69 -12
- package/src/apps/data/routes/funding.test.ts +2712 -221
- package/src/apps/data/routes/funding.ts +1604 -387
- package/src/apps/data/routes/indexer.test.ts +43 -34
- package/src/apps/data/routes/indexer.ts +19 -2
- package/src/apps/data/routes/receipts.test.ts +5 -3
- package/src/apps/data/routes/receipts.ts +13 -11
- package/src/apps/data/routes/rpc.test.ts +446 -28
- package/src/apps/data/routes/rpc.ts +243 -25
- package/src/apps/data/routes/tokenlist.test.ts +15 -0
- package/src/apps/data/routes/tokenlist.ts +88 -22
- package/src/apps/data/routes/tokens.ts +262 -86
- package/src/apps/data/routes/transactions.test.ts +2 -0
- package/src/apps/data/routes/transactions.ts +77 -42
- package/src/apps/data/routes/transfers.test.ts +166 -4
- package/src/apps/data/routes/transfers.ts +216 -78
- package/src/apps/data/routes/valuation.test.ts +62 -9
- package/src/apps/data/routes/valuation.ts +2 -2
- package/src/apps/data/routes/verified-tokens.test.ts +51 -0
- package/src/apps/data/routes/verified-tokens.ts +52 -15
- package/src/apps/data/routes/webhooks.test.ts +432 -33
- package/src/apps/data/routes/webhooks.ts +189 -79
- package/src/apps/data/routes/zones.test.ts +473 -0
- package/src/apps/data/routes/zones.ts +338 -0
- package/src/apps/docs/reference.ts +8 -6
- package/src/apps/index.ts +2 -1
- package/src/apps/management/Billing.test.ts +29 -0
- package/src/apps/management/Billing.ts +23 -0
- package/src/apps/management/Error.ts +12 -0
- package/src/apps/management/routes/api-keys.test.ts +5 -3
- package/src/apps/management/routes/api-keys.ts +2 -9
- package/src/apps/management/routes/invitations.ts +4 -11
- package/src/apps/management/routes/orgs.ts +2 -9
- package/src/apps/management/routes/scopes.test.ts +7 -2
- package/src/apps/management/routes/scopes.ts +2 -2
- package/src/apps/management/routes/webhooks.test.ts +6 -1
- package/src/apps/management/routes/webhooks.ts +15 -3
- package/src/apps/mpp/App.ts +276 -29
- package/src/apps/mpp/Mpp.test.ts +631 -26
- package/src/apps/mpp/Mpp.ts +0 -42
- package/src/apps/mpp/internal/Adapter.ts +108 -3
- package/src/apps/mpp/internal/Error.test.ts +33 -0
- package/src/apps/mpp/internal/Error.ts +44 -6
- package/src/apps/mpp/internal/Idempotency.test.ts +213 -0
- package/src/apps/mpp/internal/Idempotency.ts +59 -5
- package/src/apps/mpp/internal/Policy.test.ts +122 -0
- package/src/apps/mpp/internal/Policy.ts +98 -0
- package/src/apps/mpp/internal/ScreenManager.test.ts +68 -0
- package/src/apps/mpp/internal/ScreenManager.ts +41 -0
- package/src/apps/mpp/internal/Screening.ts +40 -3
- package/src/apps/mpp/internal/Sponsorship.ts +144 -0
- package/src/apps/mpp/internal/Utils.ts +30 -0
- package/src/apps/relay/App.test.ts +495 -64
- package/src/apps/relay/App.ts +234 -24
- package/src/apps/relay/Sponsorships.test.ts +51 -0
- package/src/apps/relay/Sponsorships.ts +19 -7
- package/src/db/Db.ts +439 -0
- package/src/db/Schema.ts +325 -2
- package/src/db/tables/earnVaults.test.ts +185 -0
- package/src/db/tables/earnVaults.ts +151 -0
- package/src/db/tables/fundingCatalog.test.ts +108 -0
- package/src/db/tables/fundingCatalog.ts +157 -0
- package/src/db/tables/fundingDepositAddresses.test.ts +580 -0
- package/src/db/tables/fundingDepositAddresses.ts +376 -0
- package/src/db/tables/fundingDeposits.test.ts +261 -0
- package/src/db/tables/fundingDeposits.ts +229 -0
- package/src/db/tables/fundingIdempotency.test.ts +182 -0
- package/src/db/tables/fundingIdempotency.ts +180 -0
- package/src/db/tables/fundingTransferEvents.ts +28 -0
- package/src/db/tables/fundingTransferTransactions.test.ts +69 -0
- package/src/db/tables/fundingTransferTransactions.ts +37 -0
- package/src/db/tables/fundingTransfers.test.ts +89 -0
- package/src/db/tables/fundingTransfers.ts +153 -0
- package/src/db/tables/organizations.test.ts +88 -0
- package/src/db/tables/organizations.ts +42 -1
- package/src/db/tables/projects.ts +16 -0
- package/src/db/tables/requestUsage.ts +23 -0
- package/src/db/tables/sponsoredTransactions.test.ts +52 -2
- package/src/db/tables/sponsoredTransactions.ts +18 -6
- package/src/db/tables/users.ts +16 -0
- package/src/db/tables/verifiedTokens.ts +19 -14
- package/src/db/tables/webhookSubscriptions.ts +58 -3
- package/src/handlers/relay.test.ts +2 -0
- package/src/handlers/relay.ts +95 -99
- package/src/internal/Auth.test.ts +48 -0
- package/src/internal/Auth.ts +61 -2
- package/src/internal/Cache.ts +13 -9
- package/src/internal/Cursor.test.ts +2 -2
- package/src/internal/Cursor.ts +1 -1
- package/src/internal/EarnRates.test.ts +125 -0
- package/src/internal/EarnRates.ts +409 -0
- package/src/internal/EarnVaults.test.ts +195 -0
- package/src/internal/EarnVaults.ts +876 -0
- package/src/internal/EdgeCache.test.ts +37 -5
- package/src/internal/EdgeCache.ts +39 -7
- package/src/internal/Id.ts +14 -0
- package/src/internal/Idempotency.test.ts +109 -0
- package/src/internal/Idempotency.ts +237 -0
- package/src/internal/Log.test-d.ts +41 -8
- package/src/internal/Log.test.ts +189 -8
- package/src/internal/Log.ts +124 -17
- package/src/internal/MetricSink.test.ts +244 -4
- package/src/internal/MetricSink.ts +51 -1
- package/src/internal/OpenApi.ts +3 -0
- package/src/internal/Provider.test.ts +17 -0
- package/src/internal/Provider.ts +17 -0
- package/src/internal/Schema.test.ts +13 -0
- package/src/internal/Schema.ts +41 -24
- package/src/internal/Store.test.ts +25 -0
- package/src/internal/Store.ts +46 -0
- package/src/internal/Tidx.local.test.ts +78 -3
- package/src/internal/Tidx.test.ts +212 -18
- package/src/internal/Tidx.ts +112 -32
- package/src/internal/VerifiedTokens.test.ts +15 -0
- package/src/internal/Viem.test.ts +170 -17
- package/src/internal/Viem.ts +111 -28
- package/src/internal/WebhookDestination.ts +25 -23
- package/src/internal/Webhooks.test.ts +59 -0
- package/src/internal/Webhooks.ts +34 -10
- package/src/internal/exchange/Provider.test.ts +216 -0
- package/src/internal/exchange/Provider.ts +326 -0
- package/src/internal/exchange/index.test.ts +6 -0
- package/src/internal/exchange/index.ts +1 -0
- package/src/internal/exchange/providers/uniswap.test.ts +122 -0
- package/src/internal/exchange/providers/uniswap.ts +682 -0
- package/src/internal/funding/Action.test.ts +138 -0
- package/src/internal/funding/Action.ts +117 -0
- package/src/internal/funding/Catalog.test.ts +311 -0
- package/src/internal/funding/Catalog.ts +347 -0
- package/src/internal/funding/Chain.test.ts +79 -0
- package/src/internal/funding/Chain.ts +120 -0
- package/src/internal/funding/Deposit.test.ts +26 -0
- package/src/internal/funding/Deposit.ts +453 -0
- package/src/internal/funding/DepositAddress.test.ts +18 -0
- package/src/internal/funding/DepositAddress.ts +312 -0
- package/src/internal/funding/Evidence.test.ts +297 -0
- package/src/internal/funding/Evidence.ts +430 -0
- package/src/internal/funding/Provider.test.ts +1328 -0
- package/src/internal/funding/Provider.ts +1796 -0
- package/src/internal/funding/Reconciliation.local.test.ts +504 -0
- package/src/internal/funding/Reconciliation.test.ts +2020 -0
- package/src/internal/funding/Reconciliation.ts +930 -0
- package/src/internal/funding/Route.test.ts +66 -0
- package/src/internal/funding/Route.ts +29 -0
- package/src/internal/funding/Subsidy.local.test.ts +152 -0
- package/src/internal/funding/Subsidy.test.ts +75 -0
- package/src/internal/funding/Subsidy.ts +260 -0
- package/src/internal/funding/Token.test.ts +47 -0
- package/src/internal/funding/Token.ts +59 -0
- package/src/internal/funding/Transfer.test.ts +369 -0
- package/src/internal/funding/Transfer.ts +522 -0
- package/src/internal/funding/index.test.ts +20 -0
- package/src/internal/funding/index.ts +12 -0
- package/src/internal/funding/providers/across.ts +149 -0
- package/src/{apps/data/FundingQuoteProviders.test.ts → internal/funding/providers/index.test.ts} +178 -157
- package/src/internal/funding/providers/relay.test.ts +474 -0
- package/src/internal/funding/providers/relay.ts +559 -0
- package/src/internal/funding/providers/rhino.ts +139 -0
- package/src/internal/funding/providers/squid.ts +151 -0
- package/src/internal/funding/providers/symbiosis.ts +221 -0
- package/src/internal/index.test.ts +5 -1
- package/src/internal/index.ts +5 -1
- package/src/internal/webhookDestinations/url.ts +49 -45
- package/src/providers/index.test.ts +14 -0
- package/src/providers/index.ts +54 -0
- package/dist/apps/data/FundingQuoteProviders.d.ts +0 -174
- package/dist/apps/data/FundingQuoteProviders.d.ts.map +0 -1
- package/dist/apps/data/FundingQuoteProviders.js +0 -775
- package/dist/apps/data/FundingQuoteProviders.js.map +0 -1
- package/dist/internal/FundingQuotes.d.ts +0 -864
- package/dist/internal/FundingQuotes.d.ts.map +0 -1
- package/dist/internal/FundingQuotes.js +0 -672
- package/dist/internal/FundingQuotes.js.map +0 -1
- package/src/apps/data/FundingQuoteProviders.ts +0 -1043
- package/src/internal/FundingQuotes.test.ts +0 -456
- package/src/internal/FundingQuotes.ts +0 -944
package/src/{apps/data/FundingQuoteProviders.test.ts → internal/funding/providers/index.test.ts}
RENAMED
|
@@ -1,57 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as TestFunding from '../../../../test/Funding.js'
|
|
2
|
+
import * as FundingProvider from '../Provider.js'
|
|
3
|
+
import * as Across from './across.js'
|
|
4
|
+
import * as Relay from './relay.js'
|
|
5
|
+
import * as Rhino from './rhino.js'
|
|
6
|
+
import * as Squid from './squid.js'
|
|
7
|
+
import * as Symbiosis from './symbiosis.js'
|
|
3
8
|
|
|
4
9
|
const now = () => new Date('2026-01-01T00:00:00.000Z')
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
test('requires every Squid deployment binding when any is configured', () => {
|
|
26
|
-
expect(FundingQuoteProviders.configureSquid()).toBeUndefined()
|
|
27
|
-
expect(() =>
|
|
28
|
-
FundingQuoteProviders.configureSquid({ integratorId: 'squid-integrator-id' }),
|
|
29
|
-
).toThrowErrorMatchingInlineSnapshot(`[FundingQuoteProviders.ProviderConfigurationError]`)
|
|
30
|
-
expect(
|
|
31
|
-
FundingQuoteProviders.configureSquid({
|
|
32
|
-
integratorId: 'squid-integrator-id',
|
|
33
|
-
userAddress: '0x1111111111111111111111111111111111111111',
|
|
34
|
-
}),
|
|
35
|
-
).toEqual({
|
|
36
|
-
integratorId: 'squid-integrator-id',
|
|
37
|
-
userAddress: '0x1111111111111111111111111111111111111111',
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
test('configures Symbiosis only when its quote user is present', () => {
|
|
42
|
-
expect(FundingQuoteProviders.configureSymbiosis()).toBeUndefined()
|
|
43
|
-
expect(
|
|
44
|
-
FundingQuoteProviders.configureSymbiosis({
|
|
45
|
-
userAddress: '0x1111111111111111111111111111111111111111',
|
|
46
|
-
}),
|
|
47
|
-
).toEqual({ userAddress: '0x1111111111111111111111111111111111111111' })
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
test('maps successful Across quotes to available quote probes', async () => {
|
|
10
|
+
const providers = [
|
|
11
|
+
Across.across({
|
|
12
|
+
apiKey: 'across-api-key',
|
|
13
|
+
integratorId: '0xdead',
|
|
14
|
+
userAddress: '0x1111111111111111111111111111111111111111',
|
|
15
|
+
}),
|
|
16
|
+
Relay.relay({ userAddress: '0x1111111111111111111111111111111111111111' }),
|
|
17
|
+
Rhino.rhino(),
|
|
18
|
+
Squid.squid({
|
|
19
|
+
integratorId: 'squid-integrator-id',
|
|
20
|
+
userAddress: '0x1111111111111111111111111111111111111111',
|
|
21
|
+
}),
|
|
22
|
+
Symbiosis.symbiosis({ userAddress: '0x1111111111111111111111111111111111111111' }),
|
|
23
|
+
] as const
|
|
24
|
+
|
|
25
|
+
describe('funding providers', () => {
|
|
26
|
+
test('maps successful Across quotes to available quote results', async () => {
|
|
51
27
|
const requests: RecordedRequest[] = []
|
|
52
28
|
const candidate = quoteCandidate('across')
|
|
53
29
|
const fetch = recordingFetch(requests, async () => jsonResponse(acrossQuote(candidate)))
|
|
54
|
-
const
|
|
30
|
+
const provider = Across.across({
|
|
55
31
|
apiKey: 'across-api-key',
|
|
56
32
|
baseUrl: 'https://across.test/api/',
|
|
57
33
|
fetch,
|
|
@@ -60,7 +36,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
60
36
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
61
37
|
})
|
|
62
38
|
|
|
63
|
-
const result = await
|
|
39
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
64
40
|
|
|
65
41
|
expect(requests).toHaveLength(1)
|
|
66
42
|
expect(requests[0]?.url.pathname).toBe('/api/swap/approval')
|
|
@@ -82,8 +58,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
82
58
|
)
|
|
83
59
|
expect(result).toMatchObject({
|
|
84
60
|
expiresAt: '2026-01-01T00:01:00.000Z',
|
|
85
|
-
|
|
86
|
-
|
|
61
|
+
destinationAmountMin: '988000',
|
|
62
|
+
destinationAmount: '990000',
|
|
87
63
|
quality: {
|
|
88
64
|
estimatedSeconds: 2,
|
|
89
65
|
liquiditySource: 'providerQuote',
|
|
@@ -95,10 +71,10 @@ describe('FundingQuoteProviders', () => {
|
|
|
95
71
|
})
|
|
96
72
|
})
|
|
97
73
|
|
|
98
|
-
test('maps recognized Across quote errors to unavailable
|
|
74
|
+
test('maps recognized Across quote errors to unavailable results', async () => {
|
|
99
75
|
const candidate = quoteCandidate('across')
|
|
100
76
|
const fetch = recordingFetch([], async () => jsonResponse({ code: 'NO_ROUTE' }, 400))
|
|
101
|
-
const
|
|
77
|
+
const provider = Across.across({
|
|
102
78
|
apiKey: 'across-api-key',
|
|
103
79
|
fetch,
|
|
104
80
|
integratorId: '0xdead',
|
|
@@ -107,7 +83,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
107
83
|
})
|
|
108
84
|
|
|
109
85
|
await expect(
|
|
110
|
-
|
|
86
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
111
87
|
).resolves.toMatchObject({
|
|
112
88
|
quality: {
|
|
113
89
|
liquiditySource: 'providerQuote',
|
|
@@ -123,7 +99,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
123
99
|
const fetch = recordingFetch([], async () =>
|
|
124
100
|
jsonResponse({ ...acrossQuote(candidate), expectedOutputAmount: '0' }),
|
|
125
101
|
)
|
|
126
|
-
const
|
|
102
|
+
const provider = Across.across({
|
|
127
103
|
apiKey: 'across-api-key',
|
|
128
104
|
fetch,
|
|
129
105
|
integratorId: '0xdead',
|
|
@@ -132,21 +108,21 @@ describe('FundingQuoteProviders', () => {
|
|
|
132
108
|
})
|
|
133
109
|
|
|
134
110
|
await expect(
|
|
135
|
-
|
|
136
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
111
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
112
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
137
113
|
})
|
|
138
114
|
|
|
139
115
|
test('rejects invalid Across configuration', () => {
|
|
140
116
|
expect(() =>
|
|
141
|
-
|
|
117
|
+
Across.across({
|
|
142
118
|
apiKey: 'across-api-key',
|
|
143
119
|
integratorId: 'tempo',
|
|
144
120
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
145
121
|
}),
|
|
146
|
-
).toThrowErrorMatchingInlineSnapshot(`[
|
|
122
|
+
).toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderConfigurationError]`)
|
|
147
123
|
})
|
|
148
124
|
|
|
149
|
-
test('maps successful Relay quotes to available quote
|
|
125
|
+
test('maps successful Relay quotes to available quote results', async () => {
|
|
150
126
|
const requests: RecordedRequest[] = []
|
|
151
127
|
const candidate = quoteCandidate()
|
|
152
128
|
const fetch = recordingFetch(requests, async () =>
|
|
@@ -161,14 +137,14 @@ describe('FundingQuoteProviders', () => {
|
|
|
161
137
|
},
|
|
162
138
|
}),
|
|
163
139
|
)
|
|
164
|
-
const
|
|
140
|
+
const provider = Relay.relay({
|
|
165
141
|
apiKey: 'relay-api-key',
|
|
166
142
|
fetch,
|
|
167
143
|
now,
|
|
168
144
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
169
145
|
})
|
|
170
146
|
|
|
171
|
-
const result = await
|
|
147
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
172
148
|
|
|
173
149
|
expect(requests.map((request) => request.url.pathname)).toEqual(['/quote/v2'])
|
|
174
150
|
expect(new Headers(requests[0]?.init?.headers).get('x-api-key')).toBe('relay-api-key')
|
|
@@ -182,8 +158,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
182
158
|
user: '0x1111111111111111111111111111111111111111',
|
|
183
159
|
})
|
|
184
160
|
expect(result).toMatchObject({
|
|
185
|
-
|
|
186
|
-
|
|
161
|
+
destinationAmountMin: '980000',
|
|
162
|
+
destinationAmount: '990000',
|
|
187
163
|
quality: {
|
|
188
164
|
estimatedSeconds: 15,
|
|
189
165
|
liquiditySource: 'providerQuote',
|
|
@@ -195,11 +171,32 @@ describe('FundingQuoteProviders', () => {
|
|
|
195
171
|
})
|
|
196
172
|
})
|
|
197
173
|
|
|
198
|
-
test('
|
|
174
|
+
test('keeps Relay preparation available without an indicative quote wallet', async () => {
|
|
175
|
+
const provider = Relay.relay({ now })
|
|
176
|
+
const result = await provider.getQuote(
|
|
177
|
+
getQuoteInput(quoteCandidate()),
|
|
178
|
+
new AbortController().signal,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
expect(FundingProvider.canPrepareTransfer(provider)).toBe(true)
|
|
182
|
+
expect(result).toMatchInlineSnapshot(`
|
|
183
|
+
{
|
|
184
|
+
"quality": {
|
|
185
|
+
"liquiditySource": "providerQuote",
|
|
186
|
+
"sourceDetail": "relay:quote-v2:QUOTE_USER_NOT_CONFIGURED",
|
|
187
|
+
"tier": "unavailable",
|
|
188
|
+
},
|
|
189
|
+
"sampledAt": "2026-01-01T00:00:00.000Z",
|
|
190
|
+
"status": "unavailable",
|
|
191
|
+
}
|
|
192
|
+
`)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
test('maps successful Squid quotes to available quote results', async () => {
|
|
199
196
|
const requests: RecordedRequest[] = []
|
|
200
197
|
const candidate = quoteCandidate('squid')
|
|
201
198
|
const fetch = recordingFetch(requests, async () => jsonResponse(squidQuote(candidate)))
|
|
202
|
-
const
|
|
199
|
+
const provider = Squid.squid({
|
|
203
200
|
baseUrl: 'https://squid.test/v2/',
|
|
204
201
|
fetch,
|
|
205
202
|
integratorId: 'squid-integrator-id',
|
|
@@ -207,7 +204,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
207
204
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
208
205
|
})
|
|
209
206
|
|
|
210
|
-
const result = await
|
|
207
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
211
208
|
|
|
212
209
|
expect(requests).toHaveLength(1)
|
|
213
210
|
expect(requests[0]?.url.pathname).toBe('/v2/route')
|
|
@@ -226,8 +223,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
226
223
|
toToken: candidate.destinationToken.address,
|
|
227
224
|
})
|
|
228
225
|
expect(result).toEqual({
|
|
229
|
-
|
|
230
|
-
|
|
226
|
+
destinationAmountMin: '989622',
|
|
227
|
+
destinationAmount: '999620',
|
|
231
228
|
quality: {
|
|
232
229
|
estimatedSeconds: 10,
|
|
233
230
|
liquiditySource: 'providerQuote',
|
|
@@ -239,9 +236,9 @@ describe('FundingQuoteProviders', () => {
|
|
|
239
236
|
})
|
|
240
237
|
})
|
|
241
238
|
|
|
242
|
-
test('maps unavailable Squid routes to unavailable quote
|
|
239
|
+
test('maps unavailable Squid routes to unavailable quote results', async () => {
|
|
243
240
|
const candidate = quoteCandidate('squid')
|
|
244
|
-
const
|
|
241
|
+
const provider = Squid.squid({
|
|
245
242
|
fetch: recordingFetch([], async () =>
|
|
246
243
|
jsonResponse(
|
|
247
244
|
{
|
|
@@ -258,7 +255,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
258
255
|
})
|
|
259
256
|
|
|
260
257
|
await expect(
|
|
261
|
-
|
|
258
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
262
259
|
).resolves.toMatchObject({
|
|
263
260
|
quality: {
|
|
264
261
|
sourceDetail: 'squid:route-v2:AMOUNT_TOO_LOW',
|
|
@@ -268,18 +265,18 @@ describe('FundingQuoteProviders', () => {
|
|
|
268
265
|
})
|
|
269
266
|
})
|
|
270
267
|
|
|
271
|
-
test('maps successful Symbiosis quotes to available quote
|
|
268
|
+
test('maps successful Symbiosis quotes to available quote results', async () => {
|
|
272
269
|
const requests: RecordedRequest[] = []
|
|
273
270
|
const candidate = quoteCandidate('symbiosis')
|
|
274
271
|
const fetch = recordingFetch(requests, async () => jsonResponse(symbiosisQuote(candidate)))
|
|
275
|
-
const
|
|
272
|
+
const provider = Symbiosis.symbiosis({
|
|
276
273
|
baseUrl: 'https://symbiosis.test/crosschain/',
|
|
277
274
|
fetch,
|
|
278
275
|
now,
|
|
279
276
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
280
277
|
})
|
|
281
278
|
|
|
282
|
-
const result = await
|
|
279
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
283
280
|
|
|
284
281
|
expect(requests).toHaveLength(1)
|
|
285
282
|
expect(requests[0]?.url.pathname).toBe('/crosschain/v2/quote')
|
|
@@ -303,8 +300,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
303
300
|
},
|
|
304
301
|
})
|
|
305
302
|
expect(result).toEqual({
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
destinationAmountMin: '979000',
|
|
304
|
+
destinationAmount: '989000',
|
|
308
305
|
quality: {
|
|
309
306
|
estimatedSeconds: 18,
|
|
310
307
|
liquiditySource: 'providerQuote',
|
|
@@ -324,13 +321,13 @@ describe('FundingQuoteProviders', () => {
|
|
|
324
321
|
sourceToken: 'USDT',
|
|
325
322
|
})
|
|
326
323
|
const fetch = recordingFetch(requests, async () => jsonResponse(symbiosisQuote(candidate)))
|
|
327
|
-
const
|
|
324
|
+
const provider = Symbiosis.symbiosis({
|
|
328
325
|
fetch,
|
|
329
326
|
now,
|
|
330
327
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
331
328
|
})
|
|
332
329
|
|
|
333
|
-
await
|
|
330
|
+
await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
334
331
|
|
|
335
332
|
expect(jsonRequestBody(requests[0])).toMatchObject({
|
|
336
333
|
tokenAmountIn: {
|
|
@@ -355,21 +352,21 @@ describe('FundingQuoteProviders', () => {
|
|
|
355
352
|
tokenAmountOut: quote.tokenAmountOut,
|
|
356
353
|
tokenAmountOutMin: quote.tokenAmountOutMin,
|
|
357
354
|
}
|
|
358
|
-
const
|
|
355
|
+
const provider = Symbiosis.symbiosis({
|
|
359
356
|
fetch: recordingFetch([], async () => jsonResponse(response)),
|
|
360
357
|
now,
|
|
361
358
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
362
359
|
})
|
|
363
360
|
|
|
364
361
|
await expect(
|
|
365
|
-
|
|
366
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
362
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
363
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
367
364
|
})
|
|
368
365
|
|
|
369
366
|
test('enforces the Symbiosis provider quota before fetching', async () => {
|
|
370
367
|
const requests: RecordedRequest[] = []
|
|
371
368
|
const candidate = quoteCandidate('symbiosis')
|
|
372
|
-
const
|
|
369
|
+
const provider = Symbiosis.symbiosis({
|
|
373
370
|
fetch: recordingFetch(requests, async () => jsonResponse(symbiosisQuote(candidate))),
|
|
374
371
|
now,
|
|
375
372
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
@@ -377,34 +374,40 @@ describe('FundingQuoteProviders', () => {
|
|
|
377
374
|
|
|
378
375
|
await Promise.all(
|
|
379
376
|
Array.from({ length: 4 }, () =>
|
|
380
|
-
|
|
377
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
381
378
|
),
|
|
382
379
|
)
|
|
383
|
-
const cause = await
|
|
384
|
-
.
|
|
380
|
+
const cause = await provider
|
|
381
|
+
.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
385
382
|
.catch((error: unknown) => error)
|
|
386
383
|
|
|
387
384
|
expect(requests).toHaveLength(4)
|
|
388
385
|
expect(cause).toMatchObject({
|
|
389
|
-
name: '
|
|
386
|
+
name: 'FundingProvider.ProviderRateLimitError',
|
|
390
387
|
})
|
|
391
|
-
expect(
|
|
388
|
+
expect(
|
|
389
|
+
FundingProvider.failure({
|
|
390
|
+
cause,
|
|
391
|
+
operation: 'getQuote',
|
|
392
|
+
provider: getProvider('symbiosis'),
|
|
393
|
+
}),
|
|
394
|
+
).toEqual({
|
|
392
395
|
failure: 'rate_limit',
|
|
393
396
|
id: 'symbiosis',
|
|
394
|
-
operation: '
|
|
397
|
+
operation: 'getQuote',
|
|
395
398
|
})
|
|
396
399
|
})
|
|
397
400
|
|
|
398
|
-
test('maps unavailable Symbiosis routes to unavailable quote
|
|
401
|
+
test('maps unavailable Symbiosis routes to unavailable quote results', async () => {
|
|
399
402
|
const candidate = quoteCandidate('symbiosis')
|
|
400
|
-
const
|
|
403
|
+
const provider = Symbiosis.symbiosis({
|
|
401
404
|
fetch: recordingFetch([], async () => jsonResponse({ code: 'NO_ROUTE' }, 400)),
|
|
402
405
|
now,
|
|
403
406
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
404
407
|
})
|
|
405
408
|
|
|
406
409
|
await expect(
|
|
407
|
-
|
|
410
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
408
411
|
).resolves.toMatchObject({
|
|
409
412
|
quality: {
|
|
410
413
|
sourceDetail: 'symbiosis:quote-v2:NO_ROUTE',
|
|
@@ -414,9 +417,9 @@ describe('FundingQuoteProviders', () => {
|
|
|
414
417
|
})
|
|
415
418
|
})
|
|
416
419
|
|
|
417
|
-
test('maps Symbiosis fee-floor errors to unavailable quote
|
|
420
|
+
test('maps Symbiosis fee-floor errors to unavailable quote results', async () => {
|
|
418
421
|
const candidate = quoteCandidate('symbiosis')
|
|
419
|
-
const
|
|
422
|
+
const provider = Symbiosis.symbiosis({
|
|
420
423
|
fetch: recordingFetch([], async () =>
|
|
421
424
|
jsonResponse({ code: 0, message: 'Amount is too low to cover fees' }, 400),
|
|
422
425
|
),
|
|
@@ -425,7 +428,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
425
428
|
})
|
|
426
429
|
|
|
427
430
|
await expect(
|
|
428
|
-
|
|
431
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
429
432
|
).resolves.toMatchObject({
|
|
430
433
|
quality: {
|
|
431
434
|
sourceDetail: 'symbiosis:quote-v2:AMOUNT_TOO_LOW',
|
|
@@ -437,11 +440,11 @@ describe('FundingQuoteProviders', () => {
|
|
|
437
440
|
|
|
438
441
|
test('rejects invalid Symbiosis configuration', () => {
|
|
439
442
|
expect(() =>
|
|
440
|
-
|
|
441
|
-
).toThrowErrorMatchingInlineSnapshot(`[
|
|
443
|
+
Symbiosis.symbiosis({ userAddress: 'invalid' }),
|
|
444
|
+
).toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderConfigurationError]`)
|
|
442
445
|
})
|
|
443
446
|
|
|
444
|
-
test('maps successful Rhino quotes to available quote
|
|
447
|
+
test('maps successful Rhino quotes to available quote results', async () => {
|
|
445
448
|
const requests: RecordedRequest[] = []
|
|
446
449
|
const candidate = quoteCandidate('rhino')
|
|
447
450
|
const fetch = recordingFetch(requests, async () =>
|
|
@@ -455,13 +458,13 @@ describe('FundingQuoteProviders', () => {
|
|
|
455
458
|
token: 'USDC',
|
|
456
459
|
}),
|
|
457
460
|
)
|
|
458
|
-
const
|
|
461
|
+
const provider = Rhino.rhino({
|
|
459
462
|
baseUrl: 'https://rhino.test/bridge/',
|
|
460
463
|
fetch,
|
|
461
464
|
now,
|
|
462
465
|
})
|
|
463
466
|
|
|
464
|
-
const result = await
|
|
467
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
465
468
|
|
|
466
469
|
expect(requests).toHaveLength(1)
|
|
467
470
|
expect(requests[0]?.url.pathname).toBe('/bridge/quote/bridge-swap/public')
|
|
@@ -475,7 +478,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
475
478
|
tokenOut: 'USDC',
|
|
476
479
|
})
|
|
477
480
|
expect(result).toEqual({
|
|
478
|
-
|
|
481
|
+
destinationAmount: '983000',
|
|
479
482
|
quality: {
|
|
480
483
|
estimatedSeconds: 2,
|
|
481
484
|
liquiditySource: 'providerQuote',
|
|
@@ -487,15 +490,15 @@ describe('FundingQuoteProviders', () => {
|
|
|
487
490
|
})
|
|
488
491
|
})
|
|
489
492
|
|
|
490
|
-
test('maps unavailable Rhino routes to unavailable quote
|
|
493
|
+
test('maps unavailable Rhino routes to unavailable quote results', async () => {
|
|
491
494
|
const candidate = quoteCandidate('rhino')
|
|
492
|
-
const
|
|
495
|
+
const provider = Rhino.rhino({
|
|
493
496
|
fetch: recordingFetch([], async () => jsonResponse({ _tag: 'NoRouteFoundError' }, 404)),
|
|
494
497
|
now,
|
|
495
498
|
})
|
|
496
499
|
|
|
497
500
|
await expect(
|
|
498
|
-
|
|
501
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
499
502
|
).resolves.toMatchObject({
|
|
500
503
|
quality: {
|
|
501
504
|
sourceDetail: 'rhino:bridge-swap-public:NoRouteFoundError',
|
|
@@ -525,7 +528,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
525
528
|
|
|
526
529
|
for (const testCase of cases) {
|
|
527
530
|
const requests: RecordedRequest[] = []
|
|
528
|
-
const
|
|
531
|
+
const provider = Rhino.rhino({
|
|
529
532
|
fetch: recordingFetch(requests, async () =>
|
|
530
533
|
jsonResponse({
|
|
531
534
|
_tag: 'bridge',
|
|
@@ -540,8 +543,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
540
543
|
})
|
|
541
544
|
|
|
542
545
|
await expect(
|
|
543
|
-
|
|
544
|
-
).resolves.toMatchObject({
|
|
546
|
+
provider.getQuote(getQuoteInput(testCase.candidate), new AbortController().signal),
|
|
547
|
+
).resolves.toMatchObject({ destinationAmount: '983000', status: 'available' })
|
|
545
548
|
expect(requests[0]?.url.searchParams.get('chainIn')).toBe(testCase.chainIn)
|
|
546
549
|
expect(requests[0]?.url.searchParams.get('tokenOut')).toBe(testCase.tokenOut)
|
|
547
550
|
}
|
|
@@ -549,15 +552,15 @@ describe('FundingQuoteProviders', () => {
|
|
|
549
552
|
|
|
550
553
|
test('surfaces Rhino request decoding failures', async () => {
|
|
551
554
|
const candidate = quoteCandidate('rhino')
|
|
552
|
-
const
|
|
555
|
+
const provider = Rhino.rhino({
|
|
553
556
|
fetch: recordingFetch([], async () => jsonResponse({ _tag: 'HttpApiDecodeError' }, 400)),
|
|
554
557
|
now,
|
|
555
558
|
})
|
|
556
559
|
|
|
557
560
|
await expect(
|
|
558
|
-
|
|
561
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
559
562
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
|
560
|
-
`[
|
|
563
|
+
`[FundingProvider.ProviderResponseError: Provider request failed with status 400]`,
|
|
561
564
|
)
|
|
562
565
|
})
|
|
563
566
|
|
|
@@ -569,15 +572,15 @@ describe('FundingQuoteProviders', () => {
|
|
|
569
572
|
] as const
|
|
570
573
|
|
|
571
574
|
for (const failure of failures) {
|
|
572
|
-
const
|
|
575
|
+
const provider = Rhino.rhino({
|
|
573
576
|
fetch: recordingFetch([], async () => jsonResponse(failure.body, failure.status)),
|
|
574
577
|
now,
|
|
575
578
|
})
|
|
576
|
-
const cause = await
|
|
577
|
-
.
|
|
579
|
+
const cause = await provider
|
|
580
|
+
.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
578
581
|
.catch((error: unknown) => error)
|
|
579
582
|
expect(cause).toMatchObject({
|
|
580
|
-
name: '
|
|
583
|
+
name: 'FundingProvider.ProviderResponseError',
|
|
581
584
|
status: failure.status,
|
|
582
585
|
})
|
|
583
586
|
}
|
|
@@ -585,7 +588,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
585
588
|
|
|
586
589
|
test('rejects mismatched Rhino quote payloads', async () => {
|
|
587
590
|
const candidate = quoteCandidate('rhino')
|
|
588
|
-
const
|
|
591
|
+
const provider = Rhino.rhino({
|
|
589
592
|
fetch: recordingFetch([], async () =>
|
|
590
593
|
jsonResponse({
|
|
591
594
|
_tag: 'bridge',
|
|
@@ -600,13 +603,13 @@ describe('FundingQuoteProviders', () => {
|
|
|
600
603
|
})
|
|
601
604
|
|
|
602
605
|
await expect(
|
|
603
|
-
|
|
604
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
606
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
607
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
605
608
|
})
|
|
606
609
|
|
|
607
610
|
test('rejects non-representable Rhino output precision', async () => {
|
|
608
611
|
const candidate = quoteCandidate('rhino')
|
|
609
|
-
const
|
|
612
|
+
const provider = Rhino.rhino({
|
|
610
613
|
fetch: recordingFetch([], async () =>
|
|
611
614
|
jsonResponse({
|
|
612
615
|
_tag: 'bridge',
|
|
@@ -621,8 +624,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
621
624
|
})
|
|
622
625
|
|
|
623
626
|
await expect(
|
|
624
|
-
|
|
625
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
627
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
628
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
626
629
|
})
|
|
627
630
|
|
|
628
631
|
test('calls the runtime fetch method with its global receiver', async () => {
|
|
@@ -641,13 +644,13 @@ describe('FundingQuoteProviders', () => {
|
|
|
641
644
|
vi.stubGlobal('fetch', fetch)
|
|
642
645
|
|
|
643
646
|
try {
|
|
644
|
-
const
|
|
647
|
+
const provider = Relay.relay({
|
|
645
648
|
now,
|
|
646
649
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
647
650
|
})
|
|
648
|
-
const result = await
|
|
651
|
+
const result = await provider.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
649
652
|
|
|
650
|
-
expect(result.
|
|
653
|
+
expect(result.destinationAmount).toBe('990000')
|
|
651
654
|
expect(fetch).toHaveBeenCalledTimes(1)
|
|
652
655
|
} finally {
|
|
653
656
|
vi.unstubAllGlobals()
|
|
@@ -692,7 +695,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
692
695
|
const candidate = quoteCandidate('across')
|
|
693
696
|
const body = acrossQuote(candidate)
|
|
694
697
|
mutate(body)
|
|
695
|
-
const
|
|
698
|
+
const provider = Across.across({
|
|
696
699
|
apiKey: 'across-api-key',
|
|
697
700
|
fetch: recordingFetch([], async () => jsonResponse(body)),
|
|
698
701
|
integratorId: '0xdead',
|
|
@@ -701,8 +704,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
701
704
|
})
|
|
702
705
|
|
|
703
706
|
await expect(
|
|
704
|
-
|
|
705
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
707
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
708
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
706
709
|
})
|
|
707
710
|
|
|
708
711
|
const invalidSquidQuotes = [
|
|
@@ -751,7 +754,7 @@ describe('FundingQuoteProviders', () => {
|
|
|
751
754
|
const candidate = quoteCandidate('squid')
|
|
752
755
|
const body = squidQuote(candidate)
|
|
753
756
|
mutate(body)
|
|
754
|
-
const
|
|
757
|
+
const provider = Squid.squid({
|
|
755
758
|
fetch: recordingFetch([], async () => jsonResponse(body)),
|
|
756
759
|
integratorId: 'squid-integrator-id',
|
|
757
760
|
now,
|
|
@@ -759,8 +762,8 @@ describe('FundingQuoteProviders', () => {
|
|
|
759
762
|
})
|
|
760
763
|
|
|
761
764
|
await expect(
|
|
762
|
-
|
|
763
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
765
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
766
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
764
767
|
})
|
|
765
768
|
|
|
766
769
|
const invalidSymbiosisQuotes = [
|
|
@@ -819,20 +822,20 @@ describe('FundingQuoteProviders', () => {
|
|
|
819
822
|
const candidate = quoteCandidate('symbiosis')
|
|
820
823
|
const body = symbiosisQuote(candidate)
|
|
821
824
|
mutate(body)
|
|
822
|
-
const
|
|
825
|
+
const provider = Symbiosis.symbiosis({
|
|
823
826
|
fetch: recordingFetch([], async () => jsonResponse(body)),
|
|
824
827
|
now,
|
|
825
828
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
826
829
|
})
|
|
827
830
|
|
|
828
831
|
await expect(
|
|
829
|
-
|
|
830
|
-
).rejects.toThrowErrorMatchingInlineSnapshot(`[
|
|
832
|
+
provider.getQuote(getQuoteInput(candidate), new AbortController().signal),
|
|
833
|
+
).rejects.toThrowErrorMatchingInlineSnapshot(`[FundingProvider.ProviderPayloadError]`)
|
|
831
834
|
})
|
|
832
835
|
|
|
833
836
|
test('returns bounded Across failure diagnostics', async () => {
|
|
834
837
|
const candidate = quoteCandidate('across')
|
|
835
|
-
const
|
|
838
|
+
const provider = Across.across({
|
|
836
839
|
apiKey: 'across-api-key',
|
|
837
840
|
fetch: recordingFetch([], async () =>
|
|
838
841
|
jsonResponse({ apiKey: 'secret', code: 'UNAUTHORIZED' }, 401),
|
|
@@ -841,55 +844,64 @@ describe('FundingQuoteProviders', () => {
|
|
|
841
844
|
now,
|
|
842
845
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
843
846
|
})
|
|
844
|
-
const cause = await
|
|
845
|
-
.
|
|
847
|
+
const cause = await provider
|
|
848
|
+
.getQuote(getQuoteInput(candidate), new AbortController().signal)
|
|
846
849
|
.catch((error: unknown) => error)
|
|
847
850
|
|
|
848
|
-
expect(
|
|
851
|
+
expect(
|
|
852
|
+
FundingProvider.failure({
|
|
853
|
+
cause,
|
|
854
|
+
operation: 'getQuote',
|
|
855
|
+
provider: getProvider('across'),
|
|
856
|
+
}),
|
|
857
|
+
).toEqual({
|
|
849
858
|
code: 'UNAUTHORIZED',
|
|
850
859
|
failure: 'http',
|
|
851
860
|
id: 'across',
|
|
852
|
-
operation: '
|
|
861
|
+
operation: 'getQuote',
|
|
853
862
|
status: 401,
|
|
854
863
|
})
|
|
855
864
|
})
|
|
856
865
|
|
|
857
866
|
test('returns explicit timeout failure diagnostics', () => {
|
|
858
867
|
expect(
|
|
859
|
-
|
|
860
|
-
cause: new
|
|
861
|
-
|
|
868
|
+
FundingProvider.failure({
|
|
869
|
+
cause: new FundingProvider.ProviderTimeoutError(),
|
|
870
|
+
operation: 'getQuote',
|
|
871
|
+
provider: getProvider('across'),
|
|
862
872
|
}),
|
|
863
873
|
).toEqual({
|
|
864
874
|
failure: 'timeout',
|
|
865
875
|
id: 'across',
|
|
866
|
-
operation: '
|
|
876
|
+
operation: 'getQuote',
|
|
867
877
|
})
|
|
868
878
|
})
|
|
869
879
|
|
|
870
880
|
test('returns bounded Squid failure diagnostics', () => {
|
|
871
881
|
expect(
|
|
872
|
-
|
|
882
|
+
FundingProvider.failure({
|
|
873
883
|
cause: new TypeError('network failure'),
|
|
874
|
-
|
|
884
|
+
operation: 'getQuote',
|
|
885
|
+
provider: getProvider('squid'),
|
|
875
886
|
}),
|
|
876
887
|
).toEqual({
|
|
877
888
|
failure: 'network',
|
|
878
889
|
id: 'squid',
|
|
879
|
-
operation: '
|
|
890
|
+
operation: 'getQuote',
|
|
880
891
|
})
|
|
881
892
|
})
|
|
882
893
|
|
|
883
894
|
test('returns bounded Symbiosis failure diagnostics', () => {
|
|
884
895
|
expect(
|
|
885
|
-
|
|
896
|
+
FundingProvider.failure({
|
|
886
897
|
cause: new TypeError('network failure'),
|
|
887
|
-
|
|
898
|
+
operation: 'getQuote',
|
|
899
|
+
provider: getProvider('symbiosis'),
|
|
888
900
|
}),
|
|
889
901
|
).toEqual({
|
|
890
902
|
failure: 'network',
|
|
891
903
|
id: 'symbiosis',
|
|
892
|
-
operation: '
|
|
904
|
+
operation: 'getQuote',
|
|
893
905
|
})
|
|
894
906
|
})
|
|
895
907
|
})
|
|
@@ -900,12 +912,14 @@ type RecordedRequest = {
|
|
|
900
912
|
}
|
|
901
913
|
|
|
902
914
|
function quoteCandidate(
|
|
903
|
-
provider:
|
|
915
|
+
provider: FundingProvider.ProviderId = 'relay',
|
|
904
916
|
options: quoteCandidate.Options = {},
|
|
905
|
-
):
|
|
906
|
-
const [candidate] =
|
|
917
|
+
): FundingProvider.getQuote.Parameters['candidate'] {
|
|
918
|
+
const [candidate] = FundingProvider.getQuoteCandidates({
|
|
919
|
+
catalog: TestFunding.snapshot,
|
|
907
920
|
destinationToken: options.destinationToken,
|
|
908
921
|
provider,
|
|
922
|
+
providers,
|
|
909
923
|
sourceAmount: '1000000',
|
|
910
924
|
sourceAmountUnits: 'baseUnits',
|
|
911
925
|
sourceChain: options.sourceChain ?? 'base',
|
|
@@ -915,6 +929,12 @@ function quoteCandidate(
|
|
|
915
929
|
return candidate
|
|
916
930
|
}
|
|
917
931
|
|
|
932
|
+
function getProvider(id: FundingProvider.ProviderId) {
|
|
933
|
+
const provider = providers.find((entry) => entry.id === id)
|
|
934
|
+
if (!provider) throw new Error(`Missing ${id} provider`)
|
|
935
|
+
return provider
|
|
936
|
+
}
|
|
937
|
+
|
|
918
938
|
declare namespace quoteCandidate {
|
|
919
939
|
type Options = {
|
|
920
940
|
destinationToken?: string | undefined
|
|
@@ -923,7 +943,7 @@ declare namespace quoteCandidate {
|
|
|
923
943
|
}
|
|
924
944
|
}
|
|
925
945
|
|
|
926
|
-
function acrossQuote(candidate:
|
|
946
|
+
function acrossQuote(candidate: FundingProvider.getQuote.Parameters['candidate']) {
|
|
927
947
|
return {
|
|
928
948
|
amountType: 'exactInput',
|
|
929
949
|
expectedFillTime: 2,
|
|
@@ -946,7 +966,7 @@ function acrossQuote(candidate: FundingQuotes.QuoteProbeInput['candidate']) {
|
|
|
946
966
|
}
|
|
947
967
|
}
|
|
948
968
|
|
|
949
|
-
function squidQuote(candidate:
|
|
969
|
+
function squidQuote(candidate: FundingProvider.getQuote.Parameters['candidate']) {
|
|
950
970
|
return {
|
|
951
971
|
route: {
|
|
952
972
|
estimate: {
|
|
@@ -969,7 +989,7 @@ function squidQuote(candidate: FundingQuotes.QuoteProbeInput['candidate']) {
|
|
|
969
989
|
}
|
|
970
990
|
}
|
|
971
991
|
|
|
972
|
-
function symbiosisQuote(candidate:
|
|
992
|
+
function symbiosisQuote(candidate: FundingProvider.getQuote.Parameters['candidate']) {
|
|
973
993
|
const source =
|
|
974
994
|
candidate.sourceChain.kind === 'tron'
|
|
975
995
|
? {
|
|
@@ -1004,9 +1024,9 @@ function symbiosisQuote(candidate: FundingQuotes.QuoteProbeInput['candidate']) {
|
|
|
1004
1024
|
}
|
|
1005
1025
|
}
|
|
1006
1026
|
|
|
1007
|
-
function
|
|
1008
|
-
candidate:
|
|
1009
|
-
):
|
|
1027
|
+
function getQuoteInput(
|
|
1028
|
+
candidate: FundingProvider.getQuote.Parameters['candidate'],
|
|
1029
|
+
): FundingProvider.getQuote.Parameters {
|
|
1010
1030
|
return {
|
|
1011
1031
|
candidate,
|
|
1012
1032
|
cache: { bypass: false },
|
|
@@ -1019,6 +1039,7 @@ function probeInput(
|
|
|
1019
1039
|
sourceChain: candidate.sourceChain.id,
|
|
1020
1040
|
sourceToken: candidate.sourceToken.symbol,
|
|
1021
1041
|
},
|
|
1042
|
+
route: candidate.route,
|
|
1022
1043
|
sourceAmount: candidate.sourceAmount,
|
|
1023
1044
|
sourceChain: candidate.sourceChain,
|
|
1024
1045
|
sourceToken: candidate.sourceToken,
|