@coinlist-co/react 0.12.2-rc.726778a → 0.12.2-rc.818bed6

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.
Files changed (31) hide show
  1. package/dist/{chunk-C6F5FOFP.js → chunk-2HCSM3FB.js} +52 -19
  2. package/dist/chunk-2HCSM3FB.js.map +1 -0
  3. package/dist/{chunk-3UQPCAU4.js → chunk-OUFI3D3Q.js} +84 -4
  4. package/dist/chunk-OUFI3D3Q.js.map +1 -0
  5. package/dist/{chunk-IRV5YU42.js → chunk-YMDYLYL3.js} +941 -442
  6. package/dist/chunk-YMDYLYL3.js.map +1 -0
  7. package/dist/client/index.cjs +12358 -8385
  8. package/dist/client/index.cjs.map +1 -1
  9. package/dist/client/index.d.cts +1965 -227
  10. package/dist/client/index.d.ts +1965 -227
  11. package/dist/client/index.js +8766 -5370
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/server/index.cjs +842 -142
  14. package/dist/server/index.cjs.map +1 -1
  15. package/dist/server/index.d.cts +72 -41
  16. package/dist/server/index.d.ts +72 -41
  17. package/dist/server/index.js +323 -65
  18. package/dist/server/index.js.map +1 -1
  19. package/dist/{tokens-namespace-CIWBtgt2.d.cts → time-DJU6E8KK.d.cts} +943 -192
  20. package/dist/{tokens-namespace-CIWBtgt2.d.ts → time-DJU6E8KK.d.ts} +943 -192
  21. package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-B0xCp3GD.d.cts} +74 -8
  22. package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-DGG5N27C.d.ts} +74 -8
  23. package/dist/universal/index.cjs +1022 -440
  24. package/dist/universal/index.cjs.map +1 -1
  25. package/dist/universal/index.d.cts +88 -5
  26. package/dist/universal/index.d.ts +88 -5
  27. package/dist/universal/index.js +46 -2
  28. package/package.json +1 -1
  29. package/dist/chunk-3UQPCAU4.js.map +0 -1
  30. package/dist/chunk-C6F5FOFP.js.map +0 -1
  31. package/dist/chunk-IRV5YU42.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { au as PaginationParams, av as PaginatedResponse, aw as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, p as Bps, ax as SwapStatus, a0 as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, ay as Uint256, h as AssetSymbol, q as EvmWalletAddress, az as KnownAssetSymbol, y as Erc20Asset, aA as Newtype } from '../tokens-namespace-CIWBtgt2.cjs';
2
- export { aB as AllowWalletParams, aC as AllowWalletResponse, aD as Asset, aE as AssetCode, e as AssetId, A as AuthorizationCode, aF as Blockchain, a1 as BuildOndoBuyParams, a2 as BuildOndoSellParams, aG as BuildOndoSwapParamsCore, aH as Chain, ar as ClientCredentialsOAuth, aI as ClientId, as as ClientSecret, aJ as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, aK as CoinListTokenSaleOffer, H as CoinListTokenSaleOfferDetail, u as Config, aL as ConnectExternalWalletParams, aM as CreateKycTokenParams, aN as CreateParticipationParams, aO as CreateWalletOwnershipChallengeParams, aP as Cursor, a8 as DebugEvent, aQ as DocumentFormType, Y as DocumentSubmission, aR as DocumentSubmissionStatus, aS as DocumentType, aT as ETHEREUM_CHAINS, E as Erc20Namespace, aU as Erc20NamespaceImpl, aV as FaqItem, a9 as FrontlineEventId, aW as GetOndoQuoteParams, aX as GetOndoTradingStatusParams, aY as GetSwapAuthorizationParams, aZ as GetSwapPreviewParams, a_ as GetTokenAllowanceParams, a$ as GetTokenBalanceParams, b0 as HexEncodedTransactionData, aa as HttpError, ab as HttpResponse, b1 as Isin, b2 as Iso2CountryCode, X as KycLevelName, ac as KycToken, b3 as Link, b4 as ListOptionAddressesParams, ad as LogBinding, ae as LogBindings, af as LogCause, ag as LogLevel, ah as LogScope, ai as LogValue, L as Logger, b5 as MAX_ASSET_DECIMALS, b6 as MAX_UINT_256, b7 as Milestone, v as OAuthAccessToken, b8 as OAuthRefreshToken, aq as OAuthSession, J as Offer, b9 as OfferBase, z as OfferDetail, ba as OfferDetailBase, bb as OfferEditorial, O as OfferId, bc as OfferOption, Q as OfferOptionAddress, a6 as OfferOptionAddressId, d as OfferOptionId, bd as OfferOptionSlug, be as OfferSlug, bf as OfferToken, F as OfferType, w as OffersNamespace, bg as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a3 as OndoQuote, bh as OndoQuoteDuration, a4 as OndoQuoteSize, bi as OndoSellOutcome, bj as OndoSwapOffer, G as OndoSwapOfferDetail, l as OndoSwapTransactionCore, $ as OndoTradingStatus, m as OrderBookSide, bk as PKCEState, bl as PaginatedResponseDto, P as Participation, bm as ParticipationId, bn as ParticipationStatus, bo as ParticipationsPaginationParams, bp as PauseFlags, bq as Pii, br as PiiAddress, bs as PiiJurisdiction, bt as PiiKind, _ as PinoLoggerOptions, aj as ProductionLogLevel, bu as QueryParamValue, bv as QueryParamValues, ak as RedactedWalletError, bw as RedirectUri, bx as RemoveOptionAddressParams, al as RequestId, s as Requirement, by as RequirementActionNeededReason, V as RequirementId, K as RequirementStatusInfo, N as RequirementStatusValue, M as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bz as RpcConfig, am as RpcFailureReason, bA as SOLANA_CHAINS, bB as STABLE_DECIMALS, an as SafeEvent, ao as SafeFields, bC as SolanaChain, bD as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bE as SuperstateSwapOffer, I as SuperstateSwapOfferDetail, bF as SwapContractRef, bG as SwapPreview, bH as TermItem, bI as Ticker, a5 as TokenIdentifier, a7 as TokenLogo, bJ as TokenLogoImage, bK as TokenLogoUrl, D as TokenMetadata, bL as TokenRole, T as TokensNamespace, bM as TokensNamespaceImpl, bN as Tx, ap as UnredactedFields, bO as WalletAddress, Z as WalletChallengeType, W as WalletError, bP as WalletOwnershipChallenge, bQ as WalletProtocol, o as WalletsNamespace, bR as WalletsNamespaceImpl, bS as apiErrorCode, bT as assertUint256, bU as isChain, bV as isOfferType, bW as parseUint256 } from '../tokens-namespace-CIWBtgt2.cjs';
3
- import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, e as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-CqI6dXM_.cjs';
4
- export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, d as EvmSigner, E as EvmWallet, P as PKCEConfig, f as PKCEParams, c as TokenRegistrySnapshot, W as WriteContractParams, g as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-CqI6dXM_.cjs';
1
+ import { aK as PaginationParams, aL as PaginatedResponse, B as BlockchainAmount, a as EthereumChain, b as EvmContractAddress, K as TokenMetadata, aN as OfferToken, M as CentrifugeVaultOfferDetail, G as DecimalString, H as StablecoinSymbol, o as OndoBuyTransaction, p as OndoSellTransaction, ar as HttpError, u as Bps, aO as SwapStatus, aa as AssetDecimals, n as OfferSwapContract, aP as Uint256, d as AssetSymbol, v as EvmWalletAddress, aQ as KnownAssetSymbol, I as Erc20Asset, aR as Newtype } from '../time-DJU6E8KK.cjs';
2
+ export { aS as AllowWalletParams, aT as AllowWalletResponse, aU as Asset, aV as AssetCode, k as AssetId, $ as AsyncOfferDetail, _ as AsyncOfferType, A as AuthorizationCode, aW as Blockchain, ab as BuildCentrifugeVaultBuyParams, ag as BuildOndoBuyParams, ah as BuildOndoSellParams, aX as BuildOndoSwapParamsCore, f as CentrifugeClaimDirection, c as CentrifugeNamespace, g as CentrifugeNamespaceImpl, ad as CentrifugeOrderReason, ae as CentrifugeOrderability, aY as CentrifugePositionStatus, e as CentrifugeVaultBuyTransaction, aZ as CentrifugeVaultClaimProceedsTransaction, a_ as CentrifugeVaultClaimTransaction, al as CentrifugeVaultLeg, Y as CentrifugeVaultLegId, a$ as CentrifugeVaultOffer, b0 as CentrifugeVaultPosition, ac as CentrifugeVaultQuote, b1 as CentrifugeVaultReason, b2 as CentrifugeVaultRedeemPosition, an as CentrifugeVaultStatus, b3 as CentrifugeVaultTransactionCore, b4 as CentrifugeWalletParams, b5 as Chain, aI as ClientCredentialsOAuth, b6 as ClientId, aM as ClientSecret, b7 as CodeChallenge, C as CodeVerifier, h as CoinListTokenSaleNamespace, l as CoinListTokenSaleNamespaceImpl, b8 as CoinListTokenSaleOffer, V as CoinListTokenSaleOfferDetail, z as Config, b9 as ConnectExternalWalletParams, ba as CreateKycTokenParams, bb as CreateParticipationParams, bc as CreateWalletOwnershipChallengeParams, bd as Cursor, ap as DebugEvent, be as DocumentFormType, a7 as DocumentSubmission, bf as DocumentSubmissionStatus, bg as DocumentType, bh as ETHEREUM_CHAINS, bi as EpochMillis, E as Erc20Namespace, bj as Erc20NamespaceImpl, bk as FaqItem, aq as FrontlineEventId, bl as GetCentrifugeVaultQuoteParams, bm as GetCentrifugeVaultStatusParams, bn as GetOndoQuoteParams, bo as GetOndoTradingStatusParams, bp as GetSwapAuthorizationParams, bq as GetSwapPreviewParams, br as GetTokenAllowanceParams, bs as GetTokenBalanceParams, bt as HexEncodedTransactionData, as as HttpResponse, bu as Isin, bv as Iso2CountryCode, a6 as KycLevelName, at as KycToken, bw as Link, bx as ListOptionAddressesParams, au as LogBinding, av as LogBindings, aw as LogCause, ax as LogLevel, ay as LogScope, az as LogValue, L as Logger, by as MAX_ASSET_DECIMALS, bz as MAX_UINT_256, bA as Milestone, bB as Millis, D as OAuthAccessToken, bC as OAuthRefreshToken, aH as OAuthSession, a0 as Offer, bD as OfferBase, J as OfferDetail, bE as OfferDetailBase, bF as OfferEditorial, i as OfferId, bG as OfferOption, a4 as OfferOptionAddress, am as OfferOptionAddressId, j as OfferOptionId, bH as OfferOptionSlug, bI as OfferSlug, N as OfferType, O as OfferVaultContract, F as OffersNamespace, bJ as OffersNamespaceImpl, m as OndoNamespace, s as OndoNamespaceImpl, ai as OndoQuote, bK as OndoQuoteDuration, aj as OndoQuoteSize, bL as OndoSellOutcome, bM as OndoSwapOffer, Q as OndoSwapOfferDetail, q as OndoSwapTransactionCore, af as OndoTradingStatus, r as OrderBookSide, bN as PKCEState, bO as PaginatedResponseDto, P as Participation, bP as ParticipationId, bQ as ParticipationStatus, bR as ParticipationsPaginationParams, bS as PauseFlags, bT as Pii, bU as PiiAddress, bV as PiiJurisdiction, bW as PiiKind, a9 as PinoLoggerOptions, aA as ProductionLogLevel, bX as QueryParamValue, bY as QueryParamValues, aB as RedactedWalletError, bZ as RedirectUri, b_ as RemoveOptionAddressParams, aC as RequestId, x as Requirement, b$ as RequirementActionNeededReason, a5 as RequirementId, a1 as RequirementStatusInfo, a3 as RequirementStatusValue, a2 as RequirementType, R as RequirementsNamespace, y as RequirementsNamespaceImpl, c0 as RpcConfig, aD as RpcFailureReason, c1 as SOLANA_CHAINS, c2 as STABLE_DECIMALS, aE as SafeEvent, aF as SafeFields, Z as Seconds, c3 as SolanaChain, c4 as SubmitDocumentParams, S as SuperstateSwapNamespace, w as SuperstateSwapNamespaceImpl, c5 as SuperstateSwapOffer, X as SuperstateSwapOfferDetail, c6 as SwapContractRef, c7 as SwapPreview, c8 as TermItem, c9 as Ticker, ak as TokenIdentifier, ao as TokenLogo, ca as TokenLogoImage, cb as TokenLogoUrl, cc as TokenRole, T as TokensNamespace, cd as TokensNamespaceImpl, ce as Tx, aG as UnredactedFields, cf as WalletAddress, a8 as WalletChallengeType, W as WalletError, cg as WalletOwnershipChallenge, ch as WalletProtocol, t as WalletsNamespace, ci as WalletsNamespaceImpl, cj as apiErrorCode, ck as assertUint256, cl as isChain, cm as isExpired, cn as isOfferType, co as parseUint256 } from '../time-DJU6E8KK.cjs';
3
+ import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, h as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-B0xCp3GD.cjs';
4
+ export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, e as EvmSigner, E as EvmWallet, f as ExternalWalletAdapter, P as PKCEConfig, i as PKCEParams, d as TokenRegistrySnapshot, c as WalletLabelResolver, W as WalletSelection, g as WriteContractParams, j as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-B0xCp3GD.cjs';
5
5
  import { TransactionReceipt, Hash, Chain } from 'viem';
6
6
 
7
7
  /**
@@ -15,6 +15,69 @@ import { TransactionReceipt, Hash, Chain } from 'viem';
15
15
  */
16
16
  declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>(fetchPage: (params: P) => Promise<PaginatedResponse<A>>, baseParams?: Omit<P, keyof PaginationParams>): Promise<A[]>;
17
17
 
18
+ /**
19
+ * How often the Centrifuge checkout refreshes what it is allowed to poll: the
20
+ * vault status and the indicative quote. Both are free - neither spends an
21
+ * attestation - so this is paced for a gate the user can trust rather than
22
+ * for cost.
23
+ *
24
+ * There is no quote TTL beside this. A Centrifuge quote does not expire: it
25
+ * is indicative, the fund prices fulfilment later, and a countdown would
26
+ * imply a commitment the API does not make.
27
+ */
28
+ declare const CENTRIFUGE_POLL_INTERVAL_MS = 15000;
29
+ /**
30
+ * The spend the asset panel prices while the user has not confirmed an amount:
31
+ * 100 USDC.
32
+ *
33
+ * A fixed size so typing in the amount field does not restart this poll. The
34
+ * review step polls a quote for the confirmed spend, which is the estimate it
35
+ * shows.
36
+ */
37
+ declare const CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT: BlockchainAmount;
38
+
39
+ /**
40
+ * One chain a vault offer runs on, with everything a screen needs to read and
41
+ * show a position there: the proxy every request and claim goes through, the
42
+ * share token it issues, and the funding token it is paid in.
43
+ *
44
+ * The share token's `symbol` is what every `/v1/centrifuge/vault/*` call is
45
+ * keyed by.
46
+ */
47
+ type CentrifugeVault = {
48
+ chain: EthereumChain;
49
+ proxy: EvmContractAddress;
50
+ share: TokenMetadata;
51
+ funding: TokenMetadata;
52
+ };
53
+ /**
54
+ * The vaults an offer runs on, or why a chain could not be resolved: one
55
+ * entry per `vaultContracts` chain, in the offer's order.
56
+ */
57
+ type CentrifugeVaultResolution = {
58
+ type: 'resolved';
59
+ vault: CentrifugeVault;
60
+ } | {
61
+ type: 'unresolved';
62
+ chain: OfferToken['chain'];
63
+ /** Which token the offer or the registry could not name. */
64
+ missing: 'share-token' | 'funding-token' | 'evm-chain';
65
+ };
66
+ /**
67
+ * Resolves each chain of a vault offer to its share and funding tokens.
68
+ *
69
+ * The offer names tokens by role and address only - the share token as
70
+ * `vault`, the coin it is paid in as `funding` - so `lookup` turns each into
71
+ * metadata. A function rather than a registry snapshot, so this module does
72
+ * not depend on where the metadata comes from.
73
+ *
74
+ * A chain whose tokens cannot be named is reported rather than dropped: its
75
+ * position cannot be read without the symbol, and a caller has to know it is
76
+ * not showing it. When a chain lists several funding tokens, the first one
77
+ * `lookup` knows wins - a vault is priced in one.
78
+ */
79
+ declare function resolveCentrifugeVaults(offer: CentrifugeVaultOfferDetail, lookup: (token: OfferToken) => TokenMetadata | null): CentrifugeVaultResolution[];
80
+
18
81
  /**
19
82
  * How often the Ondo checkout refreshes what it is allowed to poll: the market
20
83
  * status and the indicative price. Both are free - neither spends an
@@ -129,6 +192,26 @@ declare function computeOndoSellPrice(transaction: OndoSellTransaction): Blockch
129
192
  /** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
130
193
  declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
131
194
 
195
+ /**
196
+ * The CoinList API's error code for an Ondo quote refused because the asset
197
+ * cannot be traded right now: the market is closed or paused, or the asset is
198
+ * paused or closed for the session. It arrives on a 409.
199
+ *
200
+ * One code for all four of Ondo's reasons, because the remedy is the same:
201
+ * wait for the market to open. Ondo pauses for a moment at every US session
202
+ * change (04:00 and 16:00 ET), so a poll can land on one even while
203
+ * `getTradingStatus` reported the asset tradable a second earlier.
204
+ */
205
+ declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
206
+ /**
207
+ * Whether `error` is the CoinList API refusing an Ondo quote because the
208
+ * market is not open, as opposed to a request that failed.
209
+ *
210
+ * Total: anything that is not an `HttpError` carrying
211
+ * {@link ONDO_NOT_TRADABLE_CODE} is `false`.
212
+ */
213
+ declare function isOndoNotTradableError(error: unknown): error is HttpError;
214
+
132
215
  /**
133
216
  * The Superstate swap contract's ABI, generated verbatim from the shared
134
217
  * `TokenSwap` base contract:
@@ -1290,4 +1373,4 @@ declare const User: {
1290
1373
  fromDto: (dto: UserDto) => User;
1291
1374
  };
1292
1375
 
1293
- export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
1376
+ export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT, CENTRIFUGE_POLL_INTERVAL_MS, type CentrifugeVault, CentrifugeVaultOfferDetail, type CentrifugeVaultResolution, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, HttpError, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_NOT_TRADABLE_CODE, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OfferToken, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TokenMetadata, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isOndoNotTradableError, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, resolveCentrifugeVaults, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
@@ -1,7 +1,7 @@
1
- import { au as PaginationParams, av as PaginatedResponse, aw as DecimalString, x as StablecoinSymbol, j as OndoBuyTransaction, B as BlockchainAmount, k as OndoSellTransaction, p as Bps, ax as SwapStatus, a0 as AssetDecimals, b as EvmContractAddress, a as EthereumChain, i as OfferSwapContract, ay as Uint256, h as AssetSymbol, q as EvmWalletAddress, az as KnownAssetSymbol, y as Erc20Asset, aA as Newtype } from '../tokens-namespace-CIWBtgt2.js';
2
- export { aB as AllowWalletParams, aC as AllowWalletResponse, aD as Asset, aE as AssetCode, e as AssetId, A as AuthorizationCode, aF as Blockchain, a1 as BuildOndoBuyParams, a2 as BuildOndoSellParams, aG as BuildOndoSwapParamsCore, aH as Chain, ar as ClientCredentialsOAuth, aI as ClientId, as as ClientSecret, aJ as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, aK as CoinListTokenSaleOffer, H as CoinListTokenSaleOfferDetail, u as Config, aL as ConnectExternalWalletParams, aM as CreateKycTokenParams, aN as CreateParticipationParams, aO as CreateWalletOwnershipChallengeParams, aP as Cursor, a8 as DebugEvent, aQ as DocumentFormType, Y as DocumentSubmission, aR as DocumentSubmissionStatus, aS as DocumentType, aT as ETHEREUM_CHAINS, E as Erc20Namespace, aU as Erc20NamespaceImpl, aV as FaqItem, a9 as FrontlineEventId, aW as GetOndoQuoteParams, aX as GetOndoTradingStatusParams, aY as GetSwapAuthorizationParams, aZ as GetSwapPreviewParams, a_ as GetTokenAllowanceParams, a$ as GetTokenBalanceParams, b0 as HexEncodedTransactionData, aa as HttpError, ab as HttpResponse, b1 as Isin, b2 as Iso2CountryCode, X as KycLevelName, ac as KycToken, b3 as Link, b4 as ListOptionAddressesParams, ad as LogBinding, ae as LogBindings, af as LogCause, ag as LogLevel, ah as LogScope, ai as LogValue, L as Logger, b5 as MAX_ASSET_DECIMALS, b6 as MAX_UINT_256, b7 as Milestone, v as OAuthAccessToken, b8 as OAuthRefreshToken, aq as OAuthSession, J as Offer, b9 as OfferBase, z as OfferDetail, ba as OfferDetailBase, bb as OfferEditorial, O as OfferId, bc as OfferOption, Q as OfferOptionAddress, a6 as OfferOptionAddressId, d as OfferOptionId, bd as OfferOptionSlug, be as OfferSlug, bf as OfferToken, F as OfferType, w as OffersNamespace, bg as OffersNamespaceImpl, g as OndoNamespace, n as OndoNamespaceImpl, a3 as OndoQuote, bh as OndoQuoteDuration, a4 as OndoQuoteSize, bi as OndoSellOutcome, bj as OndoSwapOffer, G as OndoSwapOfferDetail, l as OndoSwapTransactionCore, $ as OndoTradingStatus, m as OrderBookSide, bk as PKCEState, bl as PaginatedResponseDto, P as Participation, bm as ParticipationId, bn as ParticipationStatus, bo as ParticipationsPaginationParams, bp as PauseFlags, bq as Pii, br as PiiAddress, bs as PiiJurisdiction, bt as PiiKind, _ as PinoLoggerOptions, aj as ProductionLogLevel, bu as QueryParamValue, bv as QueryParamValues, ak as RedactedWalletError, bw as RedirectUri, bx as RemoveOptionAddressParams, al as RequestId, s as Requirement, by as RequirementActionNeededReason, V as RequirementId, K as RequirementStatusInfo, N as RequirementStatusValue, M as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bz as RpcConfig, am as RpcFailureReason, bA as SOLANA_CHAINS, bB as STABLE_DECIMALS, an as SafeEvent, ao as SafeFields, bC as SolanaChain, bD as SubmitDocumentParams, S as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bE as SuperstateSwapOffer, I as SuperstateSwapOfferDetail, bF as SwapContractRef, bG as SwapPreview, bH as TermItem, bI as Ticker, a5 as TokenIdentifier, a7 as TokenLogo, bJ as TokenLogoImage, bK as TokenLogoUrl, D as TokenMetadata, bL as TokenRole, T as TokensNamespace, bM as TokensNamespaceImpl, bN as Tx, ap as UnredactedFields, bO as WalletAddress, Z as WalletChallengeType, W as WalletError, bP as WalletOwnershipChallenge, bQ as WalletProtocol, o as WalletsNamespace, bR as WalletsNamespaceImpl, bS as apiErrorCode, bT as assertUint256, bU as isChain, bV as isOfferType, bW as parseUint256 } from '../tokens-namespace-CIWBtgt2.js';
3
- import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, e as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-BNBNuDu1.js';
4
- export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, d as EvmSigner, E as EvmWallet, P as PKCEConfig, f as PKCEParams, c as TokenRegistrySnapshot, W as WriteContractParams, g as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-BNBNuDu1.js';
1
+ import { aK as PaginationParams, aL as PaginatedResponse, B as BlockchainAmount, a as EthereumChain, b as EvmContractAddress, K as TokenMetadata, aN as OfferToken, M as CentrifugeVaultOfferDetail, G as DecimalString, H as StablecoinSymbol, o as OndoBuyTransaction, p as OndoSellTransaction, ar as HttpError, u as Bps, aO as SwapStatus, aa as AssetDecimals, n as OfferSwapContract, aP as Uint256, d as AssetSymbol, v as EvmWalletAddress, aQ as KnownAssetSymbol, I as Erc20Asset, aR as Newtype } from '../time-DJU6E8KK.js';
2
+ export { aS as AllowWalletParams, aT as AllowWalletResponse, aU as Asset, aV as AssetCode, k as AssetId, $ as AsyncOfferDetail, _ as AsyncOfferType, A as AuthorizationCode, aW as Blockchain, ab as BuildCentrifugeVaultBuyParams, ag as BuildOndoBuyParams, ah as BuildOndoSellParams, aX as BuildOndoSwapParamsCore, f as CentrifugeClaimDirection, c as CentrifugeNamespace, g as CentrifugeNamespaceImpl, ad as CentrifugeOrderReason, ae as CentrifugeOrderability, aY as CentrifugePositionStatus, e as CentrifugeVaultBuyTransaction, aZ as CentrifugeVaultClaimProceedsTransaction, a_ as CentrifugeVaultClaimTransaction, al as CentrifugeVaultLeg, Y as CentrifugeVaultLegId, a$ as CentrifugeVaultOffer, b0 as CentrifugeVaultPosition, ac as CentrifugeVaultQuote, b1 as CentrifugeVaultReason, b2 as CentrifugeVaultRedeemPosition, an as CentrifugeVaultStatus, b3 as CentrifugeVaultTransactionCore, b4 as CentrifugeWalletParams, b5 as Chain, aI as ClientCredentialsOAuth, b6 as ClientId, aM as ClientSecret, b7 as CodeChallenge, C as CodeVerifier, h as CoinListTokenSaleNamespace, l as CoinListTokenSaleNamespaceImpl, b8 as CoinListTokenSaleOffer, V as CoinListTokenSaleOfferDetail, z as Config, b9 as ConnectExternalWalletParams, ba as CreateKycTokenParams, bb as CreateParticipationParams, bc as CreateWalletOwnershipChallengeParams, bd as Cursor, ap as DebugEvent, be as DocumentFormType, a7 as DocumentSubmission, bf as DocumentSubmissionStatus, bg as DocumentType, bh as ETHEREUM_CHAINS, bi as EpochMillis, E as Erc20Namespace, bj as Erc20NamespaceImpl, bk as FaqItem, aq as FrontlineEventId, bl as GetCentrifugeVaultQuoteParams, bm as GetCentrifugeVaultStatusParams, bn as GetOndoQuoteParams, bo as GetOndoTradingStatusParams, bp as GetSwapAuthorizationParams, bq as GetSwapPreviewParams, br as GetTokenAllowanceParams, bs as GetTokenBalanceParams, bt as HexEncodedTransactionData, as as HttpResponse, bu as Isin, bv as Iso2CountryCode, a6 as KycLevelName, at as KycToken, bw as Link, bx as ListOptionAddressesParams, au as LogBinding, av as LogBindings, aw as LogCause, ax as LogLevel, ay as LogScope, az as LogValue, L as Logger, by as MAX_ASSET_DECIMALS, bz as MAX_UINT_256, bA as Milestone, bB as Millis, D as OAuthAccessToken, bC as OAuthRefreshToken, aH as OAuthSession, a0 as Offer, bD as OfferBase, J as OfferDetail, bE as OfferDetailBase, bF as OfferEditorial, i as OfferId, bG as OfferOption, a4 as OfferOptionAddress, am as OfferOptionAddressId, j as OfferOptionId, bH as OfferOptionSlug, bI as OfferSlug, N as OfferType, O as OfferVaultContract, F as OffersNamespace, bJ as OffersNamespaceImpl, m as OndoNamespace, s as OndoNamespaceImpl, ai as OndoQuote, bK as OndoQuoteDuration, aj as OndoQuoteSize, bL as OndoSellOutcome, bM as OndoSwapOffer, Q as OndoSwapOfferDetail, q as OndoSwapTransactionCore, af as OndoTradingStatus, r as OrderBookSide, bN as PKCEState, bO as PaginatedResponseDto, P as Participation, bP as ParticipationId, bQ as ParticipationStatus, bR as ParticipationsPaginationParams, bS as PauseFlags, bT as Pii, bU as PiiAddress, bV as PiiJurisdiction, bW as PiiKind, a9 as PinoLoggerOptions, aA as ProductionLogLevel, bX as QueryParamValue, bY as QueryParamValues, aB as RedactedWalletError, bZ as RedirectUri, b_ as RemoveOptionAddressParams, aC as RequestId, x as Requirement, b$ as RequirementActionNeededReason, a5 as RequirementId, a1 as RequirementStatusInfo, a3 as RequirementStatusValue, a2 as RequirementType, R as RequirementsNamespace, y as RequirementsNamespaceImpl, c0 as RpcConfig, aD as RpcFailureReason, c1 as SOLANA_CHAINS, c2 as STABLE_DECIMALS, aE as SafeEvent, aF as SafeFields, Z as Seconds, c3 as SolanaChain, c4 as SubmitDocumentParams, S as SuperstateSwapNamespace, w as SuperstateSwapNamespaceImpl, c5 as SuperstateSwapOffer, X as SuperstateSwapOfferDetail, c6 as SwapContractRef, c7 as SwapPreview, c8 as TermItem, c9 as Ticker, ak as TokenIdentifier, ao as TokenLogo, ca as TokenLogoImage, cb as TokenLogoUrl, cc as TokenRole, T as TokensNamespace, cd as TokensNamespaceImpl, ce as Tx, aG as UnredactedFields, cf as WalletAddress, a8 as WalletChallengeType, W as WalletError, cg as WalletOwnershipChallenge, ch as WalletProtocol, t as WalletsNamespace, ci as WalletsNamespaceImpl, cj as apiErrorCode, ck as assertUint256, cl as isChain, cm as isExpired, cn as isOfferType, co as parseUint256 } from '../time-DJU6E8KK.js';
3
+ import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl, h as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress } from '../token-registry-snapshot-DGG5N27C.js';
4
+ export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, e as EvmSigner, E as EvmWallet, f as ExternalWalletAdapter, P as PKCEConfig, i as PKCEParams, d as TokenRegistrySnapshot, c as WalletLabelResolver, W as WalletSelection, g as WriteContractParams, j as generatePKCEParams, o as offerDisplayTokens } from '../token-registry-snapshot-DGG5N27C.js';
5
5
  import { TransactionReceipt, Hash, Chain } from 'viem';
6
6
 
7
7
  /**
@@ -15,6 +15,69 @@ import { TransactionReceipt, Hash, Chain } from 'viem';
15
15
  */
16
16
  declare function fetchAllPages<A, P extends PaginationParams = PaginationParams>(fetchPage: (params: P) => Promise<PaginatedResponse<A>>, baseParams?: Omit<P, keyof PaginationParams>): Promise<A[]>;
17
17
 
18
+ /**
19
+ * How often the Centrifuge checkout refreshes what it is allowed to poll: the
20
+ * vault status and the indicative quote. Both are free - neither spends an
21
+ * attestation - so this is paced for a gate the user can trust rather than
22
+ * for cost.
23
+ *
24
+ * There is no quote TTL beside this. A Centrifuge quote does not expire: it
25
+ * is indicative, the fund prices fulfilment later, and a countdown would
26
+ * imply a commitment the API does not make.
27
+ */
28
+ declare const CENTRIFUGE_POLL_INTERVAL_MS = 15000;
29
+ /**
30
+ * The spend the asset panel prices while the user has not confirmed an amount:
31
+ * 100 USDC.
32
+ *
33
+ * A fixed size so typing in the amount field does not restart this poll. The
34
+ * review step polls a quote for the confirmed spend, which is the estimate it
35
+ * shows.
36
+ */
37
+ declare const CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT: BlockchainAmount;
38
+
39
+ /**
40
+ * One chain a vault offer runs on, with everything a screen needs to read and
41
+ * show a position there: the proxy every request and claim goes through, the
42
+ * share token it issues, and the funding token it is paid in.
43
+ *
44
+ * The share token's `symbol` is what every `/v1/centrifuge/vault/*` call is
45
+ * keyed by.
46
+ */
47
+ type CentrifugeVault = {
48
+ chain: EthereumChain;
49
+ proxy: EvmContractAddress;
50
+ share: TokenMetadata;
51
+ funding: TokenMetadata;
52
+ };
53
+ /**
54
+ * The vaults an offer runs on, or why a chain could not be resolved: one
55
+ * entry per `vaultContracts` chain, in the offer's order.
56
+ */
57
+ type CentrifugeVaultResolution = {
58
+ type: 'resolved';
59
+ vault: CentrifugeVault;
60
+ } | {
61
+ type: 'unresolved';
62
+ chain: OfferToken['chain'];
63
+ /** Which token the offer or the registry could not name. */
64
+ missing: 'share-token' | 'funding-token' | 'evm-chain';
65
+ };
66
+ /**
67
+ * Resolves each chain of a vault offer to its share and funding tokens.
68
+ *
69
+ * The offer names tokens by role and address only - the share token as
70
+ * `vault`, the coin it is paid in as `funding` - so `lookup` turns each into
71
+ * metadata. A function rather than a registry snapshot, so this module does
72
+ * not depend on where the metadata comes from.
73
+ *
74
+ * A chain whose tokens cannot be named is reported rather than dropped: its
75
+ * position cannot be read without the symbol, and a caller has to know it is
76
+ * not showing it. When a chain lists several funding tokens, the first one
77
+ * `lookup` knows wins - a vault is priced in one.
78
+ */
79
+ declare function resolveCentrifugeVaults(offer: CentrifugeVaultOfferDetail, lookup: (token: OfferToken) => TokenMetadata | null): CentrifugeVaultResolution[];
80
+
18
81
  /**
19
82
  * How often the Ondo checkout refreshes what it is allowed to poll: the market
20
83
  * status and the indicative price. Both are free - neither spends an
@@ -129,6 +192,26 @@ declare function computeOndoSellPrice(transaction: OndoSellTransaction): Blockch
129
192
  /** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
130
193
  declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
131
194
 
195
+ /**
196
+ * The CoinList API's error code for an Ondo quote refused because the asset
197
+ * cannot be traded right now: the market is closed or paused, or the asset is
198
+ * paused or closed for the session. It arrives on a 409.
199
+ *
200
+ * One code for all four of Ondo's reasons, because the remedy is the same:
201
+ * wait for the market to open. Ondo pauses for a moment at every US session
202
+ * change (04:00 and 16:00 ET), so a poll can land on one even while
203
+ * `getTradingStatus` reported the asset tradable a second earlier.
204
+ */
205
+ declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
206
+ /**
207
+ * Whether `error` is the CoinList API refusing an Ondo quote because the
208
+ * market is not open, as opposed to a request that failed.
209
+ *
210
+ * Total: anything that is not an `HttpError` carrying
211
+ * {@link ONDO_NOT_TRADABLE_CODE} is `false`.
212
+ */
213
+ declare function isOndoNotTradableError(error: unknown): error is HttpError;
214
+
132
215
  /**
133
216
  * The Superstate swap contract's ABI, generated verbatim from the shared
134
217
  * `TokenSwap` base contract:
@@ -1290,4 +1373,4 @@ declare const User: {
1290
1373
  fromDto: (dto: UserDto) => User;
1291
1374
  };
1292
1375
 
1293
- export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
1376
+ export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT, CENTRIFUGE_POLL_INTERVAL_MS, type CentrifugeVault, CentrifugeVaultOfferDetail, type CentrifugeVaultResolution, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, HttpError, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_NOT_TRADABLE_CODE, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OfferToken, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TokenMetadata, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isOndoNotTradableError, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, resolveCentrifugeVaults, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  AuthorizationCode,
3
3
  BPS_DENOM,
4
+ CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT,
5
+ CENTRIFUGE_POLL_INTERVAL_MS,
4
6
  ClientId,
5
7
  ClientSecret,
6
8
  CodeChallenge,
@@ -9,6 +11,7 @@ import {
9
11
  DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
10
12
  DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE,
11
13
  DEFAULT_SLIPPAGE_BPS,
14
+ ONDO_NOT_TRADABLE_CODE,
12
15
  ONDO_POLL_INTERVAL_MS,
13
16
  ONDO_QUOTE_MAX_TTL_MS,
14
17
  ONDO_SETTLEMENT_ASSET,
@@ -33,6 +36,7 @@ import {
33
36
  User,
34
37
  UserEmail,
35
38
  UserId,
39
+ WalletSelection,
36
40
  applyBps,
37
41
  computeOndoBuyPrice,
38
42
  computeOndoSellPrice,
@@ -41,12 +45,14 @@ import {
41
45
  decodeSwappedOutputAmount,
42
46
  formattedPricePerShare,
43
47
  generatePKCEParams,
48
+ isOndoNotTradableError,
44
49
  isSwapAvailable,
45
50
  offerDisplayTokens,
46
51
  ondoQuoteOfferDeadline,
52
+ resolveCentrifugeVaults,
47
53
  superstateSwapContractAddress,
48
54
  swapSpender
49
- } from "../chunk-3UQPCAU4.js";
55
+ } from "../chunk-OUFI3D3Q.js";
50
56
  import {
51
57
  AllowWalletResponse,
52
58
  Asset,
@@ -55,9 +61,20 @@ import {
55
61
  AssetIconUrl,
56
62
  AssetId,
57
63
  AssetSymbol,
64
+ AsyncOfferDetail,
58
65
  Blockchain,
59
66
  BlockchainAmount,
60
67
  Bps,
68
+ CentrifugeNamespaceImpl,
69
+ CentrifugeVaultBuyTransaction,
70
+ CentrifugeVaultClaimProceedsTransaction,
71
+ CentrifugeVaultClaimTransaction,
72
+ CentrifugeVaultLeg,
73
+ CentrifugeVaultLegId,
74
+ CentrifugeVaultPosition,
75
+ CentrifugeVaultQuote,
76
+ CentrifugeVaultRedeemPosition,
77
+ CentrifugeVaultStatus,
61
78
  Chain,
62
79
  ClientCredentialsOAuth,
63
80
  CoinListTokenSaleNamespaceImpl,
@@ -69,6 +86,7 @@ import {
69
86
  DocumentSubmission,
70
87
  ERC20_ABI,
71
88
  ETHEREUM_CHAINS,
89
+ EpochMillis,
72
90
  Erc20NamespaceImpl,
73
91
  EthereumChain,
74
92
  EvmContractAddress,
@@ -89,6 +107,7 @@ import {
89
107
  MAX_UINT_256,
90
108
  MathError,
91
109
  Milestone,
110
+ Millis,
92
111
  NA_AMOUNT_ASSET_UI,
93
112
  NotAuthenticatedError,
94
113
  NotImplementedError,
@@ -106,6 +125,7 @@ import {
106
125
  OfferSlug,
107
126
  OfferSwapContract,
108
127
  OfferToken,
128
+ OfferVaultContract,
109
129
  OndoBuyTransaction,
110
130
  OndoNamespaceImpl,
111
131
  OndoQuote,
@@ -127,6 +147,7 @@ import {
127
147
  SOLANA_CHAINS,
128
148
  STABLE_DECIMALS,
129
149
  SUPERSTATE_SWAP_ABI,
150
+ Seconds,
130
151
  ShortenedWalletAddress,
131
152
  SolanaChain,
132
153
  StablecoinSymbol,
@@ -159,6 +180,7 @@ import {
159
180
  getChainId,
160
181
  getNetworkName,
161
182
  isChain,
183
+ isExpired,
162
184
  isOfferType,
163
185
  parseBlockchainAmount,
164
186
  parseUint256,
@@ -166,7 +188,7 @@ import {
166
188
  txExplorerUrl,
167
189
  usdAmount,
168
190
  viemChain
169
- } from "../chunk-IRV5YU42.js";
191
+ } from "../chunk-YMDYLYL3.js";
170
192
  export {
171
193
  AllowWalletResponse,
172
194
  Asset,
@@ -175,11 +197,24 @@ export {
175
197
  AssetIconUrl,
176
198
  AssetId,
177
199
  AssetSymbol,
200
+ AsyncOfferDetail,
178
201
  AuthorizationCode,
179
202
  BPS_DENOM,
180
203
  Blockchain,
181
204
  BlockchainAmount,
182
205
  Bps,
206
+ CENTRIFUGE_INDICATIVE_QUOTE_AMOUNT,
207
+ CENTRIFUGE_POLL_INTERVAL_MS,
208
+ CentrifugeNamespaceImpl,
209
+ CentrifugeVaultBuyTransaction,
210
+ CentrifugeVaultClaimProceedsTransaction,
211
+ CentrifugeVaultClaimTransaction,
212
+ CentrifugeVaultLeg,
213
+ CentrifugeVaultLegId,
214
+ CentrifugeVaultPosition,
215
+ CentrifugeVaultQuote,
216
+ CentrifugeVaultRedeemPosition,
217
+ CentrifugeVaultStatus,
183
218
  Chain,
184
219
  ClientCredentialsOAuth,
185
220
  ClientId,
@@ -199,6 +234,7 @@ export {
199
234
  DocumentSubmission,
200
235
  ERC20_ABI,
201
236
  ETHEREUM_CHAINS,
237
+ EpochMillis,
202
238
  Erc20NamespaceImpl,
203
239
  EthereumChain,
204
240
  EvmContractAddress,
@@ -219,11 +255,13 @@ export {
219
255
  MAX_UINT_256,
220
256
  MathError,
221
257
  Milestone,
258
+ Millis,
222
259
  NA_AMOUNT_ASSET_UI,
223
260
  NotAuthenticatedError,
224
261
  NotImplementedError,
225
262
  OAuthRefreshToken,
226
263
  OAuthSession,
264
+ ONDO_NOT_TRADABLE_CODE,
227
265
  ONDO_POLL_INTERVAL_MS,
228
266
  ONDO_QUOTE_MAX_TTL_MS,
229
267
  ONDO_SETTLEMENT_ASSET,
@@ -240,6 +278,7 @@ export {
240
278
  OfferSlug,
241
279
  OfferSwapContract,
242
280
  OfferToken,
281
+ OfferVaultContract,
243
282
  OffersNamespaceImpl,
244
283
  OndoBuyTransaction,
245
284
  OndoNamespaceImpl,
@@ -271,6 +310,7 @@ export {
271
310
  SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
272
311
  SWAP_LEVEL,
273
312
  SWAP_POLL_INTERVAL_MS,
313
+ Seconds,
274
314
  ShortenedWalletAddress,
275
315
  SolanaChain,
276
316
  StablecoinSymbol,
@@ -297,6 +337,7 @@ export {
297
337
  ValidationError,
298
338
  WalletAddress,
299
339
  WalletOwnershipChallenge,
340
+ WalletSelection,
300
341
  WalletsNamespaceImpl,
301
342
  apiErrorCode,
302
343
  applyBps,
@@ -321,12 +362,15 @@ export {
321
362
  getChainId,
322
363
  getNetworkName,
323
364
  isChain,
365
+ isExpired,
324
366
  isOfferType,
367
+ isOndoNotTradableError,
325
368
  isSwapAvailable,
326
369
  offerDisplayTokens,
327
370
  ondoQuoteOfferDeadline,
328
371
  parseBlockchainAmount,
329
372
  parseUint256,
373
+ resolveCentrifugeVaults,
330
374
  shortenAddress,
331
375
  superstateSwapContractAddress,
332
376
  swapSpender,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinlist-co/react",
3
- "version": "0.12.2-rc.726778a",
3
+ "version": "0.12.2-rc.818bed6",
4
4
  "description": "CoinList Partner SDK",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/universal/types/oauth.ts","../src/universal/core/auth/pkce.ts","../src/universal/core/shared/blockchain/token-registry.ts","../src/universal/core/checkout/ondo/constants.ts","../src/universal/core/checkout/ondo/math.ts","../src/universal/core/shared/blockchain/bps.ts","../src/universal/core/checkout/superstate/blockchain/math.ts","../src/universal/core/checkout/superstate/blockchain/quote.ts","../src/universal/core/checkout/superstate/blockchain/status.ts","../src/universal/core/checkout/superstate/blockchain/swapped-event.ts","../src/universal/core/checkout/superstate/constants.ts","../src/universal/core/checkout/superstate/formatters.ts","../src/universal/core/offers/offers-namespace.ts","../src/universal/core/offers/swap-contracts.ts","../src/universal/core/tokens/token-registry-snapshot.ts","../src/universal/types/blockchain/wallet-error.ts","../src/universal/types/user.ts"],"sourcesContent":["import type { Newtype } from '@/universal/types/newtype';\n\nexport type AuthorizationCode = Newtype<string, 'AuthorizationCode'>;\nexport const AuthorizationCode = (value: string): AuthorizationCode =>\n value as AuthorizationCode;\n\nexport type CodeVerifier = Newtype<string, 'CodeVerifier'>;\nexport const CodeVerifier = (value: string): CodeVerifier =>\n value as CodeVerifier;\n\nexport type CodeChallenge = Newtype<string, 'CodeChallenge'>;\nexport const CodeChallenge = (value: string): CodeChallenge =>\n value as CodeChallenge;\n\nexport type PKCEState = Newtype<string, 'PKCEState'>;\nexport const PKCEState = (value: string) => value as PKCEState;\n\nexport type RedirectUri = Newtype<string, 'RedirectUri'>;\nexport const RedirectUri = (value: string): RedirectUri => value as RedirectUri;\n\nexport type ClientId = Newtype<string, 'ClientId'>;\nexport const ClientId = (value: string): ClientId => value as ClientId;\n\nexport type ClientSecret = Newtype<string, 'ClientSecret'>;\nexport const ClientSecret = (value: string): ClientSecret =>\n value as ClientSecret;\n","import {\n arrayBufferToBase64Url,\n generateSecureRandomBase64Url,\n sha256,\n} from '@/universal/core/shared/utils/crypto';\nimport type {\n CodeChallenge as CodeChallengeType,\n CodeVerifier as CodeVerifierType,\n PKCEState as PKCEStateType,\n} from '@/universal/types/oauth';\nimport {\n type ClientId,\n CodeChallenge,\n CodeVerifier,\n PKCEState,\n type RedirectUri,\n} from '@/universal/types/oauth';\n\nexport type PKCEParams = {\n clientId: ClientId;\n responseType: 'code';\n redirectUri: RedirectUri;\n codeChallenge: CodeChallengeType;\n codeChallengeMethod: 'S256';\n state: PKCEStateType;\n codeVerifier: CodeVerifierType;\n};\n\nexport type PKCEConfig = {\n clientId: ClientId;\n redirectUri: RedirectUri;\n};\n\n/**\n * Generates PKCE parameters for an OAuth2 authorization code flow.\n * Pure crypto — no React, no DOM beyond Web Crypto API. Safe to use\n * in server-side code and Next.js middleware.\n */\nexport async function generatePKCEParams(\n config: PKCEConfig\n): Promise<PKCEParams> {\n const state = generateSecureRandomBase64Url(32);\n const codeVerifier = generateSecureRandomBase64Url(32);\n const codeChallengeRaw = await sha256(codeVerifier);\n const codeChallenge = arrayBufferToBase64Url(codeChallengeRaw, false);\n\n return {\n clientId: config.clientId,\n responseType: 'code',\n redirectUri: config.redirectUri,\n codeChallenge: CodeChallenge(codeChallenge),\n codeChallengeMethod: 'S256',\n state: PKCEState(state),\n codeVerifier: CodeVerifier(codeVerifier),\n };\n}\n","import {\n AssetDecimals,\n type Erc20Asset,\n type EthereumChain,\n EvmContractAddress,\n type KnownAssetSymbol,\n StablecoinSymbol,\n} from '@/universal/types/blockchain/core';\nimport { InvariantError } from '@/universal/types/errors';\n\nexport const USDC_SYMBOL: StablecoinSymbol = StablecoinSymbol('USDC');\nexport const USDC: Erc20Asset = {\n name: 'USD Coin',\n symbol: USDC_SYMBOL,\n decimals: AssetDecimals(6),\n};\n\nexport const USDT_SYMBOL: StablecoinSymbol = StablecoinSymbol('USDT');\nexport const USDT: Erc20Asset = {\n name: 'Tether USD',\n symbol: USDT_SYMBOL,\n decimals: AssetDecimals(6),\n};\n\n/** ERC-20 contract addresses for a supported stablecoin, keyed by chain. */\ntype TokenAddresses = Record<EthereumChain, EvmContractAddress>;\n\nconst USDC_ADDRESSES: TokenAddresses = {\n ethereum_mainnet: EvmContractAddress(\n '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'\n ),\n ethereum_sepolia: EvmContractAddress(\n '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238'\n ),\n base_mainnet: EvmContractAddress(\n '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'\n ),\n base_sepolia: EvmContractAddress(\n '0x036CbD53842c5426634e7929541eC2318f3dCF7e'\n ),\n};\n\n/**\n * USDT is not deployed on every chain the SDK models: Tether publishes no\n * Base Sepolia token. The table stays total, with that one absence an\n * explicit `null`, so a new {@link EthereumChain} is still a compile error\n * here until the author decides whether USDT exists on it — the same\n * exhaustiveness the rest of the chain model relies on. A lookup then\n * answers the honest `null` rather than calling a fake address.\n */\nconst USDT_ADDRESSES: Record<EthereumChain, EvmContractAddress | null> = {\n ethereum_mainnet: EvmContractAddress(\n '0xdac17f958d2ee523a2206206994597c13d831ec7'\n ),\n ethereum_sepolia: EvmContractAddress(\n '0x7169D38820dfd117C3FA1f22a697dBA58d90BA06'\n ),\n base_mainnet: EvmContractAddress(\n '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'\n ),\n base_sepolia: null,\n};\n\n/** Lookups for the stablecoins the SDK's swap flows support out of the box. */\nexport const TOKEN_REGISTRY = {\n erc20: (symbol: KnownAssetSymbol): Erc20Asset => {\n switch (symbol) {\n case 'USDC':\n return USDC;\n case 'USDT':\n return USDT;\n default:\n throw new InvariantError(`Unknown asset symbol: ${symbol}`);\n }\n },\n /**\n * USDC's contract on `chain`. USDC is deployed on every chain the SDK\n * models, so the table is total and the answer is never `null`.\n */\n usdcAddress: (chain: EthereumChain): EvmContractAddress =>\n USDC_ADDRESSES[chain],\n /**\n * USDT's contract on `chain`, or `null` where Tether publishes none —\n * Base Sepolia today. The honest answer, never a fake address a balance\n * read would call.\n */\n usdtAddress: (chain: EthereumChain): EvmContractAddress | null =>\n USDT_ADDRESSES[chain],\n};\n","import { USDC_SYMBOL } from '@/universal/core/shared/blockchain/token-registry';\nimport {\n DecimalString,\n type StablecoinSymbol,\n} from '@/universal/types/blockchain/core';\nimport type { NonEmptyArray } from '@/universal/types/collections';\n\n/**\n * How often the Ondo checkout refreshes what it is allowed to poll: the market\n * status and the indicative price. Both are free - neither spends an\n * attestation - so this is paced for a price the user can trust rather than\n * for cost.\n *\n * A built transaction is deliberately not on this timer. Building spends an\n * attestation, so it happens once per order and once per refresh the user\n * asks for.\n */\nexport const ONDO_POLL_INTERVAL_MS = 15_000;\n\n/** Max time the review step offers a built quote. */\nexport const ONDO_QUOTE_MAX_TTL_MS = 15_000;\n\n/**\n * The order size the sidebar prices against before the user names one.\n *\n * Ondo prices by size, so some amount has to be sent. $1,000 is a plausible\n * order rather than a token one: a size so small that Ondo's minimum rejects\n * it would leave the panel permanently blank.\n *\n * Named distinctly from `DEFAULT_AMOUNT_TO_COMPUTE_PRICE` in the swap\n * constants, which is a raw `bigint` of USDC base units for a different\n * endpoint. Both barrels are flat, so two constants of the same name could not\n * coexist - and they mean different things anyway.\n */\nexport const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE = DecimalString('1000');\n\n/**\n * The coin an Ondo sell settles into, for display only.\n *\n * The scale of every amount on a built transaction comes off the response, so\n * this names the token and never sizes it - `receive_output_decimals` is the\n * only authority on how many decimals the proceeds are counted in, and the two\n * are allowed to disagree.\n *\n * Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of\n * it, though both are USDC today. On a buy USDC is what the user funds with\n * and one of a list that may grow; on a sell it is what they settle into and\n * there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make\n * the sell screen quietly follow whichever funding coin happened to be listed\n * first.\n */\nexport const ONDO_SETTLEMENT_ASSET: StablecoinSymbol = USDC_SYMBOL;\n\n/**\n * The order size the sidebar prices a sell against before the user names one.\n *\n * Sells are quoted by token amount rather than by notional: the fee comes out\n * of dollars, and Ondo's price is size-aware, so a buy's quantity depends on\n * the quote being asked for while a sell is sized by what the user already\n * holds. One whole share is a size Ondo will price - small enough to be\n * plausible for any asset, large enough that Ondo's minimum does not reject it\n * and leave the panel permanently blank.\n *\n * The buy counterpart is {@link DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE}, which\n * is a dollar figure for the same reason in reverse.\n */\nexport const DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;\n\n/**\n * The coins an Ondo buy can be funded with, in display order, with the first\n * preselected.\n *\n * USDC alone today: it is what the Sepolia integration contract accepts. The\n * amount step renders a single entry as a plain card and two or more as a\n * picker, so adding one here is all it takes.\n */\nexport const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol> = [\n USDC_SYMBOL,\n];\n","import { ONDO_QUOTE_MAX_TTL_MS } from '@/universal/core/checkout/ondo/constants';\nimport {\n assertUint256,\n BlockchainAmount,\n MAX_UINT_256,\n type Uint256,\n} from '@/universal/types/blockchain/core';\nimport { MathError } from '@/universal/types/errors';\nimport type {\n OndoBuyTransaction,\n OndoSellOutcome,\n OndoSellTransaction,\n} from '@/universal/types/providers/ondo/ondo';\n\n/**\n * The price of one whole asset token in a built Ondo purchase, in the funding\n * token's units - USD per share.\n *\n * Neither builder publishes a price. Frontline drops Ninshubur's deliberately,\n * because `GET /v1/ondo/swap/quote` already serves one under that name at a\n * different scale, and echoing both would leave a caller to guess which was\n * which.\n *\n * Dividing the two amounts the response *does* carry is better than reading\n * the indicative one anyway: it is the price this transaction fills at, rather\n * than a poll that has since moved and was struck against a different size.\n *\n * **Fee-exclusive.** `notionalValue` is the deposit after CoinList's fee comes\n * off, so this is the price Ondo filled at, not the buyer's all-in cost per\n * token - that would be `spendInputAmount / receiveOutputAmount`, and it is\n * higher. Fee-exclusive is what the review screen wants, because it renders\n * the fee on its own line: price x quantity, plus fee, comes to the total.\n * Making this all-in would double-count the fee against that breakdown.\n *\n * The two are equal until ENG-1718 turns a fee on, which frontline rejects\n * today. They diverge the moment it does, so the choice is load-bearing rather\n * than academic.\n */\nexport function computeOndoBuyPrice(\n transaction: OndoBuyTransaction\n): BlockchainAmount {\n const { notionalValue, receiveOutputAmount } = transaction;\n return pricePerShare({\n usd: notionalValue,\n shares: receiveOutputAmount,\n });\n}\n\n/**\n * The price of one whole asset token in a built Ondo sale, in the settlement\n * token's units - USD per share, the same thing\n * {@link computeOndoBuyPrice} answers with the ratio inverted.\n *\n * **Fee-exclusive, and it takes arithmetic to be so.** `expected.quantity` is\n * published already net of `expected.fee`, so the proceeds are added back\n * before dividing: what comes out is the price Ondo filled at, which is the\n * buy arm's meaning rather than a second one. That is what lets one review row\n * render on either screen, and what keeps the sell breakdown honest - the fee\n * sits on its own line beside this, and a net price would count it twice.\n *\n * Read against {@link OndoSellTransaction.expected} alone. The `minimum` arm\n * describes the same trade at a different outcome, and pricing that one would\n * answer \"the worst price this could fill at\", which no screen asks for.\n *\n * The two readings coincide while frontline forces the fee to zero, which it\n * does today. They diverge the day ENG-1718 lands.\n */\nexport function computeOndoSellPrice(\n transaction: OndoSellTransaction\n): BlockchainAmount {\n const { expected, spendInputAmount } = transaction;\n return pricePerShare({\n usd: grossProceeds(expected),\n shares: spendInputAmount,\n });\n}\n\n/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */\nexport function ondoQuoteOfferDeadline(\n expiresAt: Date,\n nowMs: number = Date.now()\n): Date {\n return new Date(Math.min(expiresAt.getTime(), nowMs + ONDO_QUOTE_MAX_TTL_MS));\n}\n\n/**\n * What Ondo returned before CoinList took its cut: the published quantity with\n * the fee charged on it added back.\n *\n * Bounded before the addition rather than after. The two amounts are parsed\n * independently, each a uint256 in its own right, so nothing in the mapper\n * stops their sum leaving the range - and `BlockchainAmount.add` answers an\n * out-of-range sum with an `InvariantError`, which says the SDK's own\n * arithmetic went wrong. It did not: a gross that no uint256 can hold is a\n * corrupt response, the same kind of thing {@link assertPriceFits} reports, and\n * it has to say so here rather than take the checkout down mid-render.\n *\n * The addition itself is still `BlockchainAmount.add`, so the two amounts\n * disagreeing about their scale stays an `InvariantError`. That one really is\n * internal: `OndoSellTransaction.fromDto` reads both off\n * `receive_output_decimals`.\n */\nfunction grossProceeds(expected: OndoSellOutcome): BlockchainAmount {\n const raw = expected.quantity.raw + expected.fee.raw;\n if (raw > MAX_UINT_256) {\n throw new MathError(`Ondo sell proceeds: out of uint256 bounds (${raw})`);\n }\n return BlockchainAmount.add(expected.quantity, expected.fee);\n}\n\n/**\n * USD per whole share, in the USD amount's decimals.\n *\n * Both prices bottom out here so the scaling, the rounding and the bound are\n * written once: whichever side the amounts came off, a price is one dollar\n * amount divided by one asset amount.\n *\n * {@link BlockchainAmount.div} owns the arithmetic - it scales the numerator\n * by the asset's exponent so the quotient lands back in the funding token's,\n * truncates towards zero so the total a price implies never overstates what\n * was paid, and refuses a zero share quantity rather than dividing by it.\n * That last guard is unreachable through either `fromDto`, which rejects a\n * non-positive amount on both sides of the trade at the boundary - both of\n * them, because which one lands in the denominator here flips with the\n * direction. It matters because this runs during render, where a bare BigInt\n * division would take the checkout down with a RangeError instead of failing\n * one step.\n *\n * What is Ondo's rather than every amount's is the uint256 bound: `div`\n * deliberately does not check one, because scaling can carry a legal pair out\n * of range, and here that can only mean a corrupt response.\n */\nfunction pricePerShare({\n usd,\n shares,\n}: {\n usd: BlockchainAmount;\n shares: BlockchainAmount;\n}): BlockchainAmount {\n const price = BlockchainAmount.div(usd, shares);\n return BlockchainAmount({\n raw: assertPriceFits(price.raw),\n decimals: price.decimals,\n });\n}\n\n/**\n * A price past uint256 needs an output amount of a few base units against a\n * notional no real balance holds. It cannot come off the wire, so it is a\n * corrupt response rather than an expensive order.\n */\nfunction assertPriceFits(raw: bigint): Uint256 {\n try {\n return assertUint256(raw);\n } catch {\n throw new MathError(`Ondo price: out of uint256 bounds (${raw})`);\n }\n}\n","import {\n assertUint256,\n Bps,\n type Uint256,\n} from '@/universal/types/blockchain/core';\n\n/** Basis-point denominator: 10_000 bps = 100%. */\nexport const BPS_DENOM: Bps = Bps(10_000n);\n\n/**\n * Applies a basis-point fraction to an amount, flooring the result.\n * `floor((amount × bps) / BPS_DENOM)`. The result is bounds-checked, so an\n * overflow (bps far above BPS_DENOM) or a negative product is rejected.\n */\nexport function applyBps(amount: Uint256, bps: Bps): Uint256 {\n return assertUint256((amount * bps) / BPS_DENOM);\n}\n","import type { SwapQuote } from '@/universal/core/checkout/superstate/blockchain/quote';\nimport { applyBps, BPS_DENOM } from '@/universal/core/shared/blockchain/bps';\nimport {\n assertUint256,\n BlockchainAmount,\n Bps,\n} from '@/universal/types/blockchain/core';\n\n/**\n * Price of 1 output token in USD, assuming the input token is a $1 stablecoin.\n *\n * `raw_price = inputTokenAmount.raw × 10^outputDecimals ÷ outputTokenAmount.raw`\n *\n * The multiplication happens before the division so we never lose precision to\n * integer truncation early. This mirrors standard fixed-point practice on-chain.\n * Returned decimals match the input token decimals (always the stablecoin's 6).\n */\nexport function computePrice({\n inputTokenAmount,\n outputTokenAmount,\n}: SwapQuote): BlockchainAmount | null {\n if (outputTokenAmount.raw === 0n) return null;\n\n const scale = 10n ** BigInt(outputTokenAmount.decimals);\n const raw = assertUint256(\n (inputTokenAmount.raw * scale) / outputTokenAmount.raw\n );\n\n return BlockchainAmount({ raw, decimals: inputTokenAmount.decimals });\n}\n\n/**\n * Applies slippage to an amount, returning the minimum acceptable amount:\n * `amount × (BPS_DENOM − slippage) / BPS_DENOM`. Throws when `slippage` exceeds\n * `BPS_DENOM` (the retained fraction would be negative).\n */\nexport function computeSlip(\n amount: BlockchainAmount,\n slippage: Bps\n): BlockchainAmount {\n const retained = Bps(assertUint256(BPS_DENOM - slippage));\n const slipRaw = applyBps(amount.raw, retained);\n return BlockchainAmount({ raw: slipRaw, decimals: amount.decimals });\n}\n","import {\n type AssetDecimals,\n BlockchainAmount,\n} from '@/universal/types/blockchain/core';\nimport type { SwapPreview } from '@/universal/types/providers/superstate/swap';\n\n/**\n * A read-only quote for a swap as domain amounts: how much goes in, the\n * protocol fee, and how much would come out. Derived from the raw\n * {@link SwapPreview} the swap contract returns.\n */\nexport type SwapQuote = {\n inputTokenAmount: BlockchainAmount;\n fee: BlockchainAmount;\n outputTokenAmount: BlockchainAmount;\n};\n\nexport const SwapQuote = {\n /**\n * Assembles a {@link SwapQuote} from a raw contract {@link SwapPreview}. The\n * input and fee are denominated in the input token; the output in the output\n * token.\n */\n fromPreview: (\n preview: SwapPreview,\n inputDecimals: AssetDecimals,\n outputDecimals: AssetDecimals\n ): SwapQuote => ({\n inputTokenAmount: BlockchainAmount({\n raw: preview.inputAmount,\n decimals: inputDecimals,\n }),\n fee: BlockchainAmount({ raw: preview.fee, decimals: inputDecimals }),\n outputTokenAmount: BlockchainAmount({\n raw: preview.outputAmount,\n decimals: outputDecimals,\n }),\n }),\n};\n","import type { SwapStatus } from '@/universal/types/providers/superstate/swap';\n\n/**\n * The bit `Operable.paused` sets for the swap operation, mirroring the\n * contract's `SWAP_LEVEL` constant.\n *\n * A constant rather than a `SWAP_LEVEL()` read: it is `constant` in the\n * contract, so reading it would spend a round-trip to be told the same number\n * every time.\n */\nexport const SWAP_LEVEL = 2;\n\n/**\n * Whether the contract will actually accept a swap right now.\n *\n * Not the same question as \"is it active\". `paused` is a bitmask over\n * *operations*, so a contract can suspend something unrelated and go on\n * swapping; only the {@link SWAP_LEVEL} bit stops it. Reading `state ===\n * 'active'` instead would refuse swaps the contract is perfectly willing to\n * make.\n */\nexport function isSwapAvailable(status: SwapStatus): boolean {\n switch (status.state) {\n case 'active':\n return true;\n case 'stopped':\n return false;\n case 'paused':\n return (status.pausedLevels & SWAP_LEVEL) === 0;\n default: {\n const _exhaustive: never = status;\n return _exhaustive;\n }\n }\n}\n","import { parseEventLogs, type TransactionReceipt } from 'viem';\nimport { SUPERSTATE_SWAP_ABI } from '@/universal/core/checkout/superstate/blockchain/abi';\nimport {\n type AssetDecimals,\n BlockchainAmount,\n MAX_UINT_256,\n} from '@/universal/types/blockchain/core';\n\n/**\n * Decodes the confirmed output amount from the `Swapped` event in a swap\n * transaction receipt.\n *\n * Returns `null` when the event is absent or the amount is not a valid uint256\n * so callers can fall back to the quote's expected output — the swap already\n * confirmed on-chain, so a missing/undecodable event should not fail the flow.\n */\nexport function decodeSwappedOutputAmount(\n receipt: TransactionReceipt,\n outputDecimals: AssetDecimals\n): BlockchainAmount | null {\n try {\n const [swapped] = parseEventLogs({\n abi: SUPERSTATE_SWAP_ABI,\n eventName: 'Swapped',\n logs: receipt.logs,\n });\n if (!swapped) return null;\n\n const raw = swapped.args.outputAmount;\n if (raw < 0n || raw > MAX_UINT_256) return null;\n return BlockchainAmount({ raw, decimals: outputDecimals });\n } catch {\n // Undecodable log (ABI mismatch / malformed) — fall back to the\n // quote. The swap already confirmed on-chain, so never fail here.\n return null;\n }\n}\n","import { USDC_SYMBOL } from '@/universal/core/shared/blockchain/token-registry';\nimport {\n Bps,\n type EthereumChain,\n EvmContractAddress,\n type StablecoinSymbol,\n} from '@/universal/types/blockchain/core';\nimport type { NonEmptyArray } from '@/universal/types/collections';\n\n/**\n * Who issues the asset a Superstate swap pays out.\n *\n * A constant rather than a field off the offer: no frontline endpoint carries\n * an issuer, and every offer this checkout serves is Superstate's by\n * definition — `CheckoutContainer` routes here on `superstate::swap` alone.\n */\nexport const SUPERSTATE_ISSUER_NAME = 'Superstate';\n\n/**\n * The coins a Superstate swap can be funded with, in display order, with the\n * first preselected.\n *\n * USDC alone today: it is what the deployed swap contract accepts. The amount\n * step renders a single entry as a plain card and two or more as a picker, so\n * adding one here is all it takes.\n */\nexport const SUPERSTATE_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol> =\n [USDC_SYMBOL];\n\n/** Poll interval for refreshing on-chain swap quotes and balances. */\nexport const SWAP_POLL_INTERVAL_MS = 15_000;\n\n/**\n * Notional input used to derive a display price-per-share when the user has\n * not yet entered an amount (1 USDC at 6 decimals).\n */\nexport const DEFAULT_AMOUNT_TO_COMPUTE_PRICE = 1_000_000n;\n\n/** Slippage tolerances offered in the review step, in basis points. */\nexport const SLIPPAGE_OPTIONS_BPS: Bps[] = [25n, 50n, 100n, 200n, 500n].map(\n (n) => Bps(n)\n);\n\n/** Default slippage tolerance (0.5%). */\nexport const DEFAULT_SLIPPAGE_BPS: Bps = Bps(50n);\n\n/**\n * The deployed Superstate swap contract on Ethereum Sepolia, and therefore the\n * ERC-20 spender the user approves there.\n *\n * Exported in its own right for a partner driving `coinlist.superstate.execute`\n * at Level 1, where the contract is an explicit parameter.\n */\nexport const SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: EvmContractAddress =\n EvmContractAddress('0x27E8CE9Ca1A1E98Bc4009F08Dc596bFcf88aCED1');\n\n/**\n * The Superstate swap contract per chain.\n *\n * Mainnet is absent, not zeroed: the production address is not finalized\n * upstream, and a zero address would be approved happily and revert only later.\n * A chain with no entry has no checkout — `useSuperstateSwapCheckoutViewModel`\n * reports it as the flow-level error rather than quoting against nothing.\n */\nconst SUPERSTATE_SWAP_CONTRACT_ADDRESSES: Partial<\n Record<EthereumChain, EvmContractAddress>\n> = {\n ethereum_sepolia: SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,\n};\n\n/**\n * The Superstate swap contract on `chain`, or `null` where none is deployed.\n *\n * TODO(ENG-1734): Ondo now reads its spender off the offer's `swap_contracts`\n * via `swapSpender`, which is why that helper sits in `shared/core/offers/`\n * rather than under a provider. Superstate still resolves from this table, so\n * two mechanisms answer one question. Migrate once frontline serves\n * `swap_contracts` on Superstate offers too.\n */\nexport function superstateSwapContractAddress(\n chain: EthereumChain\n): EvmContractAddress | null {\n return SUPERSTATE_SWAP_CONTRACT_ADDRESSES[chain] ?? null;\n}\n","import { computePrice } from '@/universal/core/checkout/superstate/blockchain/math';\nimport type { SwapQuote } from '@/universal/core/checkout/superstate/blockchain/quote';\nimport {\n formattedUsdPrice,\n NA_AMOUNT_ASSET_UI,\n} from '@/universal/core/shared/blockchain/formatters';\nimport type { FormattedAmountAssetUi } from '@/universal/types/blockchain/ui';\n\n/**\n * Formats a quote's implied price per output token as a USD amount.\n *\n * Lives with the provider rather than in `@/universal/core/shared/blockchain/formatters`\n * because {@link SwapQuote} and {@link computePrice} are Superstate's: the\n * shared formatters stay provider-agnostic.\n */\nexport function formattedPricePerShare(\n quote: SwapQuote | null,\n locale: string\n): FormattedAmountAssetUi {\n if (!quote) return NA_AMOUNT_ASSET_UI;\n return formattedUsdPrice(computePrice(quote), locale);\n}\n","import * as offersApi from '@/universal/api/frontline/offers';\nimport type { UniversalNamespaceContext } from '@/universal/core/shared/namespace-context';\nimport {\n type InternalLogger,\n internalLogger,\n} from '@/universal/core/shared/observability/internal-logger';\nimport type { Offer, OfferId } from '@/universal/types/offer';\nimport type { OfferDetail } from '@/universal/types/offer-detail';\nimport type {\n PaginatedResponse,\n PaginationParams,\n} from '@/universal/types/pagination';\n\n/**\n * Reads over CoinList's offers: the catalogue a user can browse, and the full\n * detail of a single offer.\n *\n * Every method requires an authenticated user and throws\n * {@link NotAuthenticatedError} otherwise. On the server, the same reads are\n * additionally available with an app-level token — see\n * `ServerOffersNamespace`.\n */\nexport interface OffersNamespace {\n /**\n * Fetches every offer, iterating through all pages. Prefer {@link listPage}\n * when you render a paginated list yourself.\n */\n list(): Promise<Offer[]>;\n\n /**\n * Fetches a single page of offers. Pass the previous response's\n * `startingAfter` as `after` to advance.\n */\n listPage(params: PaginationParams): Promise<PaginatedResponse<Offer>>;\n\n /**\n * Fetches the full detail of one offer, including its options. Note this\n * returns {@link OfferDetail} — a richer model than the {@link Offer}\n * summaries {@link list} returns.\n */\n get(id: OfferId): Promise<OfferDetail>;\n}\n\nexport class OffersNamespaceImpl implements OffersNamespace {\n private readonly log: InternalLogger;\n\n constructor(private readonly ctx: UniversalNamespaceContext) {\n this.log = internalLogger(ctx.logger, 'OFFERS');\n }\n\n async list(): Promise<Offer[]> {\n return this.log.wrap('list', undefined, async () => {\n await this.ctx.ensureUserAuthenticated();\n return offersApi.fetchOffers(this.ctx.api, undefined);\n });\n }\n\n async listPage(params: PaginationParams): Promise<PaginatedResponse<Offer>> {\n return this.log.wrap('listPage', params, async () => {\n await this.ctx.ensureUserAuthenticated();\n return offersApi.fetchOffersPage(this.ctx.api, params, undefined);\n });\n }\n\n async get(id: OfferId): Promise<OfferDetail> {\n return this.log.wrap('get', id, async () => {\n await this.ctx.ensureUserAuthenticated();\n return offersApi.fetchOfferDetails(this.ctx.api, id, undefined);\n });\n }\n}\n","import type {\n EthereumChain,\n EvmContractAddress,\n} from '@/universal/types/blockchain/core';\nimport type { OfferSwapContract } from '@/universal/types/offer-detail';\n\n/**\n * The CoinList contract a swap on `chain` settles through, and therefore the\n * ERC-20 spender the user approves - or `null` where this offer cannot be\n * swapped on that chain.\n *\n * Read off the offer rather than held as a constant because the address varies\n * by environment, not only by chain: beta and production both run\n * `ethereum_sepolia` and deploy a different contract on each, and one constant\n * cannot name both. Frontline resolves it per environment and serves the\n * answer on the offer.\n *\n * The array varies per *offer* as well as per chain - frontline drops a chain\n * whose funding and swap tokens do not both resolve for this asset - so an\n * array read for one symbol must not be reused for another. An empty array\n * means \"cannot swap here\", which is an answer rather than an error.\n *\n * A capability rather than a provider slice, and named for the data it reads\n * rather than for its first caller: `swap_contracts` is an offer field, and\n * `universal-core-isolation-and-sharing` would stop Superstate reusing this if\n * it lived under `checkout/ondo/`. Superstate has not migrated yet - it still\n * reads `superstateSwapContractAddress` - so Ondo is the only caller today.\n */\nexport function swapSpender(\n swapContracts: OfferSwapContract[],\n chain: EthereumChain\n): EvmContractAddress | null {\n return (\n swapContracts.find((contract) => contract.chain === chain)?.address ?? null\n );\n}\n","import type {\n Chain,\n EvmContractAddress,\n} from '@/universal/types/blockchain/core';\nimport type { OfferToken } from '@/universal/types/offer';\nimport type { TokenMetadata } from '@/universal/types/token-metadata';\n\n/**\n * One `coinlist.tokens.list()` answer, indexed for the lookups a catalogue\n * makes: by the `(chain, address)` pairs `Offer.tokens` carries.\n *\n * The registry is fetched whole - a few hundred tokens across every chain in\n * one request - and then asked one question per offer. Building the index\n * once is what keeps that a map lookup per card rather than a scan of the\n * snapshot per card. The same rule frontline-web and every other host wrote\n * for themselves, kept here so that none of them has to.\n */\nexport type TokenRegistrySnapshot = {\n /** Every token the snapshot lists, in registry order. */\n readonly tokens: readonly TokenMetadata[];\n /** `chain:address` (address lowercased) to its metadata. */\n readonly byKey: ReadonlyMap<string, TokenMetadata>;\n};\n\n/**\n * A token as a lookup names it. `Chain` rather than `EthereumChain` because\n * `OfferToken.chain` is the wider type; a Solana entry simply never matches,\n * since the snapshot models EVM chains only.\n */\ntype TokenKey = { chain: Chain; address: EvmContractAddress };\n\nexport const TokenRegistrySnapshot = {\n /** Indexes a `tokens.list()` result. `[]` is a valid, empty snapshot. */\n fromTokens: (tokens: readonly TokenMetadata[]): TokenRegistrySnapshot => ({\n tokens,\n byKey: new Map(\n tokens.map((token) => [registryKey(token.identifier), token])\n ),\n }),\n\n /**\n * The registry's entry for one token, or `null` when it lists none. The\n * registry is curated, so `null` is an ordinary answer rather than an\n * error, and callers fall back to their own display defaults.\n */\n get: (\n snapshot: TokenRegistrySnapshot,\n token: TokenKey\n ): TokenMetadata | null => snapshot.byKey.get(registryKey(token)) ?? null,\n\n /**\n * The registry's entry for the token an offer is *about*, or `null` when\n * it lists none of them.\n *\n * Resolution follows {@link offerDisplayTokens}: the token a sale\n * distributes or a swap hands over, never the funding token the user pays\n * with. An offer deployed on several chains carries one such token per\n * chain, and the first the registry knows wins - they are the same asset,\n * so any listed one answers for the offer.\n */\n forOffer: (\n snapshot: TokenRegistrySnapshot,\n offer: { tokens: readonly OfferToken[] }\n ): TokenMetadata | null => {\n for (const token of offerDisplayTokens(offer)) {\n const metadata = TokenRegistrySnapshot.get(snapshot, token);\n if (metadata !== null) {\n return metadata;\n }\n }\n return null;\n },\n};\n\n/**\n * The tokens an offer is *about*, most specific first: every `swap` entry,\n * then every `distribution` entry. `funding` entries name what a swap is paid\n * with (USDC, USDT) and never the asset on offer, so they are left out.\n *\n * `swap` outranks `distribution` because a swap product names the asset it\n * hands over precisely, while a sale's distribution entry names the same\n * token for a sale product and is accepted as the fallback. The checkout's\n * per-chain lookup and the catalogue's any-chain lookup both read this\n * ordering, which is why it is stated once, here.\n */\nexport function offerDisplayTokens(offer: {\n tokens: readonly OfferToken[];\n}): OfferToken[] {\n const swaps = offer.tokens.filter((token) => token.role === 'swap');\n const distributions = offer.tokens.filter(\n (token) => token.role === 'distribution'\n );\n return [...swaps, ...distributions];\n}\n\n/**\n * The registry serves EIP-55 checksummed addresses while an offer may carry\n * any casing, so an EVM address compares case-insensitively. Every chain the\n * registry snapshot models is an EVM chain (`TokenMetadata.identifier.chain`\n * is an `EthereumChain`), so lowercasing is safe for every entry it holds.\n */\nfunction registryKey(token: TokenKey): string {\n return `${token.chain}:${token.address.toLowerCase()}`;\n}\n","import type { Hash } from 'viem';\n\n/**\n * A classified wallet or transaction failure. The SDK derives this from\n * whatever the {@link EvmWallet} throws, so hosts get a stable, typed error\n * shape regardless of the wallet library underneath.\n *\n * Lives here rather than beside its classifier because it is the failure half\n * of the {@link EvmWallet} contract, and because both `@/universal` and\n * `@/client` name it: {@link LogCause} carries one, and classifying a thrown\n * error into one needs viem's error classes, which are browser-side.\n */\nexport type WalletError =\n | { type: 'user_rejected' }\n | { type: 'insufficient_funds' }\n | {\n type: 'contract_reverted';\n /**\n * What the contract said, when it said anything: a `require` string, a\n * panic description, a custom error's name, or the four-byte selector of\n * an error the ABI could not decode.\n *\n * `null` when a revert carried no data, since the string the RPC node\n * offers in its place is not the contract's - see `classifyWalletError`.\n * Nullable rather than optional so that every arm has to answer the\n * question: \"it reverted and said nothing\" is a fact about the revert,\n * and a caller should have to read it rather than miss it.\n *\n * Never the custom error's arguments. A name is a compile-time\n * identifier; its operands are runtime values - an address, a balance -\n * and those are `'debug'` material.\n */\n reason: string | null;\n }\n | { type: 'timeout'; hash: Hash }\n | { type: 'unknown'; cause: unknown };\n\n/**\n * A {@link WalletError} as it may be reported above `'debug'`: the\n * classification, never the throw.\n *\n * Only the `unknown` arm differs, and it differs because it is the one arm\n * carrying a value the SDK did not author - the raw error the wallet library\n * threw, whose message and metadata hold the transaction's `from`, `to`,\n * `value` and calldata. The other four carry compile-time constants or a\n * server-minted identifier already, so they pass through as they stand.\n *\n * This exists as a type rather than as a scrub some function remembers to\n * apply: `LogCause` names it, so an arm that grew a raw field would fail the\n * build instead of quietly reaching {@link Logger.error}.\n */\nexport type RedactedWalletError =\n | Exclude<WalletError, { type: 'unknown' }>\n | { type: 'unknown' };\n\nexport const RedactedWalletError = {\n fromWalletError: (error: WalletError): RedactedWalletError =>\n error.type === 'unknown' ? { type: 'unknown' } : error,\n};\n","import type { UserDto } from '@/universal/types/dto/user';\nimport type { Newtype } from '@/universal/types/newtype';\n\nexport type UserId = Newtype<string, 'UserId'>;\nexport const UserId = (value: string) => value as UserId;\nexport type UserEmail = Newtype<string, 'UserEmail'>;\nexport const UserEmail = (value: string) => value as UserEmail;\n\nexport type User = {\n id: UserId;\n email: UserEmail;\n};\n\nexport const User = {\n fromDto: (dto: UserDto): User => ({\n id: UserId(dto.id),\n email: UserEmail(dto.email),\n }),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,oBAAoB,CAAC,UAChC;AAGK,IAAM,eAAe,CAAC,UAC3B;AAGK,IAAM,gBAAgB,CAAC,UAC5B;AAGK,IAAM,YAAY,CAAC,UAAkB;AAGrC,IAAM,cAAc,CAAC,UAA+B;AAGpD,IAAM,WAAW,CAAC,UAA4B;AAG9C,IAAM,eAAe,CAAC,UAC3B;;;ACaF,eAAsB,mBACpB,QACqB;AACrB,QAAM,QAAQ,8BAA8B,EAAE;AAC9C,QAAM,eAAe,8BAA8B,EAAE;AACrD,QAAM,mBAAmB,MAAM,OAAO,YAAY;AAClD,QAAM,gBAAgB,uBAAuB,kBAAkB,KAAK;AAEpE,SAAO;AAAA,IACL,UAAU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