@coinlist-co/react 0.12.2-rc.7b430dd → 0.12.2-rc.8a0d02a
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/{chunk-DCW7NQXH.js → chunk-3WW5FLT7.js} +52 -19
- package/dist/chunk-3WW5FLT7.js.map +1 -0
- package/dist/{chunk-MOE5S6CE.js → chunk-C6GF7MDF.js} +915 -458
- package/dist/chunk-C6GF7MDF.js.map +1 -0
- package/dist/{chunk-VH34YC3Q.js → chunk-IZJ4JSSC.js} +78 -4
- package/dist/chunk-IZJ4JSSC.js.map +1 -0
- package/dist/client/index.cjs +12103 -8452
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1640 -37
- package/dist/client/index.d.ts +1640 -37
- package/dist/client/index.js +7923 -4800
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +789 -142
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +69 -41
- package/dist/server/index.d.ts +69 -41
- package/dist/server/index.js +323 -65
- package/dist/server/index.js.map +1 -1
- package/dist/{tokens-namespace-CIWBtgt2.d.cts → time-CVZpAkGY.d.cts} +878 -192
- package/dist/{tokens-namespace-CIWBtgt2.d.ts → time-CVZpAkGY.d.ts} +878 -192
- package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-BkwA8KmD.d.ts} +74 -8
- package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-bR14QehS.d.cts} +74 -8
- package/dist/universal/index.cjs +982 -448
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +91 -5
- package/dist/universal/index.d.ts +91 -5
- package/dist/universal/index.js +44 -2
- package/package.json +1 -1
- package/dist/chunk-DCW7NQXH.js.map +0 -1
- package/dist/chunk-MOE5S6CE.js.map +0 -1
- package/dist/chunk-VH34YC3Q.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl,
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet,
|
|
1
|
+
import { aI as PaginationParams, aJ as PaginatedResponse, a as EthereumChain, b as EvmContractAddress, J as TokenMetadata, aL as OfferToken, K as CentrifugeVaultOfferDetail, aM as DecimalString, G as StablecoinSymbol, o as OndoBuyTransaction, B as BlockchainAmount, p as OndoSellTransaction, ap as HttpError, u as Bps, aN as SwapStatus, a9 as AssetDecimals, n as OfferSwapContract, aO as Uint256, d as AssetSymbol, v as EvmWalletAddress, aP as KnownAssetSymbol, H as Erc20Asset, aQ as Newtype } from '../time-CVZpAkGY.cjs';
|
|
2
|
+
export { aR as AllowWalletParams, aS as AllowWalletResponse, aT as Asset, aU as AssetCode, k as AssetId, _ as AsyncOfferDetail, Z as AsyncOfferType, A as AuthorizationCode, aV as Blockchain, aa as BuildCentrifugeVaultBuyParams, ae as BuildOndoBuyParams, af as BuildOndoSellParams, aW as BuildOndoSwapParamsCore, f as CentrifugeClaimDirection, c as CentrifugeNamespace, g as CentrifugeNamespaceImpl, ab as CentrifugeOrderReason, ac as CentrifugeOrderability, aX as CentrifugePositionStatus, e as CentrifugeVaultBuyTransaction, aY as CentrifugeVaultClaimProceedsTransaction, aZ as CentrifugeVaultClaimTransaction, aj as CentrifugeVaultLeg, X as CentrifugeVaultLegId, a_ as CentrifugeVaultOffer, a$ as CentrifugeVaultPosition, b0 as CentrifugeVaultReason, b1 as CentrifugeVaultRedeemPosition, al as CentrifugeVaultStatus, b2 as CentrifugeVaultTransactionCore, b3 as CentrifugeWalletParams, b4 as Chain, aG as ClientCredentialsOAuth, b5 as ClientId, aK as ClientSecret, b6 as CodeChallenge, C as CodeVerifier, h as CoinListTokenSaleNamespace, l as CoinListTokenSaleNamespaceImpl, b7 as CoinListTokenSaleOffer, Q as CoinListTokenSaleOfferDetail, z as Config, b8 as ConnectExternalWalletParams, b9 as CreateKycTokenParams, ba as CreateParticipationParams, bb as CreateWalletOwnershipChallengeParams, bc as Cursor, an as DebugEvent, bd as DocumentFormType, a6 as DocumentSubmission, be as DocumentSubmissionStatus, bf as DocumentType, bg as ETHEREUM_CHAINS, bh as EpochMillis, E as Erc20Namespace, bi as Erc20NamespaceImpl, bj as FaqItem, ao as FrontlineEventId, bk as GetCentrifugeVaultStatusParams, bl as GetOndoQuoteParams, bm as GetOndoTradingStatusParams, bn as GetSwapAuthorizationParams, bo as GetSwapPreviewParams, bp as GetTokenAllowanceParams, bq as GetTokenBalanceParams, br as HexEncodedTransactionData, aq as HttpResponse, bs as Isin, bt as Iso2CountryCode, a5 as KycLevelName, ar as KycToken, bu as Link, bv as ListOptionAddressesParams, as as LogBinding, at as LogBindings, au as LogCause, av as LogLevel, aw as LogScope, ax as LogValue, L as Logger, bw as MAX_ASSET_DECIMALS, bx as MAX_UINT_256, by as Milestone, bz as Millis, D as OAuthAccessToken, bA as OAuthRefreshToken, aF as OAuthSession, $ as Offer, bB as OfferBase, I as OfferDetail, bC as OfferDetailBase, bD as OfferEditorial, i as OfferId, bE as OfferOption, a3 as OfferOptionAddress, ak as OfferOptionAddressId, j as OfferOptionId, bF as OfferOptionSlug, bG as OfferSlug, M as OfferType, O as OfferVaultContract, F as OffersNamespace, bH as OffersNamespaceImpl, m as OndoNamespace, s as OndoNamespaceImpl, ag as OndoQuote, bI as OndoQuoteDuration, ah as OndoQuoteSize, bJ as OndoSellOutcome, bK as OndoSwapOffer, N as OndoSwapOfferDetail, q as OndoSwapTransactionCore, ad as OndoTradingStatus, r as OrderBookSide, bL as PKCEState, bM as PaginatedResponseDto, P as Participation, bN as ParticipationId, bO as ParticipationStatus, bP as ParticipationsPaginationParams, bQ as PauseFlags, bR as Pii, bS as PiiAddress, bT as PiiJurisdiction, bU as PiiKind, a8 as PinoLoggerOptions, ay as ProductionLogLevel, bV as QueryParamValue, bW as QueryParamValues, az as RedactedWalletError, bX as RedirectUri, bY as RemoveOptionAddressParams, aA as RequestId, x as Requirement, bZ as RequirementActionNeededReason, a4 as RequirementId, a0 as RequirementStatusInfo, a2 as RequirementStatusValue, a1 as RequirementType, R as RequirementsNamespace, y as RequirementsNamespaceImpl, b_ as RpcConfig, aB as RpcFailureReason, b$ as SOLANA_CHAINS, c0 as STABLE_DECIMALS, aC as SafeEvent, aD as SafeFields, Y as Seconds, c1 as SolanaChain, c2 as SubmitDocumentParams, S as SuperstateSwapNamespace, w as SuperstateSwapNamespaceImpl, c3 as SuperstateSwapOffer, V as SuperstateSwapOfferDetail, c4 as SwapContractRef, c5 as SwapPreview, c6 as TermItem, c7 as Ticker, ai as TokenIdentifier, am as TokenLogo, c8 as TokenLogoImage, c9 as TokenLogoUrl, ca as TokenRole, T as TokensNamespace, cb as TokensNamespaceImpl, cc as Tx, aE as UnredactedFields, cd as WalletAddress, a7 as WalletChallengeType, W as WalletError, ce as WalletOwnershipChallenge, cf as WalletProtocol, t as WalletsNamespace, cg as WalletsNamespaceImpl, ch as apiErrorCode, ci as assertUint256, cj as isChain, ck as isExpired, cl as isOfferType, cm as parseUint256 } from '../time-CVZpAkGY.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-bR14QehS.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-bR14QehS.cjs';
|
|
5
5
|
import { TransactionReceipt, Hash, Chain } from 'viem';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -15,6 +15,55 @@ 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 the vault status. The read is
|
|
20
|
+
* free - it spends no attestation - so this is paced for a gate the user can
|
|
21
|
+
* trust rather than for cost.
|
|
22
|
+
*/
|
|
23
|
+
declare const CENTRIFUGE_POLL_INTERVAL_MS = 15000;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* One chain a vault offer runs on, with everything a screen needs to read and
|
|
27
|
+
* show a position there: the proxy every request and claim goes through, the
|
|
28
|
+
* share token it issues, and the funding token it is paid in.
|
|
29
|
+
*
|
|
30
|
+
* The share token's `symbol` is what every `/v1/centrifuge/vault/*` call is
|
|
31
|
+
* keyed by.
|
|
32
|
+
*/
|
|
33
|
+
type CentrifugeVault = {
|
|
34
|
+
chain: EthereumChain;
|
|
35
|
+
proxy: EvmContractAddress;
|
|
36
|
+
share: TokenMetadata;
|
|
37
|
+
funding: TokenMetadata;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The vaults an offer runs on, or why a chain could not be resolved: one
|
|
41
|
+
* entry per `vaultContracts` chain, in the offer's order.
|
|
42
|
+
*/
|
|
43
|
+
type CentrifugeVaultResolution = {
|
|
44
|
+
type: 'resolved';
|
|
45
|
+
vault: CentrifugeVault;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'unresolved';
|
|
48
|
+
chain: OfferToken['chain'];
|
|
49
|
+
/** Which token the offer or the registry could not name. */
|
|
50
|
+
missing: 'share-token' | 'funding-token' | 'evm-chain';
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Resolves each chain of a vault offer to its share and funding tokens.
|
|
54
|
+
*
|
|
55
|
+
* The offer names tokens by role and address only - the share token as
|
|
56
|
+
* `vault`, the coin it is paid in as `funding` - so `lookup` turns each into
|
|
57
|
+
* metadata. A function rather than a registry snapshot, so this module does
|
|
58
|
+
* not depend on where the metadata comes from.
|
|
59
|
+
*
|
|
60
|
+
* A chain whose tokens cannot be named is reported rather than dropped: its
|
|
61
|
+
* position cannot be read without the symbol, and a caller has to know it is
|
|
62
|
+
* not showing it. When a chain lists several funding tokens, the first one
|
|
63
|
+
* `lookup` knows wins - a vault is priced in one.
|
|
64
|
+
*/
|
|
65
|
+
declare function resolveCentrifugeVaults(offer: CentrifugeVaultOfferDetail, lookup: (token: OfferToken) => TokenMetadata | null): CentrifugeVaultResolution[];
|
|
66
|
+
|
|
18
67
|
/**
|
|
19
68
|
* How often the Ondo checkout refreshes what it is allowed to poll: the market
|
|
20
69
|
* status and the indicative price. Both are free - neither spends an
|
|
@@ -129,6 +178,26 @@ declare function computeOndoSellPrice(transaction: OndoSellTransaction): Blockch
|
|
|
129
178
|
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
130
179
|
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
131
180
|
|
|
181
|
+
/**
|
|
182
|
+
* The CoinList API's error code for an Ondo quote refused because the asset
|
|
183
|
+
* cannot be traded right now: the market is closed or paused, or the asset is
|
|
184
|
+
* paused or closed for the session. It arrives on a 409.
|
|
185
|
+
*
|
|
186
|
+
* One code for all four of Ondo's reasons, because the remedy is the same:
|
|
187
|
+
* wait for the market to open. Ondo pauses for a moment at every US session
|
|
188
|
+
* change (04:00 and 16:00 ET), so a poll can land on one even while
|
|
189
|
+
* `getTradingStatus` reported the asset tradable a second earlier.
|
|
190
|
+
*/
|
|
191
|
+
declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
192
|
+
/**
|
|
193
|
+
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
194
|
+
* market is not open, as opposed to a request that failed.
|
|
195
|
+
*
|
|
196
|
+
* Total: anything that is not an `HttpError` carrying
|
|
197
|
+
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
198
|
+
*/
|
|
199
|
+
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
200
|
+
|
|
132
201
|
/**
|
|
133
202
|
* The Superstate swap contract's ABI, generated verbatim from the shared
|
|
134
203
|
* `TokenSwap` base contract:
|
|
@@ -1122,6 +1191,13 @@ declare const ERC20_ABI: readonly [{
|
|
|
1122
1191
|
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1123
1192
|
type FormatAmountOptions = {
|
|
1124
1193
|
maxFractionDigits?: AssetDecimals;
|
|
1194
|
+
/**
|
|
1195
|
+
* Trailing zeros are kept down to this many places. Defaults to
|
|
1196
|
+
* `maxFractionDigits` when that is set, otherwise 2 (or the token's own
|
|
1197
|
+
* decimals, when fewer). A figure that wants a cap and a shorter floor —
|
|
1198
|
+
* a share headline — passes both.
|
|
1199
|
+
*/
|
|
1200
|
+
minFractionDigits?: AssetDecimals;
|
|
1125
1201
|
};
|
|
1126
1202
|
declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
|
|
1127
1203
|
declare function formatRawAmount(amount: BlockchainAmount): string;
|
|
@@ -1137,6 +1213,16 @@ declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
|
|
|
1137
1213
|
declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
|
|
1138
1214
|
/** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
|
|
1139
1215
|
declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
|
|
1216
|
+
/**
|
|
1217
|
+
* A share quantity for a headline: at most 6 decimal places, at least 2, with
|
|
1218
|
+
* the zeros between those dropped.
|
|
1219
|
+
*
|
|
1220
|
+
* An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
|
|
1221
|
+
* confirmation row and the fund name collapses to an ellipsis. Places past 6
|
|
1222
|
+
* are dust at share scale. The chain amount is unchanged, and the transaction
|
|
1223
|
+
* link still carries the exact figure.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1140
1226
|
/**
|
|
1141
1227
|
* Formats a USD amount capped at 2 fractional digits, falling back to the
|
|
1142
1228
|
* {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
|
|
@@ -1273,4 +1359,4 @@ declare const User: {
|
|
|
1273
1359
|
fromDto: (dto: UserDto) => User;
|
|
1274
1360
|
};
|
|
1275
1361
|
|
|
1276
|
-
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, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|
|
1362
|
+
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, 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 {
|
|
2
|
-
export {
|
|
3
|
-
import { N as NonEmptyArray, S as SwapQuote, F as FormattedAmountAssetUi, T as TxExplorerUrl,
|
|
4
|
-
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet,
|
|
1
|
+
import { aI as PaginationParams, aJ as PaginatedResponse, a as EthereumChain, b as EvmContractAddress, J as TokenMetadata, aL as OfferToken, K as CentrifugeVaultOfferDetail, aM as DecimalString, G as StablecoinSymbol, o as OndoBuyTransaction, B as BlockchainAmount, p as OndoSellTransaction, ap as HttpError, u as Bps, aN as SwapStatus, a9 as AssetDecimals, n as OfferSwapContract, aO as Uint256, d as AssetSymbol, v as EvmWalletAddress, aP as KnownAssetSymbol, H as Erc20Asset, aQ as Newtype } from '../time-CVZpAkGY.js';
|
|
2
|
+
export { aR as AllowWalletParams, aS as AllowWalletResponse, aT as Asset, aU as AssetCode, k as AssetId, _ as AsyncOfferDetail, Z as AsyncOfferType, A as AuthorizationCode, aV as Blockchain, aa as BuildCentrifugeVaultBuyParams, ae as BuildOndoBuyParams, af as BuildOndoSellParams, aW as BuildOndoSwapParamsCore, f as CentrifugeClaimDirection, c as CentrifugeNamespace, g as CentrifugeNamespaceImpl, ab as CentrifugeOrderReason, ac as CentrifugeOrderability, aX as CentrifugePositionStatus, e as CentrifugeVaultBuyTransaction, aY as CentrifugeVaultClaimProceedsTransaction, aZ as CentrifugeVaultClaimTransaction, aj as CentrifugeVaultLeg, X as CentrifugeVaultLegId, a_ as CentrifugeVaultOffer, a$ as CentrifugeVaultPosition, b0 as CentrifugeVaultReason, b1 as CentrifugeVaultRedeemPosition, al as CentrifugeVaultStatus, b2 as CentrifugeVaultTransactionCore, b3 as CentrifugeWalletParams, b4 as Chain, aG as ClientCredentialsOAuth, b5 as ClientId, aK as ClientSecret, b6 as CodeChallenge, C as CodeVerifier, h as CoinListTokenSaleNamespace, l as CoinListTokenSaleNamespaceImpl, b7 as CoinListTokenSaleOffer, Q as CoinListTokenSaleOfferDetail, z as Config, b8 as ConnectExternalWalletParams, b9 as CreateKycTokenParams, ba as CreateParticipationParams, bb as CreateWalletOwnershipChallengeParams, bc as Cursor, an as DebugEvent, bd as DocumentFormType, a6 as DocumentSubmission, be as DocumentSubmissionStatus, bf as DocumentType, bg as ETHEREUM_CHAINS, bh as EpochMillis, E as Erc20Namespace, bi as Erc20NamespaceImpl, bj as FaqItem, ao as FrontlineEventId, bk as GetCentrifugeVaultStatusParams, bl as GetOndoQuoteParams, bm as GetOndoTradingStatusParams, bn as GetSwapAuthorizationParams, bo as GetSwapPreviewParams, bp as GetTokenAllowanceParams, bq as GetTokenBalanceParams, br as HexEncodedTransactionData, aq as HttpResponse, bs as Isin, bt as Iso2CountryCode, a5 as KycLevelName, ar as KycToken, bu as Link, bv as ListOptionAddressesParams, as as LogBinding, at as LogBindings, au as LogCause, av as LogLevel, aw as LogScope, ax as LogValue, L as Logger, bw as MAX_ASSET_DECIMALS, bx as MAX_UINT_256, by as Milestone, bz as Millis, D as OAuthAccessToken, bA as OAuthRefreshToken, aF as OAuthSession, $ as Offer, bB as OfferBase, I as OfferDetail, bC as OfferDetailBase, bD as OfferEditorial, i as OfferId, bE as OfferOption, a3 as OfferOptionAddress, ak as OfferOptionAddressId, j as OfferOptionId, bF as OfferOptionSlug, bG as OfferSlug, M as OfferType, O as OfferVaultContract, F as OffersNamespace, bH as OffersNamespaceImpl, m as OndoNamespace, s as OndoNamespaceImpl, ag as OndoQuote, bI as OndoQuoteDuration, ah as OndoQuoteSize, bJ as OndoSellOutcome, bK as OndoSwapOffer, N as OndoSwapOfferDetail, q as OndoSwapTransactionCore, ad as OndoTradingStatus, r as OrderBookSide, bL as PKCEState, bM as PaginatedResponseDto, P as Participation, bN as ParticipationId, bO as ParticipationStatus, bP as ParticipationsPaginationParams, bQ as PauseFlags, bR as Pii, bS as PiiAddress, bT as PiiJurisdiction, bU as PiiKind, a8 as PinoLoggerOptions, ay as ProductionLogLevel, bV as QueryParamValue, bW as QueryParamValues, az as RedactedWalletError, bX as RedirectUri, bY as RemoveOptionAddressParams, aA as RequestId, x as Requirement, bZ as RequirementActionNeededReason, a4 as RequirementId, a0 as RequirementStatusInfo, a2 as RequirementStatusValue, a1 as RequirementType, R as RequirementsNamespace, y as RequirementsNamespaceImpl, b_ as RpcConfig, aB as RpcFailureReason, b$ as SOLANA_CHAINS, c0 as STABLE_DECIMALS, aC as SafeEvent, aD as SafeFields, Y as Seconds, c1 as SolanaChain, c2 as SubmitDocumentParams, S as SuperstateSwapNamespace, w as SuperstateSwapNamespaceImpl, c3 as SuperstateSwapOffer, V as SuperstateSwapOfferDetail, c4 as SwapContractRef, c5 as SwapPreview, c6 as TermItem, c7 as Ticker, ai as TokenIdentifier, am as TokenLogo, c8 as TokenLogoImage, c9 as TokenLogoUrl, ca as TokenRole, T as TokensNamespace, cb as TokensNamespaceImpl, cc as Tx, aE as UnredactedFields, cd as WalletAddress, a7 as WalletChallengeType, W as WalletError, ce as WalletOwnershipChallenge, cf as WalletProtocol, t as WalletsNamespace, cg as WalletsNamespaceImpl, ch as apiErrorCode, ci as assertUint256, cj as isChain, ck as isExpired, cl as isOfferType, cm as parseUint256 } from '../time-CVZpAkGY.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-BkwA8KmD.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-BkwA8KmD.js';
|
|
5
5
|
import { TransactionReceipt, Hash, Chain } from 'viem';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -15,6 +15,55 @@ 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 the vault status. The read is
|
|
20
|
+
* free - it spends no attestation - so this is paced for a gate the user can
|
|
21
|
+
* trust rather than for cost.
|
|
22
|
+
*/
|
|
23
|
+
declare const CENTRIFUGE_POLL_INTERVAL_MS = 15000;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* One chain a vault offer runs on, with everything a screen needs to read and
|
|
27
|
+
* show a position there: the proxy every request and claim goes through, the
|
|
28
|
+
* share token it issues, and the funding token it is paid in.
|
|
29
|
+
*
|
|
30
|
+
* The share token's `symbol` is what every `/v1/centrifuge/vault/*` call is
|
|
31
|
+
* keyed by.
|
|
32
|
+
*/
|
|
33
|
+
type CentrifugeVault = {
|
|
34
|
+
chain: EthereumChain;
|
|
35
|
+
proxy: EvmContractAddress;
|
|
36
|
+
share: TokenMetadata;
|
|
37
|
+
funding: TokenMetadata;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The vaults an offer runs on, or why a chain could not be resolved: one
|
|
41
|
+
* entry per `vaultContracts` chain, in the offer's order.
|
|
42
|
+
*/
|
|
43
|
+
type CentrifugeVaultResolution = {
|
|
44
|
+
type: 'resolved';
|
|
45
|
+
vault: CentrifugeVault;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'unresolved';
|
|
48
|
+
chain: OfferToken['chain'];
|
|
49
|
+
/** Which token the offer or the registry could not name. */
|
|
50
|
+
missing: 'share-token' | 'funding-token' | 'evm-chain';
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Resolves each chain of a vault offer to its share and funding tokens.
|
|
54
|
+
*
|
|
55
|
+
* The offer names tokens by role and address only - the share token as
|
|
56
|
+
* `vault`, the coin it is paid in as `funding` - so `lookup` turns each into
|
|
57
|
+
* metadata. A function rather than a registry snapshot, so this module does
|
|
58
|
+
* not depend on where the metadata comes from.
|
|
59
|
+
*
|
|
60
|
+
* A chain whose tokens cannot be named is reported rather than dropped: its
|
|
61
|
+
* position cannot be read without the symbol, and a caller has to know it is
|
|
62
|
+
* not showing it. When a chain lists several funding tokens, the first one
|
|
63
|
+
* `lookup` knows wins - a vault is priced in one.
|
|
64
|
+
*/
|
|
65
|
+
declare function resolveCentrifugeVaults(offer: CentrifugeVaultOfferDetail, lookup: (token: OfferToken) => TokenMetadata | null): CentrifugeVaultResolution[];
|
|
66
|
+
|
|
18
67
|
/**
|
|
19
68
|
* How often the Ondo checkout refreshes what it is allowed to poll: the market
|
|
20
69
|
* status and the indicative price. Both are free - neither spends an
|
|
@@ -129,6 +178,26 @@ declare function computeOndoSellPrice(transaction: OndoSellTransaction): Blockch
|
|
|
129
178
|
/** The sooner of Ondo's deadline and now + {@link ONDO_QUOTE_MAX_TTL_MS}. */
|
|
130
179
|
declare function ondoQuoteOfferDeadline(expiresAt: Date, nowMs?: number): Date;
|
|
131
180
|
|
|
181
|
+
/**
|
|
182
|
+
* The CoinList API's error code for an Ondo quote refused because the asset
|
|
183
|
+
* cannot be traded right now: the market is closed or paused, or the asset is
|
|
184
|
+
* paused or closed for the session. It arrives on a 409.
|
|
185
|
+
*
|
|
186
|
+
* One code for all four of Ondo's reasons, because the remedy is the same:
|
|
187
|
+
* wait for the market to open. Ondo pauses for a moment at every US session
|
|
188
|
+
* change (04:00 and 16:00 ET), so a poll can land on one even while
|
|
189
|
+
* `getTradingStatus` reported the asset tradable a second earlier.
|
|
190
|
+
*/
|
|
191
|
+
declare const ONDO_NOT_TRADABLE_CODE = "not_tradable";
|
|
192
|
+
/**
|
|
193
|
+
* Whether `error` is the CoinList API refusing an Ondo quote because the
|
|
194
|
+
* market is not open, as opposed to a request that failed.
|
|
195
|
+
*
|
|
196
|
+
* Total: anything that is not an `HttpError` carrying
|
|
197
|
+
* {@link ONDO_NOT_TRADABLE_CODE} is `false`.
|
|
198
|
+
*/
|
|
199
|
+
declare function isOndoNotTradableError(error: unknown): error is HttpError;
|
|
200
|
+
|
|
132
201
|
/**
|
|
133
202
|
* The Superstate swap contract's ABI, generated verbatim from the shared
|
|
134
203
|
* `TokenSwap` base contract:
|
|
@@ -1122,6 +1191,13 @@ declare const ERC20_ABI: readonly [{
|
|
|
1122
1191
|
declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
|
|
1123
1192
|
type FormatAmountOptions = {
|
|
1124
1193
|
maxFractionDigits?: AssetDecimals;
|
|
1194
|
+
/**
|
|
1195
|
+
* Trailing zeros are kept down to this many places. Defaults to
|
|
1196
|
+
* `maxFractionDigits` when that is set, otherwise 2 (or the token's own
|
|
1197
|
+
* decimals, when fewer). A figure that wants a cap and a shorter floor —
|
|
1198
|
+
* a share headline — passes both.
|
|
1199
|
+
*/
|
|
1200
|
+
minFractionDigits?: AssetDecimals;
|
|
1125
1201
|
};
|
|
1126
1202
|
declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
|
|
1127
1203
|
declare function formatRawAmount(amount: BlockchainAmount): string;
|
|
@@ -1137,6 +1213,16 @@ declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
|
|
|
1137
1213
|
declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
|
|
1138
1214
|
/** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
|
|
1139
1215
|
declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
|
|
1216
|
+
/**
|
|
1217
|
+
* A share quantity for a headline: at most 6 decimal places, at least 2, with
|
|
1218
|
+
* the zeros between those dropped.
|
|
1219
|
+
*
|
|
1220
|
+
* An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
|
|
1221
|
+
* confirmation row and the fund name collapses to an ellipsis. Places past 6
|
|
1222
|
+
* are dust at share scale. The chain amount is unchanged, and the transaction
|
|
1223
|
+
* link still carries the exact figure.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
|
|
1140
1226
|
/**
|
|
1141
1227
|
* Formats a USD amount capped at 2 fractional digits, falling back to the
|
|
1142
1228
|
* {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
|
|
@@ -1273,4 +1359,4 @@ declare const User: {
|
|
|
1273
1359
|
fromDto: (dto: UserDto) => User;
|
|
1274
1360
|
};
|
|
1275
1361
|
|
|
1276
|
-
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, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
|
|
1362
|
+
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, 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 };
|
package/dist/universal/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthorizationCode,
|
|
3
3
|
BPS_DENOM,
|
|
4
|
+
CENTRIFUGE_POLL_INTERVAL_MS,
|
|
4
5
|
ClientId,
|
|
5
6
|
ClientSecret,
|
|
6
7
|
CodeChallenge,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
|
|
10
11
|
DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE,
|
|
11
12
|
DEFAULT_SLIPPAGE_BPS,
|
|
13
|
+
ONDO_NOT_TRADABLE_CODE,
|
|
12
14
|
ONDO_POLL_INTERVAL_MS,
|
|
13
15
|
ONDO_QUOTE_MAX_TTL_MS,
|
|
14
16
|
ONDO_SETTLEMENT_ASSET,
|
|
@@ -33,6 +35,7 @@ import {
|
|
|
33
35
|
User,
|
|
34
36
|
UserEmail,
|
|
35
37
|
UserId,
|
|
38
|
+
WalletSelection,
|
|
36
39
|
applyBps,
|
|
37
40
|
computeOndoBuyPrice,
|
|
38
41
|
computeOndoSellPrice,
|
|
@@ -41,12 +44,14 @@ import {
|
|
|
41
44
|
decodeSwappedOutputAmount,
|
|
42
45
|
formattedPricePerShare,
|
|
43
46
|
generatePKCEParams,
|
|
47
|
+
isOndoNotTradableError,
|
|
44
48
|
isSwapAvailable,
|
|
45
49
|
offerDisplayTokens,
|
|
46
50
|
ondoQuoteOfferDeadline,
|
|
51
|
+
resolveCentrifugeVaults,
|
|
47
52
|
superstateSwapContractAddress,
|
|
48
53
|
swapSpender
|
|
49
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-IZJ4JSSC.js";
|
|
50
55
|
import {
|
|
51
56
|
AllowWalletResponse,
|
|
52
57
|
Asset,
|
|
@@ -55,9 +60,19 @@ import {
|
|
|
55
60
|
AssetIconUrl,
|
|
56
61
|
AssetId,
|
|
57
62
|
AssetSymbol,
|
|
63
|
+
AsyncOfferDetail,
|
|
58
64
|
Blockchain,
|
|
59
65
|
BlockchainAmount,
|
|
60
66
|
Bps,
|
|
67
|
+
CentrifugeNamespaceImpl,
|
|
68
|
+
CentrifugeVaultBuyTransaction,
|
|
69
|
+
CentrifugeVaultClaimProceedsTransaction,
|
|
70
|
+
CentrifugeVaultClaimTransaction,
|
|
71
|
+
CentrifugeVaultLeg,
|
|
72
|
+
CentrifugeVaultLegId,
|
|
73
|
+
CentrifugeVaultPosition,
|
|
74
|
+
CentrifugeVaultRedeemPosition,
|
|
75
|
+
CentrifugeVaultStatus,
|
|
61
76
|
Chain,
|
|
62
77
|
ClientCredentialsOAuth,
|
|
63
78
|
CoinListTokenSaleNamespaceImpl,
|
|
@@ -69,6 +84,7 @@ import {
|
|
|
69
84
|
DocumentSubmission,
|
|
70
85
|
ERC20_ABI,
|
|
71
86
|
ETHEREUM_CHAINS,
|
|
87
|
+
EpochMillis,
|
|
72
88
|
Erc20NamespaceImpl,
|
|
73
89
|
EthereumChain,
|
|
74
90
|
EvmContractAddress,
|
|
@@ -89,6 +105,7 @@ import {
|
|
|
89
105
|
MAX_UINT_256,
|
|
90
106
|
MathError,
|
|
91
107
|
Milestone,
|
|
108
|
+
Millis,
|
|
92
109
|
NA_AMOUNT_ASSET_UI,
|
|
93
110
|
NotAuthenticatedError,
|
|
94
111
|
NotImplementedError,
|
|
@@ -106,6 +123,7 @@ import {
|
|
|
106
123
|
OfferSlug,
|
|
107
124
|
OfferSwapContract,
|
|
108
125
|
OfferToken,
|
|
126
|
+
OfferVaultContract,
|
|
109
127
|
OndoBuyTransaction,
|
|
110
128
|
OndoNamespaceImpl,
|
|
111
129
|
OndoQuote,
|
|
@@ -127,6 +145,7 @@ import {
|
|
|
127
145
|
SOLANA_CHAINS,
|
|
128
146
|
STABLE_DECIMALS,
|
|
129
147
|
SUPERSTATE_SWAP_ABI,
|
|
148
|
+
Seconds,
|
|
130
149
|
ShortenedWalletAddress,
|
|
131
150
|
SolanaChain,
|
|
132
151
|
StablecoinSymbol,
|
|
@@ -154,10 +173,12 @@ import {
|
|
|
154
173
|
formatBpsAsPercent,
|
|
155
174
|
formatCompactAmount,
|
|
156
175
|
formatRawAmount,
|
|
176
|
+
formatShareAmount,
|
|
157
177
|
formattedUsdPrice,
|
|
158
178
|
getChainId,
|
|
159
179
|
getNetworkName,
|
|
160
180
|
isChain,
|
|
181
|
+
isExpired,
|
|
161
182
|
isOfferType,
|
|
162
183
|
parseBlockchainAmount,
|
|
163
184
|
parseUint256,
|
|
@@ -165,7 +186,7 @@ import {
|
|
|
165
186
|
txExplorerUrl,
|
|
166
187
|
usdAmount,
|
|
167
188
|
viemChain
|
|
168
|
-
} from "../chunk-
|
|
189
|
+
} from "../chunk-C6GF7MDF.js";
|
|
169
190
|
export {
|
|
170
191
|
AllowWalletResponse,
|
|
171
192
|
Asset,
|
|
@@ -174,11 +195,22 @@ export {
|
|
|
174
195
|
AssetIconUrl,
|
|
175
196
|
AssetId,
|
|
176
197
|
AssetSymbol,
|
|
198
|
+
AsyncOfferDetail,
|
|
177
199
|
AuthorizationCode,
|
|
178
200
|
BPS_DENOM,
|
|
179
201
|
Blockchain,
|
|
180
202
|
BlockchainAmount,
|
|
181
203
|
Bps,
|
|
204
|
+
CENTRIFUGE_POLL_INTERVAL_MS,
|
|
205
|
+
CentrifugeNamespaceImpl,
|
|
206
|
+
CentrifugeVaultBuyTransaction,
|
|
207
|
+
CentrifugeVaultClaimProceedsTransaction,
|
|
208
|
+
CentrifugeVaultClaimTransaction,
|
|
209
|
+
CentrifugeVaultLeg,
|
|
210
|
+
CentrifugeVaultLegId,
|
|
211
|
+
CentrifugeVaultPosition,
|
|
212
|
+
CentrifugeVaultRedeemPosition,
|
|
213
|
+
CentrifugeVaultStatus,
|
|
182
214
|
Chain,
|
|
183
215
|
ClientCredentialsOAuth,
|
|
184
216
|
ClientId,
|
|
@@ -198,6 +230,7 @@ export {
|
|
|
198
230
|
DocumentSubmission,
|
|
199
231
|
ERC20_ABI,
|
|
200
232
|
ETHEREUM_CHAINS,
|
|
233
|
+
EpochMillis,
|
|
201
234
|
Erc20NamespaceImpl,
|
|
202
235
|
EthereumChain,
|
|
203
236
|
EvmContractAddress,
|
|
@@ -218,11 +251,13 @@ export {
|
|
|
218
251
|
MAX_UINT_256,
|
|
219
252
|
MathError,
|
|
220
253
|
Milestone,
|
|
254
|
+
Millis,
|
|
221
255
|
NA_AMOUNT_ASSET_UI,
|
|
222
256
|
NotAuthenticatedError,
|
|
223
257
|
NotImplementedError,
|
|
224
258
|
OAuthRefreshToken,
|
|
225
259
|
OAuthSession,
|
|
260
|
+
ONDO_NOT_TRADABLE_CODE,
|
|
226
261
|
ONDO_POLL_INTERVAL_MS,
|
|
227
262
|
ONDO_QUOTE_MAX_TTL_MS,
|
|
228
263
|
ONDO_SETTLEMENT_ASSET,
|
|
@@ -239,6 +274,7 @@ export {
|
|
|
239
274
|
OfferSlug,
|
|
240
275
|
OfferSwapContract,
|
|
241
276
|
OfferToken,
|
|
277
|
+
OfferVaultContract,
|
|
242
278
|
OffersNamespaceImpl,
|
|
243
279
|
OndoBuyTransaction,
|
|
244
280
|
OndoNamespaceImpl,
|
|
@@ -270,6 +306,7 @@ export {
|
|
|
270
306
|
SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
|
|
271
307
|
SWAP_LEVEL,
|
|
272
308
|
SWAP_POLL_INTERVAL_MS,
|
|
309
|
+
Seconds,
|
|
273
310
|
ShortenedWalletAddress,
|
|
274
311
|
SolanaChain,
|
|
275
312
|
StablecoinSymbol,
|
|
@@ -296,6 +333,7 @@ export {
|
|
|
296
333
|
ValidationError,
|
|
297
334
|
WalletAddress,
|
|
298
335
|
WalletOwnershipChallenge,
|
|
336
|
+
WalletSelection,
|
|
299
337
|
WalletsNamespaceImpl,
|
|
300
338
|
apiErrorCode,
|
|
301
339
|
applyBps,
|
|
@@ -313,18 +351,22 @@ export {
|
|
|
313
351
|
formatBpsAsPercent,
|
|
314
352
|
formatCompactAmount,
|
|
315
353
|
formatRawAmount,
|
|
354
|
+
formatShareAmount,
|
|
316
355
|
formattedPricePerShare,
|
|
317
356
|
formattedUsdPrice,
|
|
318
357
|
generatePKCEParams,
|
|
319
358
|
getChainId,
|
|
320
359
|
getNetworkName,
|
|
321
360
|
isChain,
|
|
361
|
+
isExpired,
|
|
322
362
|
isOfferType,
|
|
363
|
+
isOndoNotTradableError,
|
|
323
364
|
isSwapAvailable,
|
|
324
365
|
offerDisplayTokens,
|
|
325
366
|
ondoQuoteOfferDeadline,
|
|
326
367
|
parseBlockchainAmount,
|
|
327
368
|
parseUint256,
|
|
369
|
+
resolveCentrifugeVaults,
|
|
328
370
|
shortenAddress,
|
|
329
371
|
superstateSwapContractAddress,
|
|
330
372
|
swapSpender,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/universal/api/nabu/config.ts","../src/universal/api/rpc/public-clients.ts","../src/universal/api/rpc/frontline-transport.ts","../src/universal/core/shared/observability/pino-logger.ts","../src/universal/api/middleware/attach-session-middleware.ts","../src/universal/api/middleware/idempotency-key.ts","../src/universal/api/middleware/request-retry.ts","../src/universal/api/middleware/session-renewal.ts","../src/universal/api/authenticated-api-client.ts"],"sourcesContent":["/**\n * Base URL of CoinList's public token registry (Nabu), a static CDN serving\n * token display metadata keyed by chain + contract address. Override per\n * environment via `Config.tokensBaseUrl`.\n */\nexport const NABU_BASE_URL = 'https://asset.coinlist.co';\n","import {\n createPublicClient,\n http,\n type PublicClient,\n type Transport,\n} from 'viem';\nimport type { Sender } from '@/universal/api/http-client';\nimport { frontlineTransport } from '@/universal/api/rpc/frontline-transport';\nimport { viemChain } from '@/universal/core/shared/blockchain/chain';\nimport type { EthereumChain } from '@/universal/types/blockchain/core';\nimport type { RpcConfig } from '@/universal/types/config';\nimport type { Logger } from '@/universal/types/logger';\n\n/**\n * Resolves a chain to the viem `PublicClient` the SDK reads it through.\n *\n * One function rather than a client per read, because the client is where the\n * batching lives: viem's multicall scheduler is keyed on the client's `uid`,\n * so two reads only ever share an `eth_call` if they share a client. Hence the\n * memoisation - it is correctness for batching, not a performance tweak.\n */\nexport type PublicClients = (chain: EthereumChain) => PublicClient;\n\n/**\n * Builds the per-chain `PublicClient` factory, lazily and once per chain.\n *\n * `batch: { multicall: true }` routes concurrent `eth_call`s through\n * Multicall3, whose address comes from viem's own chain definitions (see\n * `viemChain`). A checkout screen mounts several hooks that each read\n * independently - status, authorization, allowance, balance - and they collapse\n * into a single request. Per-call failures survive it: viem calls `aggregate3`\n * with `allowFailure: true` and re-throws each revert on its own call.\n *\n * **A read reached through these clients must take its subject as an\n * argument.** Batching makes `msg.sender` the Multicall3 address rather than\n * the caller, so a view that reads `msg.sender` would answer differently under\n * batching than without. Nothing the SDK reads does - `allowance(owner,\n * spender)`, `balanceOf(account)`, `authorized(user)` all name theirs - and a\n * new read must keep it that way.\n */\nexport function publicClients(\n api: Sender,\n config: RpcConfig | undefined,\n logger: Logger | null = null\n): PublicClients {\n const cache = new Map<EthereumChain, PublicClient>();\n\n return (chain) => {\n const cached = cache.get(chain);\n if (cached) return cached;\n\n const client = createPublicClient({\n chain: viemChain(chain),\n transport: transportFor(api, config?.[chain], chain, logger),\n batch: { multicall: true },\n });\n cache.set(chain, client);\n return client;\n };\n}\n\n/**\n * A host's override, or CoinList's proxy. A string is a URL the SDK wraps in\n * `http()`; a {@link Transport} is used as it stands, so `fallback([...])` and\n * a partner's own transport both pass through untouched.\n *\n * Only the proxy transport is given the logger. A host's own transport reports\n * however they built it, and viem's `http()` has no logging seam, so a host on\n * their own node gets whatever they wired up and nothing from the SDK.\n */\nfunction transportFor(\n api: Sender,\n override: string | Transport | undefined,\n chain: EthereumChain,\n logger: Logger | null\n): Transport {\n if (override === undefined) return frontlineTransport(api, chain, logger);\n return typeof override === 'string' ? http(override) : override;\n}\n","import { custom, RpcRequestError, type Transport } from 'viem';\nimport { HttpError } from '@/universal/api/http';\nimport { Attributes } from '@/universal/api/http-attributes';\nimport type { Sender } from '@/universal/api/http-client';\nimport {\n type InternalLogger,\n internalLogger,\n} from '@/universal/core/shared/observability/internal-logger';\nimport type { EthereumChain } from '@/universal/types/blockchain/core';\nimport type { Logger } from '@/universal/types/logger';\n\n/**\n * A viem {@link Transport} that speaks JSON-RPC to CoinList's proxy,\n * `POST /v1/chains/{chain}/rpc`.\n *\n * Built over the SDK's own {@link Sender} rather than viem's `http()`, so an\n * on-chain read is an SDK request like any other: it carries the bearer token,\n * renews a stale session on a 401 and retries, is stamped with a request id,\n * and is reported by `HttpClient` by construction. Pointing `http()` at the\n * same URL would mean a second HTTP path through the SDK with none of that.\n * Retrying is the `Sender`'s job alone: viem's own `retryCount` is set to `0`\n * here, because it would otherwise rerun that whole pipeline on top of itself.\n *\n * **This is where the session requirement lives**, and it is the proxy that\n * enforces it: the endpoint is OAuth-gated, so a logged-out read comes back\n * `401` and reaches the caller as viem's `ContractFunctionExecutionError`\n * wrapping the SDK's own `HttpError`. Deliberately *not* translated to\n * `NotAuthenticatedError` - viem re-wraps whatever a `Transport` throws, so the\n * translation would not survive to the caller anyway and would only buy a\n * promise the SDK cannot keep. `classifyLogCause` walks the chain, so the\n * failure still logs as the HTTP failure it is.\n *\n * A partner who supplies their own node via {@link RpcConfig} never reaches\n * this transport and correctly needs no CoinList session.\n *\n * **What its `RPC` lines add over the `HTTP` ones for the same request.** The\n * JSON-RPC method, which the path `/v1/chains/{chain}/rpc` does not carry; and\n * a JSON-RPC error, which usually arrives with HTTP 200 and is therefore an\n * `info` success as far as `HttpClient` can tell.\n *\n * **They do not name the contract call**, and cannot: `publicClients` batches\n * through Multicall3, so one `eth_call` here may be several reads and its `to`\n * is Multicall3 rather than any contract. What is available is on the `debug`\n * line - the raw params, so the target address and the calldata. Which method\n * asked for the read, and whether it reverted, come from the namespace above.\n */\nexport function frontlineTransport(\n api: Sender,\n chain: EthereumChain,\n logger: Logger | null = null\n): Transport {\n const log = internalLogger(logger, 'RPC');\n let nextId = 0;\n\n return custom(\n {\n async request({ method, params }) {\n const id = ++nextId;\n return sendRpc({ api, log, chain, id, method, params });\n },\n },\n // The `Sender` below already retries: `requestRetryMiddleware` makes three\n // attempts at a 5xx and `renewSessionMiddleware` re-sends once after a 401.\n // viem's own default is `retryCount: 3`, and it applies on top: an\n // `HttpError` carries no numeric `code`, so `buildRequest` wraps it in\n // `UnknownRpcError` (`code === -1`) and `shouldRetry` says yes. That reruns\n // the whole pipeline four times - twelve requests for one `eth_call`, and\n // with multicall batching one `eth_call` is a screen's worth of reads. The\n // SDK's retry policy is the one that applies, so viem's is turned off.\n { retryCount: 0 }\n );\n}\n\nasync function sendRpc({\n api,\n log,\n chain,\n id,\n method,\n params,\n}: {\n api: Sender;\n log: InternalLogger;\n chain: EthereumChain;\n /** The JSON-RPC envelope's `id`, unique per request within one transport. */\n id: number;\n method: string;\n /** The JSON-RPC method's own params, passed through untouched. */\n params: unknown;\n}): Promise<unknown> {\n const url = rpcPath(chain);\n const startedAt = Date.now();\n\n // `params` carries calldata, so the envelope is a `'debug'` disclosure.\n log.debug(() => ({\n msg: 'rpc call sent',\n fields: { id, method, chain, params },\n }));\n\n const response = await sendEnvelope(api, url, {\n jsonrpc: '2.0',\n id,\n method,\n params,\n });\n const elapsed = Date.now() - startedAt;\n\n // A JSON-RPC error usually arrives with HTTP 200, so the `Sender` hands it\n // back as a success. viem's own `http()` transport raises `RpcRequestError`\n // here, and every viem action above - `readContract`'s revert decoding\n // included - is written against that.\n if (response.error) {\n const error = new RpcRequestError({\n body: { method, params },\n error: response.error,\n url,\n });\n // `warn`: the node declined, and only the namespace above knows whether\n // that broke anything. The code is the node's own, not a message anyone\n // wrote about this request.\n //\n // The cause is stated rather than classified. viem's `buildRequest` maps a\n // `RpcRequestError` onto one of its `RpcError` subclasses on the way out,\n // which is what `classifyLogCause` recognises - but that happens *above*\n // this throw, so classifying here would answer `'unknown'` for every\n // rejection. This call site knows: the node answered with an error object.\n log.warning(\n () => ({\n msg: 'rpc call rejected',\n cause: { type: 'rpc', reason: 'node-rejected' },\n fields: {\n method,\n chain,\n duration_ms: elapsed,\n 'rpc.error_code': response.error?.code ?? null,\n },\n }),\n error\n );\n throw error;\n }\n\n log.info(() => ({\n msg: 'rpc call',\n fields: { method, chain, duration_ms: elapsed },\n }));\n return response.result;\n}\n\nfunction rpcPath(chain: EthereumChain): string {\n return `/v1/chains/${encodeURIComponent(chain)}/rpc`;\n}\n\n/**\n * Posts the envelope, and reads a JSON-RPC error out of a non-2xx as well.\n *\n * The proxy forwards the node's status alongside its body, so a node that\n * answers a JSON-RPC error with, say, a `400` reaches the `Sender` as an\n * {@link HttpError}. Left as that, the node's error code and any revert data\n * would be lost behind an opaque HTTP failure. An `HttpError` whose body is not\n * a JSON-RPC error - frontline's own `422` for an unsupported chain or a\n * disallowed method, a `401`, a `5xx` - is the HTTP failure it looks like and\n * propagates untouched.\n */\nasync function sendEnvelope(\n api: Sender,\n url: string,\n body: { jsonrpc: '2.0'; id: number; method: string; params: unknown }\n): Promise<JsonRpcResponse> {\n try {\n return await api.send<JsonRpcResponse>({\n method: 'POST',\n url,\n body,\n attributes: Attributes.protected(),\n });\n } catch (error) {\n if (error instanceof HttpError && isJsonRpcError(error.response.body)) {\n return error.response.body;\n }\n throw error;\n }\n}\n\nfunction isJsonRpcError(\n body: unknown\n): body is Required<Pick<JsonRpcResponse, 'error'>> {\n if (typeof body !== 'object' || body === null || !('error' in body)) {\n return false;\n }\n const { error } = body;\n return (\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n typeof error.code === 'number'\n );\n}\n\n/**\n * Only what the transport branches on. The SDK does not model the envelope as\n * a DTO: it is JSON-RPC's shape, not frontline's, and every field but these\n * two is handed straight back to viem.\n */\ntype JsonRpcResponse = {\n result?: unknown;\n error?: { code: number; message: string; data?: unknown };\n};\n","import type {\n DebugEvent,\n Logger,\n LogLevel,\n SafeEvent,\n} from '@/universal/types/logger';\n\n/**\n * The SDK's logging seam expressed over pino, minus the environment.\n *\n * Imports no pino - {@link PinoSink} is a structural type - so `@/universal`\n * stays pino-free and the `./universal` entry point costs a consumer nothing.\n * Both shipped implementations\n * ({@link pinoClientLogger}, {@link pinoServerLogger}) differ only in the pino\n * instance they construct; everything worth testing lives here.\n *\n * ## Nothing here may throw\n *\n * A {@link Logger} implementation is called inline, on the codepath of the\n * work it reports, and the SDK does not catch it - so a log line that fails to\n * render would turn a successful request into an exception. That risk is real\n * rather than theoretical: `'debug'` fields carry whatever the SDK was\n * handling, and this codebase routinely handles `bigint` (every uint256 on\n * every DTO), which `JSON.stringify` throws on. Response bodies may be\n * circular, params may hold functions, and a host's object may have a getter\n * that throws.\n *\n * So {@link toPinoRecord} is total by construction: every value is rendered\n * into something a JSON serialiser cannot refuse, every property read is\n * guarded, and the whole translation has a fallback. Pino is never handed a\n * value it could fail on.\n */\n\n/**\n * Flattens an event into the object pino merges into its output line.\n *\n * Flat rather than nested, because nesting is what a host has to un-nest\n * before they can facet on it: `scope`, the {@link LogBindings} and every\n * field sit at the top level, and only `cause` stays an object because its\n * arms are a closed union a host switches on.\n *\n * `msg` is **not** included: it is pino's own second argument.\n *\n * Never throws. A value it cannot render becomes a `<tag>` string rather than\n * an exception, and a translation that fails entirely degrades to a record\n * naming the failure.\n */\nexport function toPinoRecord(event: SafeEvent | DebugEvent): PinoRecord {\n try {\n const record: Record<string, unknown> = {};\n\n for (const key of ownKeys(event.fields)) {\n record[key] = readProperty(event.fields, key, 0, new WeakSet());\n }\n\n const cause = 'cause' in event ? event.cause : undefined;\n if (cause !== undefined) {\n record.cause = sanitize(cause, 0, new WeakSet());\n }\n\n // Last, so the stamped keys win. `scope` and the bindings are what a host\n // routes and filters on, and they are stamped by `internalLogger` rather\n // than written at a call site - so a field that happened to be named\n // `scope` or `op` must not be able to take their place.\n return { ...record, scope: event.scope, ...event.bindings };\n } catch (_) {\n // The event itself is malformed - a Proxy for `fields`, a frozen exotic\n // object. Report that rather than losing the line, and never rethrow.\n return { 'log.render': '<unrenderable event>' };\n }\n}\n\n/** What pino merges into one output line. */\nexport type PinoRecord = Readonly<Record<string, unknown>>;\n\n/**\n * The SDK's five levels in pino's vocabulary.\n *\n * `'none'` is pino's `'silent'`; the other four are the same word in both, and\n * deliberately so. The SDK does not adopt pino's seven because `'trace'` would\n * sit below `'debug'`, and the guarantee \"`debug` is unredacted and every\n * other level is not\" only closes while `'debug'` is the bottom.\n */\nexport const PINO_LEVEL = {\n none: 'silent',\n error: 'error',\n warn: 'warn',\n info: 'info',\n debug: 'debug',\n} as const satisfies Record<LogLevel, string>;\n\n/**\n * How deep a `'debug'` field is followed before it is summarised.\n *\n * A bound rather than a guess at what is deep enough: a self-referential\n * structure is already caught by the cycle check, but a legitimately deep DTO\n * would otherwise cost real time inside a log line.\n */\nconst MAX_DEPTH = 8;\n\n/**\n * Renders any value into something a JSON serialiser cannot refuse.\n *\n * `bigint` is the one that matters in practice - every uint256 the SDK handles\n * is one - but the rest are all reachable from a `'debug'` field: `undefined`\n * and functions from an operation's params, `NaN` from arithmetic, symbols\n * from a host's object.\n */\nfunction sanitize(\n value: unknown,\n depth: number,\n seen: WeakSet<object>\n): unknown {\n switch (typeof value) {\n case 'string':\n case 'boolean':\n return value;\n case 'number':\n // `NaN` and the infinities serialise to `null`, which reads as \"absent\"\n // rather than \"not a number\". Name them instead.\n return Number.isFinite(value) ? value : String(value);\n case 'bigint':\n return value.toString();\n case 'undefined':\n return '<undefined>';\n case 'function':\n return '<function>';\n case 'symbol':\n return value.toString();\n case 'object':\n return value === null ? null : sanitizeObject(value, depth, seen);\n default:\n return '<unrenderable>';\n }\n}\n\nfunction sanitizeObject(\n value: object,\n depth: number,\n seen: WeakSet<object>\n): unknown {\n if (seen.has(value)) return '<circular>';\n if (depth >= MAX_DEPTH) return '<max depth>';\n\n // `name`, `message` and `stack` are all non-enumerable, so an `Error` handed\n // to a structured sink as an object serialises to `{}`.\n if (value instanceof Error) return describeError(value);\n if (value instanceof Date) return describeDate(value);\n\n seen.add(value);\n try {\n if (Array.isArray(value)) {\n return value.map((_item, index) =>\n readProperty(value, String(index), depth, seen)\n );\n }\n\n const out: Record<string, unknown> = {};\n for (const key of ownKeys(value)) {\n out[key] = readProperty(value, key, depth, seen);\n }\n return out;\n } finally {\n // Removed on the way out, so a value referenced twice in a tree renders\n // twice. Only a genuine cycle is `<circular>`.\n seen.delete(value);\n }\n}\n\n/**\n * One property read, guarded. A getter may throw, and a log line is not\n * allowed to be the reason a request fails.\n */\nfunction readProperty(\n owner: object,\n key: string,\n depth: number,\n seen: WeakSet<object>\n): unknown {\n try {\n return sanitize((owner as Record<string, unknown>)[key], depth + 1, seen);\n } catch (_) {\n return '<unreadable>';\n }\n}\n\n/** Own enumerable keys, guarded: an exotic object may refuse to be enumerated. */\nfunction ownKeys(value: object): readonly string[] {\n try {\n return Object.keys(value);\n } catch (_) {\n return [];\n }\n}\n\nfunction describeError(error: Error): Record<string, unknown> {\n return {\n name: safeRead(() => error.name),\n message: safeRead(() => error.message),\n stack: safeRead(() => error.stack),\n };\n}\n\nfunction describeDate(date: Date): unknown {\n // An invalid `Date` throws from `toISOString`.\n return safeRead(() => date.toISOString());\n}\n\nfunction safeRead(read: () => unknown): unknown {\n try {\n const value = read();\n return typeof value === 'string' ? value : '<unreadable>';\n } catch (_) {\n return '<unreadable>';\n }\n}\n\n/**\n * The part of a pino logger this adapter uses.\n *\n * Structural rather than `import type { Logger } from 'pino'`, so that\n * `@/universal` takes no dependency on pino at all. A real pino instance - node\n * or browser build - satisfies it.\n */\nexport type PinoSink = {\n debug(record: PinoRecord, msg: string): void;\n info(record: PinoRecord, msg: string): void;\n warn(record: PinoRecord, msg: string): void;\n error(record: PinoRecord, msg: string): void;\n};\n\n/**\n * The `name` binding every SDK line carries, so a partner can separate the\n * SDK's output from their own in a shared aggregator without matching on\n * `scope`.\n *\n * Applied through `pino.child({ name })` rather than pino's `name` *option*,\n * which its browser build ignores. The browser lane's spec is what caught\n * that, and is what keeps it caught.\n */\nexport const SDK_LOGGER_NAME = '@coinlist-co/react';\n\n/**\n * Adapts a pino instance into the {@link Logger} the SDK consumes.\n *\n * **Total, and that is the point.** The SDK calls a `Logger` inline and does\n * not catch it, so an exception raised while reporting a successful request\n * would fail that request. Three things could raise one - the event lambda\n * itself, rendering the event, and the sink - and all three are caught here.\n * A render failure is reported through the sink rather than swallowed, since a\n * log line that silently vanishes is a bug nobody finds; if the sink is what\n * broke, there is nowhere left to report it and the error stops here.\n *\n * **The level is fixed here, and that is this adapter's choice rather than the\n * seam's.** {@link InternalLogger} calls {@link Logger.level} before *every*\n * log call and caches nothing, so a host-implemented `Logger` reading a mutable\n * field has a level they can change at runtime. This adapter captures `level`\n * instead, and the pino instance it wraps is built with a fixed one - so\n * `Logger.level` is a constant lookup and two loggers never interfere. A host\n * who wants to turn `'debug'` on without rebuilding implements {@link Logger}\n * directly over their own pino instance; the port is four methods and this\n * function is the worked example.\n */\nexport function loggerOverPino(sink: PinoSink, level: LogLevel): Logger {\n return {\n level: () => level,\n debug: (event) => emit(sink, 'debug', event),\n info: (event) => emit(sink, 'info', event),\n warn: (event) => emit(sink, 'warn', event),\n error: (event) => emit(sink, 'error', event),\n };\n}\n\nfunction emit(\n sink: PinoSink,\n method: keyof PinoSink,\n event: () => SafeEvent | DebugEvent\n): void {\n try {\n const value = event();\n sink[method](toPinoRecord(value), value.msg);\n } catch (error) {\n reportRenderFailure(sink, error);\n }\n}\n\nfunction reportRenderFailure(sink: PinoSink, error: unknown): void {\n try {\n sink.error(\n { 'error.type': error instanceof Error ? error.name : typeof error },\n 'log event failed to render'\n );\n } catch (_) {\n // The sink itself threw. There is nowhere left to report this, and the SDK\n // is on the other side of the call that got us here.\n }\n}\n","import type { HttpRequest } from '@/universal/api/http';\nimport { Attributes } from '@/universal/api/http-attributes';\nimport type { BeforeRequestMiddleware } from '@/universal/api/http-client';\nimport type { OAuthAccessToken } from '@/universal/types/oauth-session';\n\nexport function attachSessionMiddleware(\n fetchAccessToken: (refresh: boolean) => Promise<OAuthAccessToken | null>\n): BeforeRequestMiddleware {\n return async (request: HttpRequest): Promise<HttpRequest> => {\n if (!Attributes.isProtected(request.attributes)) {\n return request;\n }\n\n let accessToken = await fetchAccessToken(false);\n if (!accessToken) {\n const clientCreds = Attributes.getClientCredentials(request.attributes);\n if (clientCreds) {\n accessToken = clientCreds;\n }\n }\n\n if (accessToken === null) {\n return request;\n }\n\n return {\n ...request,\n headers: {\n ...(request.headers ?? {}),\n Authorization: `Bearer ${accessToken.value}`,\n },\n };\n };\n}\n","import { HEADER_IDEMPOTENCY_KEY } from '@/universal/api/frontline/config';\nimport type { HttpRequest } from '@/universal/api/http';\nimport { Attributes } from '@/universal/api/http-attributes';\nimport type { BeforeRequestMiddleware } from '@/universal/api/http-client';\nimport { getUUIDv4 } from '@/universal/core/shared/utils/crypto';\n\nexport const idempotencyKeyMiddleware: BeforeRequestMiddleware = async (\n request: HttpRequest\n): Promise<HttpRequest> => {\n if (!Attributes.isIdempotent(request.attributes)) {\n return request;\n }\n\n const existingHeaders = request.headers ?? {};\n if (existingHeaders[HEADER_IDEMPOTENCY_KEY]) {\n return request;\n }\n\n return {\n ...request,\n headers: {\n ...existingHeaders,\n [HEADER_IDEMPOTENCY_KEY]: getUUIDv4(),\n },\n };\n};\n","import { Request } from '@/universal/api/http';\nimport { Attributes } from '@/universal/api/http-attributes';\nimport type { AfterRequestMiddleware } from '@/universal/api/http-client';\n\nconst MAX_ATTEMPTS = 3;\nconst INITIAL_DELAY_MS = 300;\nconst MAX_DELAY_MS = 2000;\n\nconst RETRYABLE_4XX = new Set([408, 409, 429]);\n\nexport function isRetryableStatus(status: number): boolean {\n return (status >= 500 && status < 600) || RETRYABLE_4XX.has(status);\n}\n\nfunction getRetryDelayMs(attempt: number): number {\n return Math.min(INITIAL_DELAY_MS * 2 ** (attempt - 1), MAX_DELAY_MS);\n}\n\nexport type RequestRetryMiddlewareOptions = {\n /**\n * Optional delay function. Defaults to real setTimeout-based delay.\n * Use a no-op (e.g. () => Promise.resolve()) in tests to avoid slow tests.\n */\n delayFn?: (ms: number) => Promise<void>;\n};\n\n/**\n * Creates the request retry after-request middleware. Inject a no-op delayFn\n * in tests to avoid real delays (unit testing best practice).\n */\nexport function createRequestRetryMiddleware(\n options: RequestRetryMiddlewareOptions = {}\n): AfterRequestMiddleware {\n const delayFn = options.delayFn ?? defaultDelay;\n\n return async ({ request, response, retry }) => {\n if (!isRetryableStatus(response.status)) {\n return response;\n }\n\n const currentAttempt = Attributes.getRetryAttempt(request.attributes);\n if (currentAttempt >= MAX_ATTEMPTS - 1) {\n return response;\n }\n\n const nextAttempt = currentAttempt + 1;\n await delayFn(getRetryDelayMs(nextAttempt));\n\n const nextRequest = Request.concatAttributes(\n request,\n Attributes.retryAttempt(nextAttempt)\n );\n return retry(nextRequest);\n };\n}\n\nfunction defaultDelay(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Retries the request up to 3 times with exponential backoff when the response\n * has a retryable status (5xx server errors). Uses request.attributes.retryAttempt\n * to decide delay and whether to retry, so the middleware does not loop when\n * retry() runs the full HTTP middleware chain again.\n */\nexport const requestRetryMiddleware: AfterRequestMiddleware =\n createRequestRetryMiddleware();\n","import { Request } from '@/universal/api/http';\nimport { Attributes } from '@/universal/api/http-attributes';\nimport type { AfterRequestMiddleware } from '@/universal/api/http-client';\nimport type { OAuthAccessToken } from '@/universal/types/oauth-session';\n\nexport function renewSessionMiddleware(\n fetchAccessToken: (refresh: boolean) => Promise<OAuthAccessToken | null>\n): AfterRequestMiddleware {\n return async ({ request, response, retry }) => {\n if (response.status !== 401) {\n return response;\n }\n if (!Attributes.isProtected(request.attributes)) {\n return response;\n }\n if (Attributes.wasRenewAttempted(request.attributes)) {\n return response;\n }\n\n const newToken = await fetchAccessToken(true);\n if (newToken) {\n const nextRequest = Request.concatAttributes(\n request,\n Attributes.renewAttempted(true)\n );\n return retry(nextRequest);\n } else {\n return response;\n }\n };\n}\n","import type { HttpClientConfig, HttpRequest } from '@/universal/api/http';\nimport { HttpError } from '@/universal/api/http';\nimport type { BeforeRequestMiddleware } from '@/universal/api/http-client';\nimport { HttpClient } from '@/universal/api/http-client';\nimport { attachSessionMiddleware } from '@/universal/api/middleware/attach-session-middleware';\nimport { idempotencyKeyMiddleware } from '@/universal/api/middleware/idempotency-key';\nimport { requestRetryMiddleware } from '@/universal/api/middleware/request-retry';\nimport { renewSessionMiddleware } from '@/universal/api/middleware/session-renewal';\nimport type { Logger } from '@/universal/types/logger';\nimport type { OAuthAccessToken } from '@/universal/types/oauth-session';\n\n/**\n * Isomorphic HTTP client with session attachment, session renewal on 401,\n * idempotency key injection, and request retry. Works in both browser and\n * Node/server environments. Pass `additionalBeforeRequest` to inject\n * environment-specific middleware (e.g. `userAgentMiddleware` on the client).\n *\n * Pass `logger` through to have every request reported; the client logs\n * nothing without one.\n */\nexport class AuthenticatedApiClient {\n private readonly httpClient: HttpClient;\n\n constructor(\n config: HttpClientConfig,\n fetchAccessToken: (refresh: boolean) => Promise<OAuthAccessToken | null>,\n additionalBeforeRequest: BeforeRequestMiddleware[] = [],\n logger: Logger | null = null\n ) {\n this.httpClient = new HttpClient(\n config,\n {\n beforeRequest: [\n attachSessionMiddleware(fetchAccessToken),\n ...additionalBeforeRequest,\n idempotencyKeyMiddleware,\n ],\n afterRequest: [\n renewSessionMiddleware(fetchAccessToken),\n requestRetryMiddleware,\n ],\n },\n logger\n );\n }\n\n async send<TResponse>(request: HttpRequest): Promise<TResponse> {\n const response = await this.httpClient.send<TResponse>(request);\n if (response.status >= 200 && response.status < 300) {\n return response.body as TResponse;\n } else {\n throw new HttpError(response);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAKO,IAAM,gBAAgB;;;ACL7B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;;;ACLP,SAAS,QAAQ,uBAAuC;AA8CjD,SAAS,mBACd,KACA,OACA,SAAwB,MACb;AACX,QAAM,MAAM,eAAe,QAAQ,KAAK;AACxC,MAAI,SAAS;AAEb,SAAO;AAAA,IACL;AAAA,MACE,MAAM,QAAQ,EAAE,QAAQ,OAAO,GAAG;AAChC,cAAM,KAAK,EAAE;AACb,eAAO,QAAQ,EAAE,KAAK,KAAK,OAAO,IAAI,QAAQ,OAAO,CAAC;AAAA,MACxD;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,EAAE,YAAY,EAAE;AAAA,EAClB;AACF;AAEA,eAAe,QAAQ;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF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