@coinlist-co/react 0.11.0 → 0.11.1-rc.10770e8
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-UIIXXLA7.js → chunk-7CTH4KPU.js} +734 -198
- package/dist/chunk-7CTH4KPU.js.map +1 -0
- package/dist/{chunk-B2HCVPCQ.js → chunk-LSPZETDH.js} +81 -33
- package/dist/chunk-LSPZETDH.js.map +1 -0
- package/dist/chunk-UZUQALFY.js +279 -0
- package/dist/chunk-UZUQALFY.js.map +1 -0
- package/dist/client/index.cjs +5415 -2413
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +2439 -1209
- package/dist/client/index.d.ts +2439 -1209
- package/dist/client/index.js +4457 -2178
- package/dist/client/index.js.map +1 -1
- package/dist/collections-BBI_XydI.d.cts +116 -0
- package/dist/collections-BrX9rRWc.d.ts +116 -0
- package/dist/{config-B5mwS_2l.d.cts → config-CMl1bR3F.d.cts} +1183 -150
- package/dist/{config-B5mwS_2l.d.ts → config-CMl1bR3F.d.ts} +1183 -150
- package/dist/server/index.cjs +1005 -265
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +81 -4
- package/dist/server/index.d.ts +81 -4
- package/dist/server/index.js +120 -51
- package/dist/server/index.js.map +1 -1
- package/dist/shared/index.cjs +798 -204
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +98 -16
- package/dist/shared/index.d.ts +98 -16
- package/dist/shared/index.js +22 -6
- package/package.json +3 -2
- package/dist/chunk-B2HCVPCQ.js.map +0 -1
- package/dist/chunk-KDGNDAHA.js +0 -146
- package/dist/chunk-KDGNDAHA.js.map +0 -1
- package/dist/chunk-UIIXXLA7.js.map +0 -1
- package/dist/collections-BhDkYmzV.d.cts +0 -65
- package/dist/collections-CZhHoQHr.d.ts +0 -65
package/dist/shared/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { T as TxExplorerUrl, F as FormattedAmountAssetUi,
|
|
4
|
-
export { A as AssetIconUrl, P as PKCEConfig,
|
|
1
|
+
import { ao as PaginationParams, ap as PaginatedResponse, p as Bps, aq as Uint256, a as EthereumChain, X as AssetDecimals, h as AssetSymbol, B as BlockchainAmount, q as EvmWalletAddress, ar as KnownAssetSymbol, y as Erc20Asset, b as EvmContractAddress, x as StablecoinSymbol, as as DecimalString, i as OndoBuyTransaction, j as OndoSellTransaction, at as SwapStatus, au as Newtype } from '../config-CMl1bR3F.cjs';
|
|
2
|
+
export { av as AllowWalletParams, aw as AllowWalletResponse, ax as Asset, ay as AssetCode, e as AssetId, A as AuthorizationCode, az as Blockchain, Y as BuildOndoBuyParams, Z as BuildOndoSellParams, aA as BuildOndoSwapParamsCore, aB as Chain, al as ClientCredentialsOAuth, aC as ClientId, am as ClientSecret, aD as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, u as Config, aE as ConnectExternalWalletParams, aF as CreateKycTokenParams, aG as CreateParticipationParams, aH as CreateWalletOwnershipChallengeParams, aI as Cursor, a3 as DebugEvent, aJ as DocumentFormType, N as DocumentSubmission, aK as DocumentSubmissionStatus, aL as DocumentType, aM as ETHEREUM_CHAINS, E as Erc20Namespace, aN as Erc20NamespaceImpl, aO as FaqItem, a4 as FrontlineEventId, aP as GetOndoQuoteParams, aQ as GetOndoTradingStatusParams, aR as GetSwapAuthorizationParams, aS as GetSwapPreviewParams, aT as GetTokenAllowanceParams, aU as GetTokenBalanceParams, aV as HexEncodedTransactionData, a5 as HttpError, a6 as HttpResponse, aW as Iso2CountryCode, M as KycLevelName, a7 as KycToken, aX as Link, aY as ListOptionAddressesParams, a8 as LogBinding, a9 as LogBindings, aa as LogCause, ab as LogLevel, ac as LogScope, ad as LogValue, L as Logger, aZ as MAX_ASSET_DECIMALS, a_ as MAX_UINT_256, a$ as Milestone, v as OAuthAccessToken, b0 as OAuthRefreshToken, ak as OAuthSession, F as Offer, z as OfferDetail, O as OfferId, b1 as OfferOption, J as OfferOptionAddress, a0 as OfferOptionAddressId, d as OfferOptionId, b2 as OfferOptionSlug, b3 as OfferSlug, b4 as OfferToken, D as OfferType, w as OffersNamespace, b5 as OffersNamespaceImpl, g as OndoNamespace, m as OndoNamespaceImpl, _ as OndoQuote, b6 as OndoQuoteDuration, $ as OndoQuoteSize, b7 as OndoSellOutcome, k as OndoSwapTransactionCore, V as OndoTradingStatus, l as OrderBookSide, b8 as PKCEState, b9 as PaginatedResponseDto, P as Participation, ba as ParticipationId, bb as ParticipationStatus, bc as ParticipationsPaginationParams, bd as Pii, be as PiiAddress, bf as PiiJurisdiction, bg as PiiKind, U as PinoLoggerOptions, ae as ProductionLogLevel, bh as QueryParamValue, bi as QueryParamValues, af as RedactedWalletError, bj as RedirectUri, bk as RemoveOptionAddressParams, ag as RequestId, s as Requirement, bl as RequirementActionNeededReason, K as RequirementId, G as RequirementStatusInfo, I as RequirementStatusValue, H as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bm as SOLANA_CHAINS, bn as STABLE_DECIMALS, ah as SafeEvent, ai as SafeFields, bo as SolanaChain, bp as SubmitDocumentParams, n as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bq as SwapAuthorization, br as SwapContractRef, bs as SwapPreview, bt as TermItem, bu as Ticker, bv as TokenAllowance, bw as TokenBalance, a2 as TokenIdentifier, bx as TokenLogo, by as TokenLogoImage, bz as TokenLogoUrl, a1 as TokenMetadata, bA as TokenRole, T as TokensNamespace, bB as TokensNamespaceImpl, bC as Tx, aj as UnredactedFields, bD as WalletAddress, Q as WalletChallengeType, W as WalletError, bE as WalletOwnershipChallenge, bF as WalletProtocol, o as WalletsNamespace, bG as WalletsNamespaceImpl, bH as apiErrorCode, bI as assertUint256, bJ as parseUint256 } from '../config-CMl1bR3F.cjs';
|
|
3
|
+
import { T as TxExplorerUrl, F as FormattedAmountAssetUi, d as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress, N as NonEmptyArray, S as SwapQuote } from '../collections-BBI_XydI.cjs';
|
|
4
|
+
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, c as EvmSigner, E as EvmWallet, P as PKCEConfig, e as PKCEParams, W as WriteContractParams, g as generatePKCEParams } from '../collections-BBI_XydI.cjs';
|
|
5
5
|
import { Hash, TransactionReceipt } from 'viem';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -270,7 +270,17 @@ declare const USDT: Erc20Asset;
|
|
|
270
270
|
/** Lookups for the stablecoins the SDK's swap flows support out of the box. */
|
|
271
271
|
declare const TOKEN_REGISTRY: {
|
|
272
272
|
erc20: (symbol: KnownAssetSymbol) => Erc20Asset;
|
|
273
|
-
|
|
273
|
+
/**
|
|
274
|
+
* USDC's contract on `chain`. USDC is deployed on every chain the SDK
|
|
275
|
+
* models, so the table is total and the answer is never `null`.
|
|
276
|
+
*/
|
|
277
|
+
usdcAddress: (chain: EthereumChain) => EvmContractAddress;
|
|
278
|
+
/**
|
|
279
|
+
* USDT's contract on `chain`, or `null` where Tether publishes none —
|
|
280
|
+
* Base Sepolia today. The honest answer, never a fake address a balance
|
|
281
|
+
* read would call.
|
|
282
|
+
*/
|
|
283
|
+
usdtAddress: (chain: EthereumChain) => EvmContractAddress | null;
|
|
274
284
|
};
|
|
275
285
|
|
|
276
286
|
/** The Ondo integration contract on `chain`, or `null` where none is deployed. */
|
|
@@ -308,6 +318,36 @@ declare const ONDO_QUOTE_EXPIRY_THRESHOLD_MS = 5000;
|
|
|
308
318
|
* coexist - and they mean different things anyway.
|
|
309
319
|
*/
|
|
310
320
|
declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
321
|
+
/**
|
|
322
|
+
* The coin an Ondo sell settles into, for display only.
|
|
323
|
+
*
|
|
324
|
+
* The scale of every amount on a built transaction comes off the response, so
|
|
325
|
+
* this names the token and never sizes it - `receive_output_decimals` is the
|
|
326
|
+
* only authority on how many decimals the proceeds are counted in, and the two
|
|
327
|
+
* are allowed to disagree.
|
|
328
|
+
*
|
|
329
|
+
* Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of
|
|
330
|
+
* it, though both are USDC today. On a buy USDC is what the user funds with
|
|
331
|
+
* and one of a list that may grow; on a sell it is what they settle into and
|
|
332
|
+
* there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make
|
|
333
|
+
* the sell screen quietly follow whichever funding coin happened to be listed
|
|
334
|
+
* first.
|
|
335
|
+
*/
|
|
336
|
+
declare const ONDO_SETTLEMENT_ASSET: StablecoinSymbol;
|
|
337
|
+
/**
|
|
338
|
+
* The order size the sidebar prices a sell against before the user names one.
|
|
339
|
+
*
|
|
340
|
+
* Sells are quoted by token amount rather than by notional: the fee comes out
|
|
341
|
+
* of dollars, and Ondo's price is size-aware, so a buy's quantity depends on
|
|
342
|
+
* the quote being asked for while a sell is sized by what the user already
|
|
343
|
+
* holds. One whole share is a size Ondo will price - small enough to be
|
|
344
|
+
* plausible for any asset, large enough that Ondo's minimum does not reject it
|
|
345
|
+
* and leave the panel permanently blank.
|
|
346
|
+
*
|
|
347
|
+
* The buy counterpart is {@link DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE}, which
|
|
348
|
+
* is a dollar figure for the same reason in reverse.
|
|
349
|
+
*/
|
|
350
|
+
declare const DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;
|
|
311
351
|
/**
|
|
312
352
|
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
313
353
|
* preselected.
|
|
@@ -319,13 +359,13 @@ declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
|
319
359
|
declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
320
360
|
|
|
321
361
|
/**
|
|
322
|
-
* The price of one whole asset token in
|
|
323
|
-
*
|
|
362
|
+
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
363
|
+
* token's units - USD per share.
|
|
324
364
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
365
|
+
* Neither builder publishes a price. Frontline drops Ninshubur's deliberately,
|
|
366
|
+
* because `GET /v1/ondo/swap/quote` already serves one under that name at a
|
|
367
|
+
* different scale, and echoing both would leave a caller to guess which was
|
|
368
|
+
* which.
|
|
329
369
|
*
|
|
330
370
|
* Dividing the two amounts the response *does* carry is better than reading
|
|
331
371
|
* the indicative one anyway: it is the price this transaction fills at, rather
|
|
@@ -333,7 +373,7 @@ declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
|
333
373
|
*
|
|
334
374
|
* **Fee-exclusive.** `notionalValue` is the deposit after CoinList's fee comes
|
|
335
375
|
* off, so this is the price Ondo filled at, not the buyer's all-in cost per
|
|
336
|
-
* token - that would be `
|
|
376
|
+
* token - that would be `spendInputAmount / receiveOutputAmount`, and it is
|
|
337
377
|
* higher. Fee-exclusive is what the review screen wants, because it renders
|
|
338
378
|
* the fee on its own line: price x quantity, plus fee, comes to the total.
|
|
339
379
|
* Making this all-in would double-count the fee against that breakdown.
|
|
@@ -341,11 +381,28 @@ declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
|
341
381
|
* The two are equal until ENG-1718 turns a fee on, which frontline rejects
|
|
342
382
|
* today. They diverge the moment it does, so the choice is load-bearing rather
|
|
343
383
|
* than academic.
|
|
384
|
+
*/
|
|
385
|
+
declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): BlockchainAmount;
|
|
386
|
+
/**
|
|
387
|
+
* The price of one whole asset token in a built Ondo sale, in the settlement
|
|
388
|
+
* token's units - USD per share, the same thing
|
|
389
|
+
* {@link computeOndoBuyPrice} answers with the ratio inverted.
|
|
390
|
+
*
|
|
391
|
+
* **Fee-exclusive, and it takes arithmetic to be so.** `expected.quantity` is
|
|
392
|
+
* published already net of `expected.fee`, so the proceeds are added back
|
|
393
|
+
* before dividing: what comes out is the price Ondo filled at, which is the
|
|
394
|
+
* buy arm's meaning rather than a second one. That is what lets one review row
|
|
395
|
+
* render on either screen, and what keeps the sell breakdown honest - the fee
|
|
396
|
+
* sits on its own line beside this, and a net price would count it twice.
|
|
344
397
|
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
398
|
+
* Read against {@link OndoSellTransaction.expected} alone. The `minimum` arm
|
|
399
|
+
* describes the same trade at a different outcome, and pricing that one would
|
|
400
|
+
* answer "the worst price this could fill at", which no screen asks for.
|
|
401
|
+
*
|
|
402
|
+
* The two readings coincide while frontline forces the fee to zero, which it
|
|
403
|
+
* does today. They diverge the day ENG-1718 lands.
|
|
347
404
|
*/
|
|
348
|
-
declare function
|
|
405
|
+
declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
|
|
349
406
|
|
|
350
407
|
declare const SUPERSTATE_SWAP_ABI: readonly [{
|
|
351
408
|
readonly type: "function";
|
|
@@ -766,6 +823,31 @@ declare class NotAuthenticatedError extends Error {
|
|
|
766
823
|
declare class ValidationError extends Error {
|
|
767
824
|
constructor(message: string);
|
|
768
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Error thrown when the SDK computes something impossible: a value outside
|
|
828
|
+
* uint256 after its own arithmetic, a symbol missing from a registry the SDK
|
|
829
|
+
* itself ships. Distinct from {@link ValidationError}, which means the backend
|
|
830
|
+
* sent a shape the SDK does not understand.
|
|
831
|
+
*
|
|
832
|
+
* The two have different remedies, which is the whole reason they are separate
|
|
833
|
+
* types: a {@link ValidationError} is worth reporting to CoinList, an
|
|
834
|
+
* `InvariantError` is an SDK bug worth reporting against the SDK.
|
|
835
|
+
*/
|
|
836
|
+
declare class InvariantError extends Error {
|
|
837
|
+
constructor(message: string);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Error thrown when an arithmetic operation has no answer to give: a division
|
|
841
|
+
* by zero, or a result that falls outside the range its type can represent.
|
|
842
|
+
*
|
|
843
|
+
* Distinct from {@link ValidationError}, which says a value arrived malformed.
|
|
844
|
+
* A `MathError` says every operand was well-formed and the operation on them
|
|
845
|
+
* still has no result, so the two are worth catching apart: one points at the
|
|
846
|
+
* response, the other at the arithmetic we asked for.
|
|
847
|
+
*/
|
|
848
|
+
declare class MathError extends Error {
|
|
849
|
+
constructor(message: string);
|
|
850
|
+
}
|
|
769
851
|
|
|
770
852
|
type UserDto = {
|
|
771
853
|
id: string;
|
|
@@ -784,4 +866,4 @@ declare const User: {
|
|
|
784
866
|
fromDto: (dto: UserDto) => User;
|
|
785
867
|
};
|
|
786
868
|
|
|
787
|
-
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, KnownAssetSymbol, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_EXPIRY_THRESHOLD_MS, ONDO_SUPPORTED_INPUT_ASSETS,
|
|
869
|
+
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_EXPIRY_THRESHOLD_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, 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, isStopped, ondoSwapContractAddress, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, txExplorerUrl, usdAmount };
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { T as TxExplorerUrl, F as FormattedAmountAssetUi,
|
|
4
|
-
export { A as AssetIconUrl, P as PKCEConfig,
|
|
1
|
+
import { ao as PaginationParams, ap as PaginatedResponse, p as Bps, aq as Uint256, a as EthereumChain, X as AssetDecimals, h as AssetSymbol, B as BlockchainAmount, q as EvmWalletAddress, ar as KnownAssetSymbol, y as Erc20Asset, b as EvmContractAddress, x as StablecoinSymbol, as as DecimalString, i as OndoBuyTransaction, j as OndoSellTransaction, at as SwapStatus, au as Newtype } from '../config-CMl1bR3F.js';
|
|
2
|
+
export { av as AllowWalletParams, aw as AllowWalletResponse, ax as Asset, ay as AssetCode, e as AssetId, A as AuthorizationCode, az as Blockchain, Y as BuildOndoBuyParams, Z as BuildOndoSellParams, aA as BuildOndoSwapParamsCore, aB as Chain, al as ClientCredentialsOAuth, aC as ClientId, am as ClientSecret, aD as CodeChallenge, C as CodeVerifier, c as CoinListTokenSaleNamespace, f as CoinListTokenSaleNamespaceImpl, u as Config, aE as ConnectExternalWalletParams, aF as CreateKycTokenParams, aG as CreateParticipationParams, aH as CreateWalletOwnershipChallengeParams, aI as Cursor, a3 as DebugEvent, aJ as DocumentFormType, N as DocumentSubmission, aK as DocumentSubmissionStatus, aL as DocumentType, aM as ETHEREUM_CHAINS, E as Erc20Namespace, aN as Erc20NamespaceImpl, aO as FaqItem, a4 as FrontlineEventId, aP as GetOndoQuoteParams, aQ as GetOndoTradingStatusParams, aR as GetSwapAuthorizationParams, aS as GetSwapPreviewParams, aT as GetTokenAllowanceParams, aU as GetTokenBalanceParams, aV as HexEncodedTransactionData, a5 as HttpError, a6 as HttpResponse, aW as Iso2CountryCode, M as KycLevelName, a7 as KycToken, aX as Link, aY as ListOptionAddressesParams, a8 as LogBinding, a9 as LogBindings, aa as LogCause, ab as LogLevel, ac as LogScope, ad as LogValue, L as Logger, aZ as MAX_ASSET_DECIMALS, a_ as MAX_UINT_256, a$ as Milestone, v as OAuthAccessToken, b0 as OAuthRefreshToken, ak as OAuthSession, F as Offer, z as OfferDetail, O as OfferId, b1 as OfferOption, J as OfferOptionAddress, a0 as OfferOptionAddressId, d as OfferOptionId, b2 as OfferOptionSlug, b3 as OfferSlug, b4 as OfferToken, D as OfferType, w as OffersNamespace, b5 as OffersNamespaceImpl, g as OndoNamespace, m as OndoNamespaceImpl, _ as OndoQuote, b6 as OndoQuoteDuration, $ as OndoQuoteSize, b7 as OndoSellOutcome, k as OndoSwapTransactionCore, V as OndoTradingStatus, l as OrderBookSide, b8 as PKCEState, b9 as PaginatedResponseDto, P as Participation, ba as ParticipationId, bb as ParticipationStatus, bc as ParticipationsPaginationParams, bd as Pii, be as PiiAddress, bf as PiiJurisdiction, bg as PiiKind, U as PinoLoggerOptions, ae as ProductionLogLevel, bh as QueryParamValue, bi as QueryParamValues, af as RedactedWalletError, bj as RedirectUri, bk as RemoveOptionAddressParams, ag as RequestId, s as Requirement, bl as RequirementActionNeededReason, K as RequirementId, G as RequirementStatusInfo, I as RequirementStatusValue, H as RequirementType, R as RequirementsNamespace, t as RequirementsNamespaceImpl, bm as SOLANA_CHAINS, bn as STABLE_DECIMALS, ah as SafeEvent, ai as SafeFields, bo as SolanaChain, bp as SubmitDocumentParams, n as SuperstateSwapNamespace, r as SuperstateSwapNamespaceImpl, bq as SwapAuthorization, br as SwapContractRef, bs as SwapPreview, bt as TermItem, bu as Ticker, bv as TokenAllowance, bw as TokenBalance, a2 as TokenIdentifier, bx as TokenLogo, by as TokenLogoImage, bz as TokenLogoUrl, a1 as TokenMetadata, bA as TokenRole, T as TokensNamespace, bB as TokensNamespaceImpl, bC as Tx, aj as UnredactedFields, bD as WalletAddress, Q as WalletChallengeType, W as WalletError, bE as WalletOwnershipChallenge, bF as WalletProtocol, o as WalletsNamespace, bG as WalletsNamespaceImpl, bH as apiErrorCode, bI as assertUint256, bJ as parseUint256 } from '../config-CMl1bR3F.js';
|
|
3
|
+
import { T as TxExplorerUrl, F as FormattedAmountAssetUi, d as FormattedAmountUi, b as FormattedPercentUi, a as ShortenedWalletAddress, N as NonEmptyArray, S as SwapQuote } from '../collections-BrX9rRWc.js';
|
|
4
|
+
export { A as AssetIconUrl, B as BroadcastTxParams, C as ConnectWallet, c as EvmSigner, E as EvmWallet, P as PKCEConfig, e as PKCEParams, W as WriteContractParams, g as generatePKCEParams } from '../collections-BrX9rRWc.js';
|
|
5
5
|
import { Hash, TransactionReceipt } from 'viem';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -270,7 +270,17 @@ declare const USDT: Erc20Asset;
|
|
|
270
270
|
/** Lookups for the stablecoins the SDK's swap flows support out of the box. */
|
|
271
271
|
declare const TOKEN_REGISTRY: {
|
|
272
272
|
erc20: (symbol: KnownAssetSymbol) => Erc20Asset;
|
|
273
|
-
|
|
273
|
+
/**
|
|
274
|
+
* USDC's contract on `chain`. USDC is deployed on every chain the SDK
|
|
275
|
+
* models, so the table is total and the answer is never `null`.
|
|
276
|
+
*/
|
|
277
|
+
usdcAddress: (chain: EthereumChain) => EvmContractAddress;
|
|
278
|
+
/**
|
|
279
|
+
* USDT's contract on `chain`, or `null` where Tether publishes none —
|
|
280
|
+
* Base Sepolia today. The honest answer, never a fake address a balance
|
|
281
|
+
* read would call.
|
|
282
|
+
*/
|
|
283
|
+
usdtAddress: (chain: EthereumChain) => EvmContractAddress | null;
|
|
274
284
|
};
|
|
275
285
|
|
|
276
286
|
/** The Ondo integration contract on `chain`, or `null` where none is deployed. */
|
|
@@ -308,6 +318,36 @@ declare const ONDO_QUOTE_EXPIRY_THRESHOLD_MS = 5000;
|
|
|
308
318
|
* coexist - and they mean different things anyway.
|
|
309
319
|
*/
|
|
310
320
|
declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
321
|
+
/**
|
|
322
|
+
* The coin an Ondo sell settles into, for display only.
|
|
323
|
+
*
|
|
324
|
+
* The scale of every amount on a built transaction comes off the response, so
|
|
325
|
+
* this names the token and never sizes it - `receive_output_decimals` is the
|
|
326
|
+
* only authority on how many decimals the proceeds are counted in, and the two
|
|
327
|
+
* are allowed to disagree.
|
|
328
|
+
*
|
|
329
|
+
* Named apart from {@link ONDO_SUPPORTED_INPUT_ASSETS} rather than read out of
|
|
330
|
+
* it, though both are USDC today. On a buy USDC is what the user funds with
|
|
331
|
+
* and one of a list that may grow; on a sell it is what they settle into and
|
|
332
|
+
* there is one of it. Reading `ONDO_SUPPORTED_INPUT_ASSETS[0]` here would make
|
|
333
|
+
* the sell screen quietly follow whichever funding coin happened to be listed
|
|
334
|
+
* first.
|
|
335
|
+
*/
|
|
336
|
+
declare const ONDO_SETTLEMENT_ASSET: StablecoinSymbol;
|
|
337
|
+
/**
|
|
338
|
+
* The order size the sidebar prices a sell against before the user names one.
|
|
339
|
+
*
|
|
340
|
+
* Sells are quoted by token amount rather than by notional: the fee comes out
|
|
341
|
+
* of dollars, and Ondo's price is size-aware, so a buy's quantity depends on
|
|
342
|
+
* the quote being asked for while a sell is sized by what the user already
|
|
343
|
+
* holds. One whole share is a size Ondo will price - small enough to be
|
|
344
|
+
* plausible for any asset, large enough that Ondo's minimum does not reject it
|
|
345
|
+
* and leave the panel permanently blank.
|
|
346
|
+
*
|
|
347
|
+
* The buy counterpart is {@link DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE}, which
|
|
348
|
+
* is a dollar figure for the same reason in reverse.
|
|
349
|
+
*/
|
|
350
|
+
declare const DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;
|
|
311
351
|
/**
|
|
312
352
|
* The coins an Ondo buy can be funded with, in display order, with the first
|
|
313
353
|
* preselected.
|
|
@@ -319,13 +359,13 @@ declare const DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE: DecimalString;
|
|
|
319
359
|
declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
320
360
|
|
|
321
361
|
/**
|
|
322
|
-
* The price of one whole asset token in
|
|
323
|
-
*
|
|
362
|
+
* The price of one whole asset token in a built Ondo purchase, in the funding
|
|
363
|
+
* token's units - USD per share.
|
|
324
364
|
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
365
|
+
* Neither builder publishes a price. Frontline drops Ninshubur's deliberately,
|
|
366
|
+
* because `GET /v1/ondo/swap/quote` already serves one under that name at a
|
|
367
|
+
* different scale, and echoing both would leave a caller to guess which was
|
|
368
|
+
* which.
|
|
329
369
|
*
|
|
330
370
|
* Dividing the two amounts the response *does* carry is better than reading
|
|
331
371
|
* the indicative one anyway: it is the price this transaction fills at, rather
|
|
@@ -333,7 +373,7 @@ declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
|
333
373
|
*
|
|
334
374
|
* **Fee-exclusive.** `notionalValue` is the deposit after CoinList's fee comes
|
|
335
375
|
* off, so this is the price Ondo filled at, not the buyer's all-in cost per
|
|
336
|
-
* token - that would be `
|
|
376
|
+
* token - that would be `spendInputAmount / receiveOutputAmount`, and it is
|
|
337
377
|
* higher. Fee-exclusive is what the review screen wants, because it renders
|
|
338
378
|
* the fee on its own line: price x quantity, plus fee, comes to the total.
|
|
339
379
|
* Making this all-in would double-count the fee against that breakdown.
|
|
@@ -341,11 +381,28 @@ declare const ONDO_SUPPORTED_INPUT_ASSETS: NonEmptyArray<StablecoinSymbol>;
|
|
|
341
381
|
* The two are equal until ENG-1718 turns a fee on, which frontline rejects
|
|
342
382
|
* today. They diverge the moment it does, so the choice is load-bearing rather
|
|
343
383
|
* than academic.
|
|
384
|
+
*/
|
|
385
|
+
declare function computeOndoBuyPrice(transaction: OndoBuyTransaction): BlockchainAmount;
|
|
386
|
+
/**
|
|
387
|
+
* The price of one whole asset token in a built Ondo sale, in the settlement
|
|
388
|
+
* token's units - USD per share, the same thing
|
|
389
|
+
* {@link computeOndoBuyPrice} answers with the ratio inverted.
|
|
390
|
+
*
|
|
391
|
+
* **Fee-exclusive, and it takes arithmetic to be so.** `expected.quantity` is
|
|
392
|
+
* published already net of `expected.fee`, so the proceeds are added back
|
|
393
|
+
* before dividing: what comes out is the price Ondo filled at, which is the
|
|
394
|
+
* buy arm's meaning rather than a second one. That is what lets one review row
|
|
395
|
+
* render on either screen, and what keeps the sell breakdown honest - the fee
|
|
396
|
+
* sits on its own line beside this, and a net price would count it twice.
|
|
344
397
|
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
398
|
+
* Read against {@link OndoSellTransaction.expected} alone. The `minimum` arm
|
|
399
|
+
* describes the same trade at a different outcome, and pricing that one would
|
|
400
|
+
* answer "the worst price this could fill at", which no screen asks for.
|
|
401
|
+
*
|
|
402
|
+
* The two readings coincide while frontline forces the fee to zero, which it
|
|
403
|
+
* does today. They diverge the day ENG-1718 lands.
|
|
347
404
|
*/
|
|
348
|
-
declare function
|
|
405
|
+
declare function computeOndoSellPrice(transaction: OndoSellTransaction): BlockchainAmount;
|
|
349
406
|
|
|
350
407
|
declare const SUPERSTATE_SWAP_ABI: readonly [{
|
|
351
408
|
readonly type: "function";
|
|
@@ -766,6 +823,31 @@ declare class NotAuthenticatedError extends Error {
|
|
|
766
823
|
declare class ValidationError extends Error {
|
|
767
824
|
constructor(message: string);
|
|
768
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Error thrown when the SDK computes something impossible: a value outside
|
|
828
|
+
* uint256 after its own arithmetic, a symbol missing from a registry the SDK
|
|
829
|
+
* itself ships. Distinct from {@link ValidationError}, which means the backend
|
|
830
|
+
* sent a shape the SDK does not understand.
|
|
831
|
+
*
|
|
832
|
+
* The two have different remedies, which is the whole reason they are separate
|
|
833
|
+
* types: a {@link ValidationError} is worth reporting to CoinList, an
|
|
834
|
+
* `InvariantError` is an SDK bug worth reporting against the SDK.
|
|
835
|
+
*/
|
|
836
|
+
declare class InvariantError extends Error {
|
|
837
|
+
constructor(message: string);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Error thrown when an arithmetic operation has no answer to give: a division
|
|
841
|
+
* by zero, or a result that falls outside the range its type can represent.
|
|
842
|
+
*
|
|
843
|
+
* Distinct from {@link ValidationError}, which says a value arrived malformed.
|
|
844
|
+
* A `MathError` says every operand was well-formed and the operation on them
|
|
845
|
+
* still has no result, so the two are worth catching apart: one points at the
|
|
846
|
+
* response, the other at the arithmetic we asked for.
|
|
847
|
+
*/
|
|
848
|
+
declare class MathError extends Error {
|
|
849
|
+
constructor(message: string);
|
|
850
|
+
}
|
|
769
851
|
|
|
770
852
|
type UserDto = {
|
|
771
853
|
id: string;
|
|
@@ -784,4 +866,4 @@ declare const User: {
|
|
|
784
866
|
fromDto: (dto: UserDto) => User;
|
|
785
867
|
};
|
|
786
868
|
|
|
787
|
-
export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, KnownAssetSymbol, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_EXPIRY_THRESHOLD_MS, ONDO_SUPPORTED_INPUT_ASSETS,
|
|
869
|
+
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_EXPIRY_THRESHOLD_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, 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, isStopped, ondoSwapContractAddress, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, txExplorerUrl, usdAmount };
|
package/dist/shared/index.js
CHANGED
|
@@ -7,13 +7,16 @@ import {
|
|
|
7
7
|
CodeVerifier,
|
|
8
8
|
DEFAULT_AMOUNT_TO_COMPUTE_PRICE,
|
|
9
9
|
DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
|
|
10
|
+
DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE,
|
|
10
11
|
DEFAULT_SLIPPAGE_BPS,
|
|
11
12
|
ERC20_ABI,
|
|
12
13
|
ONDO_POLL_INTERVAL_MS,
|
|
13
14
|
ONDO_QUOTE_EXPIRY_THRESHOLD_MS,
|
|
15
|
+
ONDO_SETTLEMENT_ASSET,
|
|
14
16
|
ONDO_SUPPORTED_INPUT_ASSETS,
|
|
15
17
|
OffersNamespaceImpl,
|
|
16
18
|
PKCEState,
|
|
19
|
+
RedactedWalletError,
|
|
17
20
|
RedirectUri,
|
|
18
21
|
SLIPPAGE_OPTIONS_BPS,
|
|
19
22
|
SUPERSTATE_ISSUER_NAME,
|
|
@@ -31,7 +34,8 @@ import {
|
|
|
31
34
|
UserEmail,
|
|
32
35
|
UserId,
|
|
33
36
|
applyBps,
|
|
34
|
-
|
|
37
|
+
computeOndoBuyPrice,
|
|
38
|
+
computeOndoSellPrice,
|
|
35
39
|
computePrice,
|
|
36
40
|
computeSlip,
|
|
37
41
|
decodeSwappedOutputAmount,
|
|
@@ -40,7 +44,7 @@ import {
|
|
|
40
44
|
isStopped,
|
|
41
45
|
ondoSwapContractAddress,
|
|
42
46
|
superstateSwapContractAddress
|
|
43
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-LSPZETDH.js";
|
|
44
48
|
import {
|
|
45
49
|
AllowWalletResponse,
|
|
46
50
|
Asset,
|
|
@@ -72,12 +76,14 @@ import {
|
|
|
72
76
|
FormattedPercentUi,
|
|
73
77
|
HexEncodedTransactionData,
|
|
74
78
|
HttpError,
|
|
79
|
+
InvariantError,
|
|
75
80
|
Iso2CountryCode,
|
|
76
81
|
KnownAssetSymbol,
|
|
77
82
|
KycToken,
|
|
78
83
|
Link,
|
|
79
84
|
MAX_ASSET_DECIMALS,
|
|
80
85
|
MAX_UINT_256,
|
|
86
|
+
MathError,
|
|
81
87
|
Milestone,
|
|
82
88
|
NA_AMOUNT_ASSET_UI,
|
|
83
89
|
NotAuthenticatedError,
|
|
@@ -94,9 +100,10 @@ import {
|
|
|
94
100
|
OfferOptionSlug,
|
|
95
101
|
OfferSlug,
|
|
96
102
|
OfferToken,
|
|
103
|
+
OndoBuyTransaction,
|
|
97
104
|
OndoNamespaceImpl,
|
|
98
105
|
OndoQuote,
|
|
99
|
-
|
|
106
|
+
OndoSellTransaction,
|
|
100
107
|
OndoTradingStatus,
|
|
101
108
|
PaginatedResponse,
|
|
102
109
|
PaginationParams,
|
|
@@ -146,10 +153,11 @@ import {
|
|
|
146
153
|
getChainId,
|
|
147
154
|
getNetworkName,
|
|
148
155
|
parseBlockchainAmount,
|
|
156
|
+
parseUint256,
|
|
149
157
|
shortenAddress,
|
|
150
158
|
txExplorerUrl,
|
|
151
159
|
usdAmount
|
|
152
|
-
} from "../chunk-
|
|
160
|
+
} from "../chunk-7CTH4KPU.js";
|
|
153
161
|
export {
|
|
154
162
|
AllowWalletResponse,
|
|
155
163
|
Asset,
|
|
@@ -176,6 +184,7 @@ export {
|
|
|
176
184
|
Cursor,
|
|
177
185
|
DEFAULT_AMOUNT_TO_COMPUTE_PRICE,
|
|
178
186
|
DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
|
|
187
|
+
DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE,
|
|
179
188
|
DEFAULT_SLIPPAGE_BPS,
|
|
180
189
|
DecimalString,
|
|
181
190
|
DocumentSubmission,
|
|
@@ -191,12 +200,14 @@ export {
|
|
|
191
200
|
FormattedPercentUi,
|
|
192
201
|
HexEncodedTransactionData,
|
|
193
202
|
HttpError,
|
|
203
|
+
InvariantError,
|
|
194
204
|
Iso2CountryCode,
|
|
195
205
|
KnownAssetSymbol,
|
|
196
206
|
KycToken,
|
|
197
207
|
Link,
|
|
198
208
|
MAX_ASSET_DECIMALS,
|
|
199
209
|
MAX_UINT_256,
|
|
210
|
+
MathError,
|
|
200
211
|
Milestone,
|
|
201
212
|
NA_AMOUNT_ASSET_UI,
|
|
202
213
|
NotAuthenticatedError,
|
|
@@ -205,6 +216,7 @@ export {
|
|
|
205
216
|
OAuthSession,
|
|
206
217
|
ONDO_POLL_INTERVAL_MS,
|
|
207
218
|
ONDO_QUOTE_EXPIRY_THRESHOLD_MS,
|
|
219
|
+
ONDO_SETTLEMENT_ASSET,
|
|
208
220
|
ONDO_SUPPORTED_INPUT_ASSETS,
|
|
209
221
|
Offer,
|
|
210
222
|
OfferDetail,
|
|
@@ -217,9 +229,10 @@ export {
|
|
|
217
229
|
OfferSlug,
|
|
218
230
|
OfferToken,
|
|
219
231
|
OffersNamespaceImpl,
|
|
232
|
+
OndoBuyTransaction,
|
|
220
233
|
OndoNamespaceImpl,
|
|
221
234
|
OndoQuote,
|
|
222
|
-
|
|
235
|
+
OndoSellTransaction,
|
|
223
236
|
OndoTradingStatus,
|
|
224
237
|
PKCEState,
|
|
225
238
|
PaginatedResponse,
|
|
@@ -230,6 +243,7 @@ export {
|
|
|
230
243
|
Pii,
|
|
231
244
|
PiiAddress,
|
|
232
245
|
PiiJurisdiction,
|
|
246
|
+
RedactedWalletError,
|
|
233
247
|
RedirectUri,
|
|
234
248
|
Requirement,
|
|
235
249
|
RequirementId,
|
|
@@ -278,7 +292,8 @@ export {
|
|
|
278
292
|
assetAmount,
|
|
279
293
|
blockchainAmountFromRawOrThrow,
|
|
280
294
|
chainFromId,
|
|
281
|
-
|
|
295
|
+
computeOndoBuyPrice,
|
|
296
|
+
computeOndoSellPrice,
|
|
282
297
|
computePrice,
|
|
283
298
|
computeSlip,
|
|
284
299
|
decodeSwappedOutputAmount,
|
|
@@ -295,6 +310,7 @@ export {
|
|
|
295
310
|
isStopped,
|
|
296
311
|
ondoSwapContractAddress,
|
|
297
312
|
parseBlockchainAmount,
|
|
313
|
+
parseUint256,
|
|
298
314
|
shortenAddress,
|
|
299
315
|
superstateSwapContractAddress,
|
|
300
316
|
txExplorerUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinlist-co/react",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1-rc.10770e8",
|
|
4
4
|
"description": "CoinList Partner SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"@sumsub/websdk-react": "^2.6.3",
|
|
109
109
|
"class-variance-authority": "^0.7.1",
|
|
110
110
|
"clsx": "^2.1.1",
|
|
111
|
-
"lucide-react": "^0.577.0"
|
|
111
|
+
"lucide-react": "^0.577.0",
|
|
112
|
+
"pino": "^10.3.1"
|
|
112
113
|
}
|
|
113
114
|
}
|