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

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.
@@ -1122,6 +1122,13 @@ declare const ERC20_ABI: readonly [{
1122
1122
  declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
1123
1123
  type FormatAmountOptions = {
1124
1124
  maxFractionDigits?: AssetDecimals;
1125
+ /**
1126
+ * Trailing zeros are kept down to this many places. Defaults to
1127
+ * `maxFractionDigits` when that is set, otherwise 2 (or the token's own
1128
+ * decimals, when fewer). A figure that wants a cap and a shorter floor —
1129
+ * a share headline — passes both.
1130
+ */
1131
+ minFractionDigits?: AssetDecimals;
1125
1132
  };
1126
1133
  declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
1127
1134
  declare function formatRawAmount(amount: BlockchainAmount): string;
@@ -1137,6 +1144,16 @@ declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
1137
1144
  declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
1138
1145
  /** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
1139
1146
  declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
1147
+ /**
1148
+ * A share quantity for a headline: at most 6 decimal places, at least 2, with
1149
+ * the zeros between those dropped.
1150
+ *
1151
+ * An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
1152
+ * confirmation row and the fund name collapses to an ellipsis. Places past 6
1153
+ * are dust at share scale. The chain amount is unchanged, and the transaction
1154
+ * link still carries the exact figure.
1155
+ */
1156
+ declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
1140
1157
  /**
1141
1158
  * Formats a USD amount capped at 2 fractional digits, falling back to the
1142
1159
  * {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
@@ -1273,4 +1290,4 @@ declare const User: {
1273
1290
  fromDto: (dto: UserDto) => User;
1274
1291
  };
1275
1292
 
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 };
1293
+ export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
@@ -1122,6 +1122,13 @@ declare const ERC20_ABI: readonly [{
1122
1122
  declare function shortenAddress(address: EvmWalletAddress): ShortenedWalletAddress;
1123
1123
  type FormatAmountOptions = {
1124
1124
  maxFractionDigits?: AssetDecimals;
1125
+ /**
1126
+ * Trailing zeros are kept down to this many places. Defaults to
1127
+ * `maxFractionDigits` when that is set, otherwise 2 (or the token's own
1128
+ * decimals, when fewer). A figure that wants a cap and a shorter floor —
1129
+ * a share headline — passes both.
1130
+ */
1131
+ minFractionDigits?: AssetDecimals;
1125
1132
  };
1126
1133
  declare function formatAmount(amount: BlockchainAmount, locale: string, options?: FormatAmountOptions): FormattedAmountUi;
1127
1134
  declare function formatRawAmount(amount: BlockchainAmount): string;
@@ -1137,6 +1144,16 @@ declare function usdAmount(amount: FormattedAmountUi): FormattedAmountAssetUi;
1137
1144
  declare function assetAmount(amount: FormattedAmountUi, symbol: AssetSymbol): FormattedAmountAssetUi;
1138
1145
  /** Placeholder shown when an amount is unavailable (e.g. a loading quote). */
1139
1146
  declare const NA_AMOUNT_ASSET_UI: FormattedAmountAssetUi;
1147
+ /**
1148
+ * A share quantity for a headline: at most 6 decimal places, at least 2, with
1149
+ * the zeros between those dropped.
1150
+ *
1151
+ * An 18-decimal fill (`0.002689383776381483`) otherwise takes the whole
1152
+ * confirmation row and the fund name collapses to an ellipsis. Places past 6
1153
+ * are dust at share scale. The chain amount is unchanged, and the transaction
1154
+ * link still carries the exact figure.
1155
+ */
1156
+ declare function formatShareAmount(amount: BlockchainAmount, locale: string): FormattedAmountUi;
1140
1157
  /**
1141
1158
  * Formats a USD amount capped at 2 fractional digits, falling back to the
1142
1159
  * {@link NA_AMOUNT_ASSET_UI} placeholder when the amount is absent.
@@ -1273,4 +1290,4 @@ declare const User: {
1273
1290
  fromDto: (dto: UserDto) => User;
1274
1291
  };
1275
1292
 
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 };
1293
+ export { type AmountParseErrorReason, type AmountParseResult, AssetDecimals, AssetSymbol, BPS_DENOM, BlockchainAmount, Bps, DEFAULT_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE, DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE, DEFAULT_SLIPPAGE_BPS, DecimalString, ERC20_ABI, Erc20Asset, EthereumChain, EvmContractAddress, EvmWalletAddress, type FormatAmountOptions, FormattedAmountAssetUi, FormattedAmountUi, FormattedPercentUi, InvariantError, KnownAssetSymbol, MathError, NA_AMOUNT_ASSET_UI, NonEmptyArray, NotAuthenticatedError, NotImplementedError, ONDO_POLL_INTERVAL_MS, ONDO_QUOTE_MAX_TTL_MS, ONDO_SETTLEMENT_ASSET, ONDO_SUPPORTED_INPUT_ASSETS, OfferSwapContract, OndoBuyTransaction, OndoSellTransaction, PaginatedResponse, PaginationParams, SLIPPAGE_OPTIONS_BPS, SUPERSTATE_ISSUER_NAME, SUPERSTATE_SUPPORTED_INPUT_ASSETS, SUPERSTATE_SWAP_ABI, SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA, SWAP_LEVEL, SWAP_POLL_INTERVAL_MS, ShortenedWalletAddress, StablecoinSymbol, SwapQuote, SwapStatus, TOKEN_REGISTRY, TxExplorerUrl, USDC, USDC_SYMBOL, USDT, USDT_SYMBOL, Uint256, User, UserEmail, UserId, ValidationError, applyBps, assetAmount, blockchainAmountFromRawOrThrow, chainFromId, computeOndoBuyPrice, computeOndoSellPrice, computePrice, computeSlip, decodeSwappedOutputAmount, fetchAllPages, formatAmount, formatBpsAsPercent, formatCompactAmount, formatRawAmount, formatShareAmount, formattedPricePerShare, formattedUsdPrice, getChainId, getNetworkName, isSwapAvailable, ondoQuoteOfferDeadline, parseBlockchainAmount, shortenAddress, superstateSwapContractAddress, swapSpender, txExplorerUrl, usdAmount, viemChain };
@@ -46,7 +46,7 @@ import {
46
46
  ondoQuoteOfferDeadline,
47
47
  superstateSwapContractAddress,
48
48
  swapSpender
49
- } from "../chunk-VH34YC3Q.js";
49
+ } from "../chunk-3UQPCAU4.js";
50
50
  import {
51
51
  AllowWalletResponse,
52
52
  Asset,
@@ -154,6 +154,7 @@ import {
154
154
  formatBpsAsPercent,
155
155
  formatCompactAmount,
156
156
  formatRawAmount,
157
+ formatShareAmount,
157
158
  formattedUsdPrice,
158
159
  getChainId,
159
160
  getNetworkName,
@@ -165,7 +166,7 @@ import {
165
166
  txExplorerUrl,
166
167
  usdAmount,
167
168
  viemChain
168
- } from "../chunk-MOE5S6CE.js";
169
+ } from "../chunk-IRV5YU42.js";
169
170
  export {
170
171
  AllowWalletResponse,
171
172
  Asset,
@@ -313,6 +314,7 @@ export {
313
314
  formatBpsAsPercent,
314
315
  formatCompactAmount,
315
316
  formatRawAmount,
317
+ formatShareAmount,
316
318
  formattedPricePerShare,
317
319
  formattedUsdPrice,
318
320
  generatePKCEParams,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinlist-co/react",
3
- "version": "0.12.1",
3
+ "version": "0.12.2-rc.726778a",
4
4
  "description": "CoinList Partner SDK",
5
5
  "type": "module",
6
6
  "scripts": {