@coinlist-co/react 0.11.1-rc.e102bdb → 0.12.1-rc.14ac67e
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-LSPZETDH.js → chunk-2XBPKC4C.js} +8 -11
- package/dist/chunk-2XBPKC4C.js.map +1 -0
- package/dist/{chunk-7CTH4KPU.js → chunk-3ATIDGVR.js} +15 -1
- package/dist/chunk-3ATIDGVR.js.map +1 -0
- package/dist/{chunk-UZUQALFY.js → chunk-SOMNMOBU.js} +2 -2
- package/dist/client/index.cjs +39 -39
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +42 -28
- package/dist/client/index.d.ts +42 -28
- package/dist/client/index.js +26 -36
- package/dist/client/index.js.map +1 -1
- package/dist/{collections-BBI_XydI.d.cts → collections-DNbBE6Pk.d.cts} +1 -1
- package/dist/{collections-BrX9rRWc.d.ts → collections-DVCh4jUp.d.ts} +1 -1
- package/dist/{config-CMl1bR3F.d.cts → config-DFYAM0GD.d.cts} +26 -1
- package/dist/{config-CMl1bR3F.d.ts → config-DFYAM0GD.d.ts} +26 -1
- package/dist/server/index.cjs +13 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -2
- package/dist/shared/index.cjs +22 -10
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +38 -8
- package/dist/shared/index.d.ts +38 -8
- package/dist/shared/index.js +7 -5
- package/package.json +18 -13
- package/dist/chunk-7CTH4KPU.js.map +0 -1
- package/dist/chunk-LSPZETDH.js.map +0 -1
- /package/dist/{chunk-UZUQALFY.js.map → chunk-SOMNMOBU.js.map} +0 -0
package/dist/client/index.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
4
|
-
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl, S as SharedNamespaceContext, g as OndoNamespace, h as AssetSymbol, i as
|
|
5
|
-
export {
|
|
6
|
-
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-
|
|
7
|
-
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-
|
|
3
|
+
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl, S as SharedNamespaceContext, g as OndoNamespace, h as AssetSymbol, i as OfferSwapContract, j as OndoBuyTransaction, k as OndoSellTransaction, l as OndoSwapTransactionCore, m as OrderBookSide, n as OndoNamespaceImpl, o as SuperstateSwapNamespace, p as WalletsNamespace, q as Bps, r as EvmWalletAddress, s as SuperstateSwapNamespaceImpl, R as RequirementsNamespace, t as Requirement, u as RequirementsNamespaceImpl, v as Config, w as OAuthAccessToken, x as OffersNamespace, T as TokensNamespace, y as StablecoinSymbol, z as Erc20Asset, D as OfferDetail, F as OfferType, G as Offer, H as RequirementStatusInfo, I as RequirementType, J as RequirementStatusValue, K as OfferOptionAddress, M as RequirementId, N as KycLevelName, Q as DocumentSubmission, U as WalletChallengeType, V as PinoLoggerOptions, X as OndoTradingStatus, Y as AssetDecimals, Z as BuildOndoBuyParams, _ as BuildOndoSellParams, $ as OndoQuote, a0 as OndoQuoteSize, a1 as OfferOptionAddressId, a2 as TokenMetadata, a3 as TokenIdentifier } from '../config-DFYAM0GD.cjs';
|
|
4
|
+
export { a4 as DebugEvent, a5 as FrontlineEventId, a6 as HttpError, a7 as HttpResponse, a8 as KycToken, a9 as LogBinding, aa as LogBindings, ab as LogCause, ac as LogLevel, ad as LogScope, ae as LogValue, af as ProductionLogLevel, ag as RedactedWalletError, ah as RequestId, ai as SafeEvent, aj as SafeFields, ak as UnredactedFields } from '../config-DFYAM0GD.cjs';
|
|
5
|
+
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-DNbBE6Pk.cjs';
|
|
6
|
+
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-DNbBE6Pk.cjs';
|
|
8
7
|
import { Hash } from 'viem';
|
|
9
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
10
9
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -306,6 +305,15 @@ type PrepareOndoSwapParamsCore = {
|
|
|
306
305
|
symbol: AssetSymbol;
|
|
307
306
|
/** The chain the swap executes on, which the swap contract lives on. */
|
|
308
307
|
chain: EthereumChain;
|
|
308
|
+
/**
|
|
309
|
+
* The offer's `swap_contracts` - every chain it can be swapped on, with the
|
|
310
|
+
* contract each settles through.
|
|
311
|
+
*
|
|
312
|
+
* Passed in rather than fetched here because it belongs to the offer the
|
|
313
|
+
* caller already holds, and it varies per offer. An array with no entry for
|
|
314
|
+
* `chain` yields `unsupported-chain`, as does an empty one.
|
|
315
|
+
*/
|
|
316
|
+
swapContracts: OfferSwapContract[];
|
|
309
317
|
onProgress?: (phase: OndoSwapPreparationPhase) => void;
|
|
310
318
|
};
|
|
311
319
|
type PrepareOndoBuyParams = PrepareOndoSwapParamsCore & {
|
|
@@ -341,9 +349,8 @@ type PrepareOndoSellParams = PrepareOndoSwapParamsCore & {
|
|
|
341
349
|
* a minute and an approval takes most of one to mine, so building first would
|
|
342
350
|
* hand the user a transaction that had already expired by the time they could
|
|
343
351
|
* act on it - and each build spends an attestation. That ordering is why the
|
|
344
|
-
* spender
|
|
345
|
-
* `tx.to`
|
|
346
|
-
* before anything is broadcast.
|
|
352
|
+
* spender comes off the offer rather than from the `tx.to` the response
|
|
353
|
+
* returns: `tx.to` arrives too late to approve against.
|
|
347
354
|
*
|
|
348
355
|
* Total: every failure is returned step-tagged rather than thrown, so a caller
|
|
349
356
|
* can map each one to its own copy.
|
|
@@ -363,15 +370,12 @@ type OndoSwapExecutionPhase = 'broadcasting-swap' | 'confirming-swap';
|
|
|
363
370
|
/**
|
|
364
371
|
* A step-tagged reason {@link executeOndoSwap} failed.
|
|
365
372
|
*
|
|
366
|
-
* `quote-expired`
|
|
367
|
-
*
|
|
368
|
-
*
|
|
373
|
+
* `quote-expired` is a refusal to broadcast rather than a failure of a
|
|
374
|
+
* broadcast: it would revert on chain and cost the user gas, and it is fixed
|
|
375
|
+
* by building a fresh transaction.
|
|
369
376
|
*/
|
|
370
377
|
type OndoSwapExecutionError = {
|
|
371
378
|
step: 'quote-expired';
|
|
372
|
-
} | {
|
|
373
|
-
step: 'spender-mismatch';
|
|
374
|
-
expected: EvmContractAddress;
|
|
375
379
|
} | {
|
|
376
380
|
step: 'swap';
|
|
377
381
|
cause: WalletError;
|
|
@@ -427,10 +431,14 @@ type ExecuteOndoSwapParams<T> = {
|
|
|
427
431
|
* The calldata is broadcast verbatim - the SDK never re-encodes it, because
|
|
428
432
|
* the contract verifies a signature over the exact arguments inside it.
|
|
429
433
|
*
|
|
430
|
-
*
|
|
431
|
-
* transaction the user paid for:
|
|
432
|
-
* encoded in the calldata
|
|
433
|
-
*
|
|
434
|
+
* One check runs first, which would otherwise surface as a reverted
|
|
435
|
+
* transaction the user paid for: the transaction must not have expired, its
|
|
436
|
+
* deadline being encoded in the calldata.
|
|
437
|
+
*
|
|
438
|
+
* Where `tx.to` points is deliberately not checked. Frontline compares it to
|
|
439
|
+
* its own configured contract in `addressed_to_our_contract/2`, and the
|
|
440
|
+
* spender this SDK approved came off the same offer frontline served, so a
|
|
441
|
+
* check here would compare two values derived from one source (ENG-1734).
|
|
434
442
|
*/
|
|
435
443
|
declare function executeOndoSwap<T extends OndoSwapTransactionCore>(params: ExecuteOndoSwapParams<T>): Promise<OndoSwapExecutionResult<T>>;
|
|
436
444
|
|
|
@@ -467,8 +475,11 @@ interface ClientOndoNamespace extends OndoNamespace {
|
|
|
467
475
|
prepareSell(params: Omit<PrepareOndoSellParams, 'ondo' | 'erc20'>): Promise<OndoSellPreparationResult>;
|
|
468
476
|
/**
|
|
469
477
|
* Broadcasts a built transaction and waits for it to mine, refusing one that
|
|
470
|
-
* has expired
|
|
471
|
-
*
|
|
478
|
+
* has expired. Returns a step-tagged result rather than throwing.
|
|
479
|
+
*
|
|
480
|
+
* Does not check the destination: frontline compares it to the contract it
|
|
481
|
+
* serves on the offer before answering, so the address here and the one it
|
|
482
|
+
* checked are the same value.
|
|
472
483
|
*
|
|
473
484
|
* Takes either direction's transaction and hands the same one back. The
|
|
474
485
|
* `side` tag is required here and not by {@link executeOndoSwap} itself
|
|
@@ -824,7 +835,7 @@ type CoinListProviderProps = {
|
|
|
824
835
|
* self-scope, so you do not need to wrap them in {@link CoinListStyleScope}.
|
|
825
836
|
* {@link CoinListProvider} is an identical alias with a friendlier name.
|
|
826
837
|
*/
|
|
827
|
-
declare function CoinListContextProvider({ config, locale, children, }: CoinListProviderProps):
|
|
838
|
+
declare function CoinListContextProvider({ config, locale, children, }: CoinListProviderProps): react.JSX.Element;
|
|
828
839
|
/**
|
|
829
840
|
* The provider to mount once at your app root. Provides the CoinList client context
|
|
830
841
|
* to the whole tree with zero visual impact: it renders no DOM, no `<style>`, and no
|
|
@@ -857,7 +868,7 @@ type CoinListStyleScopeProps = {
|
|
|
857
868
|
* Inheritance (font, color, custom-property tokens) and the scoped descendant reset
|
|
858
869
|
* (`.clco-sdk-root *`) still apply through it.
|
|
859
870
|
*/
|
|
860
|
-
declare function CoinListStyleScope({ children }: CoinListStyleScopeProps):
|
|
871
|
+
declare function CoinListStyleScope({ children }: CoinListStyleScopeProps): react.JSX.Element;
|
|
861
872
|
|
|
862
873
|
declare const buttonVariants: (props?: ({
|
|
863
874
|
variant?: "link" | "primary" | "gradient" | "secondary" | "destructive" | "ghost" | "destructiveLink" | null | undefined;
|
|
@@ -1855,11 +1866,12 @@ type OndoBuyReviewUiEvent = {
|
|
|
1855
1866
|
*/
|
|
1856
1867
|
type OndoCheckoutErrorReason =
|
|
1857
1868
|
/**
|
|
1858
|
-
*
|
|
1859
|
-
*
|
|
1869
|
+
* The offer names no CoinList swap contract on the chain the host asked for,
|
|
1870
|
+
* so there is no spender to approve and nothing to broadcast to.
|
|
1860
1871
|
*
|
|
1861
|
-
* Not retryable, and not the host's mistake to correct at runtime: the
|
|
1862
|
-
*
|
|
1872
|
+
* Not retryable, and not the host's mistake to correct at runtime: both the
|
|
1873
|
+
* offer and the chain are fixed for the lifetime of the mount. See
|
|
1874
|
+
* `swapSpender`.
|
|
1863
1875
|
*/
|
|
1864
1876
|
'unsupported-chain';
|
|
1865
1877
|
|
|
@@ -3507,7 +3519,7 @@ interface RequirementItemProps {
|
|
|
3507
3519
|
* renders fully styled on its own, with no `CoinListStyleScope` needed. Also composed
|
|
3508
3520
|
* by {@link RequirementsChecklist}.
|
|
3509
3521
|
*/
|
|
3510
|
-
declare function RequirementItem({ ui, expanded, onToggle, className, onAction, onRemoveWallet, walletsStatus, onContactSupport, }: RequirementItemProps):
|
|
3522
|
+
declare function RequirementItem({ ui, expanded, onToggle, className, onAction, onRemoveWallet, walletsStatus, onContactSupport, }: RequirementItemProps): react.JSX.Element;
|
|
3511
3523
|
|
|
3512
3524
|
type LoadRequirementsReason = 'not-authenticated' | 'generic-error';
|
|
3513
3525
|
type LoadRequirementsState = {
|
|
@@ -4231,6 +4243,8 @@ interface UseOndoBuyAmountViewModelOptions {
|
|
|
4231
4243
|
ondoSymbol: AssetSymbol;
|
|
4232
4244
|
/** The chain the order executes on: balances, approval, and the contract. */
|
|
4233
4245
|
chain: EthereumChain;
|
|
4246
|
+
/** The offer's swap contracts, forwarded to the preparation. */
|
|
4247
|
+
swapContracts: OfferSwapContract[];
|
|
4234
4248
|
/**
|
|
4235
4249
|
* When false, the step neither fetches nor polls. Defaults to true.
|
|
4236
4250
|
*
|
|
@@ -4260,7 +4274,7 @@ interface UseOndoBuyAmountViewModelResult {
|
|
|
4260
4274
|
* the balance, the offer's minimum, and Ondo's own order caps. Each of those
|
|
4261
4275
|
* would otherwise cost the user a real approval transaction before failing.
|
|
4262
4276
|
*/
|
|
4263
|
-
declare function useOndoBuyAmountViewModel({ stepInput, ondoSymbol, chain, enabled, onComplete, onEdit, }: UseOndoBuyAmountViewModelOptions): UseOndoBuyAmountViewModelResult;
|
|
4277
|
+
declare function useOndoBuyAmountViewModel({ stepInput, ondoSymbol, chain, swapContracts, enabled, onComplete, onEdit, }: UseOndoBuyAmountViewModelOptions): UseOndoBuyAmountViewModelResult;
|
|
4264
4278
|
type OndoBuyAmountValidation = {
|
|
4265
4279
|
valid: true;
|
|
4266
4280
|
amount: BlockchainAmount;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
4
|
-
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl, S as SharedNamespaceContext, g as OndoNamespace, h as AssetSymbol, i as
|
|
5
|
-
export {
|
|
6
|
-
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-
|
|
7
|
-
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-
|
|
3
|
+
import { A as AuthorizationCode, C as CodeVerifier, L as Logger, W as WalletError, E as Erc20Namespace, a as EthereumChain, b as EvmContractAddress, B as BlockchainAmount, c as CoinListTokenSaleNamespace, O as OfferId, d as OfferOptionId, e as AssetId, P as Participation, f as CoinListTokenSaleNamespaceImpl, S as SharedNamespaceContext, g as OndoNamespace, h as AssetSymbol, i as OfferSwapContract, j as OndoBuyTransaction, k as OndoSellTransaction, l as OndoSwapTransactionCore, m as OrderBookSide, n as OndoNamespaceImpl, o as SuperstateSwapNamespace, p as WalletsNamespace, q as Bps, r as EvmWalletAddress, s as SuperstateSwapNamespaceImpl, R as RequirementsNamespace, t as Requirement, u as RequirementsNamespaceImpl, v as Config, w as OAuthAccessToken, x as OffersNamespace, T as TokensNamespace, y as StablecoinSymbol, z as Erc20Asset, D as OfferDetail, F as OfferType, G as Offer, H as RequirementStatusInfo, I as RequirementType, J as RequirementStatusValue, K as OfferOptionAddress, M as RequirementId, N as KycLevelName, Q as DocumentSubmission, U as WalletChallengeType, V as PinoLoggerOptions, X as OndoTradingStatus, Y as AssetDecimals, Z as BuildOndoBuyParams, _ as BuildOndoSellParams, $ as OndoQuote, a0 as OndoQuoteSize, a1 as OfferOptionAddressId, a2 as TokenMetadata, a3 as TokenIdentifier } from '../config-DFYAM0GD.js';
|
|
4
|
+
export { a4 as DebugEvent, a5 as FrontlineEventId, a6 as HttpError, a7 as HttpResponse, a8 as KycToken, a9 as LogBinding, aa as LogBindings, ab as LogCause, ac as LogLevel, ad as LogScope, ae as LogValue, af as ProductionLogLevel, ag as RedactedWalletError, ah as RequestId, ai as SafeEvent, aj as SafeFields, ak as UnredactedFields } from '../config-DFYAM0GD.js';
|
|
5
|
+
import { P as PKCEConfig, E as EvmWallet, S as SwapQuote, A as AssetIconUrl, a as ShortenedWalletAddress, F as FormattedAmountAssetUi, b as FormattedPercentUi, T as TxExplorerUrl, C as ConnectWallet, N as NonEmptyArray } from '../collections-DVCh4jUp.js';
|
|
6
|
+
export { B as BroadcastTxParams, c as EvmSigner, W as WriteContractParams } from '../collections-DVCh4jUp.js';
|
|
8
7
|
import { Hash } from 'viem';
|
|
9
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
10
9
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -306,6 +305,15 @@ type PrepareOndoSwapParamsCore = {
|
|
|
306
305
|
symbol: AssetSymbol;
|
|
307
306
|
/** The chain the swap executes on, which the swap contract lives on. */
|
|
308
307
|
chain: EthereumChain;
|
|
308
|
+
/**
|
|
309
|
+
* The offer's `swap_contracts` - every chain it can be swapped on, with the
|
|
310
|
+
* contract each settles through.
|
|
311
|
+
*
|
|
312
|
+
* Passed in rather than fetched here because it belongs to the offer the
|
|
313
|
+
* caller already holds, and it varies per offer. An array with no entry for
|
|
314
|
+
* `chain` yields `unsupported-chain`, as does an empty one.
|
|
315
|
+
*/
|
|
316
|
+
swapContracts: OfferSwapContract[];
|
|
309
317
|
onProgress?: (phase: OndoSwapPreparationPhase) => void;
|
|
310
318
|
};
|
|
311
319
|
type PrepareOndoBuyParams = PrepareOndoSwapParamsCore & {
|
|
@@ -341,9 +349,8 @@ type PrepareOndoSellParams = PrepareOndoSwapParamsCore & {
|
|
|
341
349
|
* a minute and an approval takes most of one to mine, so building first would
|
|
342
350
|
* hand the user a transaction that had already expired by the time they could
|
|
343
351
|
* act on it - and each build spends an attestation. That ordering is why the
|
|
344
|
-
* spender
|
|
345
|
-
* `tx.to`
|
|
346
|
-
* before anything is broadcast.
|
|
352
|
+
* spender comes off the offer rather than from the `tx.to` the response
|
|
353
|
+
* returns: `tx.to` arrives too late to approve against.
|
|
347
354
|
*
|
|
348
355
|
* Total: every failure is returned step-tagged rather than thrown, so a caller
|
|
349
356
|
* can map each one to its own copy.
|
|
@@ -363,15 +370,12 @@ type OndoSwapExecutionPhase = 'broadcasting-swap' | 'confirming-swap';
|
|
|
363
370
|
/**
|
|
364
371
|
* A step-tagged reason {@link executeOndoSwap} failed.
|
|
365
372
|
*
|
|
366
|
-
* `quote-expired`
|
|
367
|
-
*
|
|
368
|
-
*
|
|
373
|
+
* `quote-expired` is a refusal to broadcast rather than a failure of a
|
|
374
|
+
* broadcast: it would revert on chain and cost the user gas, and it is fixed
|
|
375
|
+
* by building a fresh transaction.
|
|
369
376
|
*/
|
|
370
377
|
type OndoSwapExecutionError = {
|
|
371
378
|
step: 'quote-expired';
|
|
372
|
-
} | {
|
|
373
|
-
step: 'spender-mismatch';
|
|
374
|
-
expected: EvmContractAddress;
|
|
375
379
|
} | {
|
|
376
380
|
step: 'swap';
|
|
377
381
|
cause: WalletError;
|
|
@@ -427,10 +431,14 @@ type ExecuteOndoSwapParams<T> = {
|
|
|
427
431
|
* The calldata is broadcast verbatim - the SDK never re-encodes it, because
|
|
428
432
|
* the contract verifies a signature over the exact arguments inside it.
|
|
429
433
|
*
|
|
430
|
-
*
|
|
431
|
-
* transaction the user paid for:
|
|
432
|
-
* encoded in the calldata
|
|
433
|
-
*
|
|
434
|
+
* One check runs first, which would otherwise surface as a reverted
|
|
435
|
+
* transaction the user paid for: the transaction must not have expired, its
|
|
436
|
+
* deadline being encoded in the calldata.
|
|
437
|
+
*
|
|
438
|
+
* Where `tx.to` points is deliberately not checked. Frontline compares it to
|
|
439
|
+
* its own configured contract in `addressed_to_our_contract/2`, and the
|
|
440
|
+
* spender this SDK approved came off the same offer frontline served, so a
|
|
441
|
+
* check here would compare two values derived from one source (ENG-1734).
|
|
434
442
|
*/
|
|
435
443
|
declare function executeOndoSwap<T extends OndoSwapTransactionCore>(params: ExecuteOndoSwapParams<T>): Promise<OndoSwapExecutionResult<T>>;
|
|
436
444
|
|
|
@@ -467,8 +475,11 @@ interface ClientOndoNamespace extends OndoNamespace {
|
|
|
467
475
|
prepareSell(params: Omit<PrepareOndoSellParams, 'ondo' | 'erc20'>): Promise<OndoSellPreparationResult>;
|
|
468
476
|
/**
|
|
469
477
|
* Broadcasts a built transaction and waits for it to mine, refusing one that
|
|
470
|
-
* has expired
|
|
471
|
-
*
|
|
478
|
+
* has expired. Returns a step-tagged result rather than throwing.
|
|
479
|
+
*
|
|
480
|
+
* Does not check the destination: frontline compares it to the contract it
|
|
481
|
+
* serves on the offer before answering, so the address here and the one it
|
|
482
|
+
* checked are the same value.
|
|
472
483
|
*
|
|
473
484
|
* Takes either direction's transaction and hands the same one back. The
|
|
474
485
|
* `side` tag is required here and not by {@link executeOndoSwap} itself
|
|
@@ -824,7 +835,7 @@ type CoinListProviderProps = {
|
|
|
824
835
|
* self-scope, so you do not need to wrap them in {@link CoinListStyleScope}.
|
|
825
836
|
* {@link CoinListProvider} is an identical alias with a friendlier name.
|
|
826
837
|
*/
|
|
827
|
-
declare function CoinListContextProvider({ config, locale, children, }: CoinListProviderProps):
|
|
838
|
+
declare function CoinListContextProvider({ config, locale, children, }: CoinListProviderProps): react.JSX.Element;
|
|
828
839
|
/**
|
|
829
840
|
* The provider to mount once at your app root. Provides the CoinList client context
|
|
830
841
|
* to the whole tree with zero visual impact: it renders no DOM, no `<style>`, and no
|
|
@@ -857,7 +868,7 @@ type CoinListStyleScopeProps = {
|
|
|
857
868
|
* Inheritance (font, color, custom-property tokens) and the scoped descendant reset
|
|
858
869
|
* (`.clco-sdk-root *`) still apply through it.
|
|
859
870
|
*/
|
|
860
|
-
declare function CoinListStyleScope({ children }: CoinListStyleScopeProps):
|
|
871
|
+
declare function CoinListStyleScope({ children }: CoinListStyleScopeProps): react.JSX.Element;
|
|
861
872
|
|
|
862
873
|
declare const buttonVariants: (props?: ({
|
|
863
874
|
variant?: "link" | "primary" | "gradient" | "secondary" | "destructive" | "ghost" | "destructiveLink" | null | undefined;
|
|
@@ -1855,11 +1866,12 @@ type OndoBuyReviewUiEvent = {
|
|
|
1855
1866
|
*/
|
|
1856
1867
|
type OndoCheckoutErrorReason =
|
|
1857
1868
|
/**
|
|
1858
|
-
*
|
|
1859
|
-
*
|
|
1869
|
+
* The offer names no CoinList swap contract on the chain the host asked for,
|
|
1870
|
+
* so there is no spender to approve and nothing to broadcast to.
|
|
1860
1871
|
*
|
|
1861
|
-
* Not retryable, and not the host's mistake to correct at runtime: the
|
|
1862
|
-
*
|
|
1872
|
+
* Not retryable, and not the host's mistake to correct at runtime: both the
|
|
1873
|
+
* offer and the chain are fixed for the lifetime of the mount. See
|
|
1874
|
+
* `swapSpender`.
|
|
1863
1875
|
*/
|
|
1864
1876
|
'unsupported-chain';
|
|
1865
1877
|
|
|
@@ -3507,7 +3519,7 @@ interface RequirementItemProps {
|
|
|
3507
3519
|
* renders fully styled on its own, with no `CoinListStyleScope` needed. Also composed
|
|
3508
3520
|
* by {@link RequirementsChecklist}.
|
|
3509
3521
|
*/
|
|
3510
|
-
declare function RequirementItem({ ui, expanded, onToggle, className, onAction, onRemoveWallet, walletsStatus, onContactSupport, }: RequirementItemProps):
|
|
3522
|
+
declare function RequirementItem({ ui, expanded, onToggle, className, onAction, onRemoveWallet, walletsStatus, onContactSupport, }: RequirementItemProps): react.JSX.Element;
|
|
3511
3523
|
|
|
3512
3524
|
type LoadRequirementsReason = 'not-authenticated' | 'generic-error';
|
|
3513
3525
|
type LoadRequirementsState = {
|
|
@@ -4231,6 +4243,8 @@ interface UseOndoBuyAmountViewModelOptions {
|
|
|
4231
4243
|
ondoSymbol: AssetSymbol;
|
|
4232
4244
|
/** The chain the order executes on: balances, approval, and the contract. */
|
|
4233
4245
|
chain: EthereumChain;
|
|
4246
|
+
/** The offer's swap contracts, forwarded to the preparation. */
|
|
4247
|
+
swapContracts: OfferSwapContract[];
|
|
4234
4248
|
/**
|
|
4235
4249
|
* When false, the step neither fetches nor polls. Defaults to true.
|
|
4236
4250
|
*
|
|
@@ -4260,7 +4274,7 @@ interface UseOndoBuyAmountViewModelResult {
|
|
|
4260
4274
|
* the balance, the offer's minimum, and Ondo's own order caps. Each of those
|
|
4261
4275
|
* would otherwise cost the user a real approval transaction before failing.
|
|
4262
4276
|
*/
|
|
4263
|
-
declare function useOndoBuyAmountViewModel({ stepInput, ondoSymbol, chain, enabled, onComplete, onEdit, }: UseOndoBuyAmountViewModelOptions): UseOndoBuyAmountViewModelResult;
|
|
4277
|
+
declare function useOndoBuyAmountViewModel({ stepInput, ondoSymbol, chain, swapContracts, enabled, onComplete, onEdit, }: UseOndoBuyAmountViewModelOptions): UseOndoBuyAmountViewModelResult;
|
|
4264
4278
|
type OndoBuyAmountValidation = {
|
|
4265
4279
|
valid: true;
|
|
4266
4280
|
amount: BlockchainAmount;
|