@pollar/react 0.12.1-rc.10 → 0.12.1-rc.11
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/index.d.mts +47 -3
- package/dist/index.d.ts +47 -3
- package/dist/index.js +511 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +512 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuote, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, BridgeQuote, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
2
|
+
import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, SwapDestinationChain, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuote, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, SolanaSwapOptions, SwapStatus, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, SolanaEarnProviderId, SolanaEarnOpportunity, SolanaEarnPosition, SolanaEarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, BridgeQuote, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
4
|
import { CSSProperties, ReactNode } from 'react';
|
|
5
5
|
|
|
@@ -228,6 +228,22 @@ interface SwapQuoteView {
|
|
|
228
228
|
minReceived: string;
|
|
229
229
|
/** Percent; null when the venue does not report it. */
|
|
230
230
|
priceImpactPct: string | null;
|
|
231
|
+
/** What the route charges, labelled. */
|
|
232
|
+
fees?: Array<{
|
|
233
|
+
label: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}>;
|
|
236
|
+
totalFeesUsd?: number | null;
|
|
237
|
+
/** Seconds the price is good for; null when it has no window. */
|
|
238
|
+
expiresInSeconds?: number | null;
|
|
239
|
+
}
|
|
240
|
+
/** A cross-chain swap's delivery on the destination chain, once its Solana transaction landed. */
|
|
241
|
+
interface SwapSettlementView {
|
|
242
|
+
kind: 'pending' | 'completed' | 'held' | 'refunded' | 'failed';
|
|
243
|
+
text: string;
|
|
244
|
+
/** The user's wallet it delivers to. */
|
|
245
|
+
address: string | null;
|
|
246
|
+
explorerUrl: string | null;
|
|
231
247
|
}
|
|
232
248
|
interface SwapModalTemplateProps {
|
|
233
249
|
theme: string;
|
|
@@ -243,6 +259,12 @@ interface SwapModalTemplateProps {
|
|
|
243
259
|
/** The chains the app offers swaps on; a selector shows when there are two. */
|
|
244
260
|
chains: SwapChain[];
|
|
245
261
|
chain: SwapChain;
|
|
262
|
+
/** Where a Solana swap can deliver; a selector shows when there is more than one. */
|
|
263
|
+
destinations?: SwapDestinationChain[];
|
|
264
|
+
destination?: SwapDestinationChain;
|
|
265
|
+
/** USDC to USDC across chains: a transfer, which the swap does not do. */
|
|
266
|
+
usdcAcross?: boolean;
|
|
267
|
+
settlement?: SwapSettlementView | null;
|
|
246
268
|
provider: string;
|
|
247
269
|
providers: string[];
|
|
248
270
|
quote: SwapQuoteView | null;
|
|
@@ -273,6 +295,7 @@ interface SwapModalTemplateProps {
|
|
|
273
295
|
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
274
296
|
onAmountChange: (value: string) => void;
|
|
275
297
|
onChainChange: (chain: SwapChain) => void;
|
|
298
|
+
onDestinationChange?: (chain: SwapDestinationChain) => void;
|
|
276
299
|
onProviderChange: (p: string) => void;
|
|
277
300
|
onSwap: () => void;
|
|
278
301
|
onToggleXdr: () => void;
|
|
@@ -280,7 +303,7 @@ interface SwapModalTemplateProps {
|
|
|
280
303
|
onRetry: () => void;
|
|
281
304
|
onDone: () => void;
|
|
282
305
|
}
|
|
283
|
-
declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, language: languageProp, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onChainChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, destinations, destination, usdcAcross, settlement, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, language: languageProp, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onChainChange, onDestinationChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
284
307
|
|
|
285
308
|
/** Where the swap modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
286
309
|
interface SwapModalOptions {
|
|
@@ -290,6 +313,8 @@ interface SwapModalOptions {
|
|
|
290
313
|
/** Code of the asset bought, e.g. 'USDC'. */
|
|
291
314
|
buy?: string;
|
|
292
315
|
amount?: string;
|
|
316
|
+
/** Solana only: deliver to the user's own wallet on this chain, when the app offers it. */
|
|
317
|
+
destinationChain?: SwapDestinationChain;
|
|
293
318
|
/** Called once the swap lands, with its transaction hash. */
|
|
294
319
|
onSuccess?: (result: {
|
|
295
320
|
hash: string;
|
|
@@ -320,6 +345,8 @@ declare function BridgeModal({ onClose, initial }: BridgeModalProps): react_jsx_
|
|
|
320
345
|
|
|
321
346
|
/** Where the earn modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
322
347
|
interface EarnModalOptions {
|
|
348
|
+
/** The network the modal opens on, when the app offers Earn on both. */
|
|
349
|
+
chain?: EarnNetwork;
|
|
323
350
|
provider?: EarnProviderId;
|
|
324
351
|
/** The vault or pool, as `getEarnOpportunities` names it. */
|
|
325
352
|
opportunityId?: string;
|
|
@@ -334,6 +361,8 @@ interface EarnModalProps {
|
|
|
334
361
|
onClose: () => void;
|
|
335
362
|
initial?: EarnModalOptions | undefined;
|
|
336
363
|
}
|
|
364
|
+
/** The networks Earn runs on; the modal shows a selector when the app offers both. */
|
|
365
|
+
type EarnNetwork = 'STELLAR' | 'SOLANA';
|
|
337
366
|
declare function EarnModal({ onClose, initial }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
338
367
|
|
|
339
368
|
/** Where the card modal opens: a starting point the user can change. An option the user cannot use is left out. */
|
|
@@ -531,7 +560,12 @@ interface PollarContextValue {
|
|
|
531
560
|
/** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
|
|
532
561
|
swapSolana: (quote: SolanaSwapQuote, opts?: {
|
|
533
562
|
slippageBps?: number;
|
|
563
|
+
idempotencyKey?: string;
|
|
534
564
|
}) => Promise<SubmitOutcome>;
|
|
565
|
+
/** The Solana venues and the chains a Solana swap delivers to. Mirrors {@link PollarClient.getSolanaSwapOptions}. */
|
|
566
|
+
getSolanaSwapOptions: () => Promise<SolanaSwapOptions>;
|
|
567
|
+
/** Where a swap built under a key stands, its settlement included. Mirrors {@link PollarClient.getSwapStatus}. */
|
|
568
|
+
getSwapStatus: (idempotencyKey: string) => Promise<SwapStatus>;
|
|
535
569
|
/** Open the swap modal. */
|
|
536
570
|
/** Opens the swap modal, on the network, assets and amount given; `onSuccess` hears the swap land. */
|
|
537
571
|
openSwapModal: (options?: SwapModalOptions) => void;
|
|
@@ -562,6 +596,16 @@ interface PollarContextValue {
|
|
|
562
596
|
* {@link PollarClient.earnWithdraw}.
|
|
563
597
|
*/
|
|
564
598
|
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
599
|
+
/** The Earn providers on Solana (empty = no Earn there). Mirrors {@link PollarClient.getSolanaEarnProviders}. */
|
|
600
|
+
getSolanaEarnProviders: () => Promise<SolanaEarnProviderId[]>;
|
|
601
|
+
/** The Solana opportunities, APY after fees. Mirrors {@link PollarClient.getSolanaEarnOpportunities}. */
|
|
602
|
+
getSolanaEarnOpportunities: () => Promise<SolanaEarnOpportunity[]>;
|
|
603
|
+
/** The user's position in a Solana opportunity. Mirrors {@link PollarClient.getSolanaEarnPosition}. */
|
|
604
|
+
getSolanaEarnPosition: (opportunity: string) => Promise<SolanaEarnPosition>;
|
|
605
|
+
/** Deposit into a Solana opportunity. Mirrors {@link PollarClient.earnSolanaDeposit}. */
|
|
606
|
+
earnSolanaDeposit: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
607
|
+
/** Withdraw from a Solana opportunity. Mirrors {@link PollarClient.earnSolanaWithdraw}. */
|
|
608
|
+
earnSolanaWithdraw: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
565
609
|
/** Open the Earn modal. */
|
|
566
610
|
/** Opens the earn modal, on the provider, opportunity, tab and amount given; `onSuccess` hears the transaction land. */
|
|
567
611
|
openEarnModal: (options?: EarnModalOptions) => void;
|
|
@@ -1566,4 +1610,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1566
1610
|
}
|
|
1567
1611
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1568
1612
|
|
|
1569
|
-
export { type AuthModalProps, BridgeModal, type BridgeModalOptions, type BridgeModalStep, BridgeModalTemplate, type BridgeModalTemplateProps, CardModal, type CardModalOptions, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, type EarnModalOptions, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampModalOptions, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, type ReceiveModalOptions, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, type SendModalOptions, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, type SwapModalOptions, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, type TxHistoryModalOptions, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|
|
1613
|
+
export { type AuthModalProps, BridgeModal, type BridgeModalOptions, type BridgeModalStep, BridgeModalTemplate, type BridgeModalTemplateProps, CardModal, type CardModalOptions, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, type EarnModalOptions, type EarnNetwork, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampModalOptions, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, type ReceiveModalOptions, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, type SendModalOptions, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, type SwapModalOptions, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, type TxHistoryModalOptions, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuote, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, BridgeQuote, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
2
|
+
import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, SwapDestinationChain, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuote, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, SolanaSwapOptions, SwapStatus, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, SolanaEarnProviderId, SolanaEarnOpportunity, SolanaEarnPosition, SolanaEarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, BridgeQuote, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
4
|
import { CSSProperties, ReactNode } from 'react';
|
|
5
5
|
|
|
@@ -228,6 +228,22 @@ interface SwapQuoteView {
|
|
|
228
228
|
minReceived: string;
|
|
229
229
|
/** Percent; null when the venue does not report it. */
|
|
230
230
|
priceImpactPct: string | null;
|
|
231
|
+
/** What the route charges, labelled. */
|
|
232
|
+
fees?: Array<{
|
|
233
|
+
label: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}>;
|
|
236
|
+
totalFeesUsd?: number | null;
|
|
237
|
+
/** Seconds the price is good for; null when it has no window. */
|
|
238
|
+
expiresInSeconds?: number | null;
|
|
239
|
+
}
|
|
240
|
+
/** A cross-chain swap's delivery on the destination chain, once its Solana transaction landed. */
|
|
241
|
+
interface SwapSettlementView {
|
|
242
|
+
kind: 'pending' | 'completed' | 'held' | 'refunded' | 'failed';
|
|
243
|
+
text: string;
|
|
244
|
+
/** The user's wallet it delivers to. */
|
|
245
|
+
address: string | null;
|
|
246
|
+
explorerUrl: string | null;
|
|
231
247
|
}
|
|
232
248
|
interface SwapModalTemplateProps {
|
|
233
249
|
theme: string;
|
|
@@ -243,6 +259,12 @@ interface SwapModalTemplateProps {
|
|
|
243
259
|
/** The chains the app offers swaps on; a selector shows when there are two. */
|
|
244
260
|
chains: SwapChain[];
|
|
245
261
|
chain: SwapChain;
|
|
262
|
+
/** Where a Solana swap can deliver; a selector shows when there is more than one. */
|
|
263
|
+
destinations?: SwapDestinationChain[];
|
|
264
|
+
destination?: SwapDestinationChain;
|
|
265
|
+
/** USDC to USDC across chains: a transfer, which the swap does not do. */
|
|
266
|
+
usdcAcross?: boolean;
|
|
267
|
+
settlement?: SwapSettlementView | null;
|
|
246
268
|
provider: string;
|
|
247
269
|
providers: string[];
|
|
248
270
|
quote: SwapQuoteView | null;
|
|
@@ -273,6 +295,7 @@ interface SwapModalTemplateProps {
|
|
|
273
295
|
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
274
296
|
onAmountChange: (value: string) => void;
|
|
275
297
|
onChainChange: (chain: SwapChain) => void;
|
|
298
|
+
onDestinationChange?: (chain: SwapDestinationChain) => void;
|
|
276
299
|
onProviderChange: (p: string) => void;
|
|
277
300
|
onSwap: () => void;
|
|
278
301
|
onToggleXdr: () => void;
|
|
@@ -280,7 +303,7 @@ interface SwapModalTemplateProps {
|
|
|
280
303
|
onRetry: () => void;
|
|
281
304
|
onDone: () => void;
|
|
282
305
|
}
|
|
283
|
-
declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, language: languageProp, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onChainChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, destinations, destination, usdcAcross, settlement, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, language: languageProp, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onChainChange, onDestinationChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
284
307
|
|
|
285
308
|
/** Where the swap modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
286
309
|
interface SwapModalOptions {
|
|
@@ -290,6 +313,8 @@ interface SwapModalOptions {
|
|
|
290
313
|
/** Code of the asset bought, e.g. 'USDC'. */
|
|
291
314
|
buy?: string;
|
|
292
315
|
amount?: string;
|
|
316
|
+
/** Solana only: deliver to the user's own wallet on this chain, when the app offers it. */
|
|
317
|
+
destinationChain?: SwapDestinationChain;
|
|
293
318
|
/** Called once the swap lands, with its transaction hash. */
|
|
294
319
|
onSuccess?: (result: {
|
|
295
320
|
hash: string;
|
|
@@ -320,6 +345,8 @@ declare function BridgeModal({ onClose, initial }: BridgeModalProps): react_jsx_
|
|
|
320
345
|
|
|
321
346
|
/** Where the earn modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
322
347
|
interface EarnModalOptions {
|
|
348
|
+
/** The network the modal opens on, when the app offers Earn on both. */
|
|
349
|
+
chain?: EarnNetwork;
|
|
323
350
|
provider?: EarnProviderId;
|
|
324
351
|
/** The vault or pool, as `getEarnOpportunities` names it. */
|
|
325
352
|
opportunityId?: string;
|
|
@@ -334,6 +361,8 @@ interface EarnModalProps {
|
|
|
334
361
|
onClose: () => void;
|
|
335
362
|
initial?: EarnModalOptions | undefined;
|
|
336
363
|
}
|
|
364
|
+
/** The networks Earn runs on; the modal shows a selector when the app offers both. */
|
|
365
|
+
type EarnNetwork = 'STELLAR' | 'SOLANA';
|
|
337
366
|
declare function EarnModal({ onClose, initial }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
338
367
|
|
|
339
368
|
/** Where the card modal opens: a starting point the user can change. An option the user cannot use is left out. */
|
|
@@ -531,7 +560,12 @@ interface PollarContextValue {
|
|
|
531
560
|
/** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
|
|
532
561
|
swapSolana: (quote: SolanaSwapQuote, opts?: {
|
|
533
562
|
slippageBps?: number;
|
|
563
|
+
idempotencyKey?: string;
|
|
534
564
|
}) => Promise<SubmitOutcome>;
|
|
565
|
+
/** The Solana venues and the chains a Solana swap delivers to. Mirrors {@link PollarClient.getSolanaSwapOptions}. */
|
|
566
|
+
getSolanaSwapOptions: () => Promise<SolanaSwapOptions>;
|
|
567
|
+
/** Where a swap built under a key stands, its settlement included. Mirrors {@link PollarClient.getSwapStatus}. */
|
|
568
|
+
getSwapStatus: (idempotencyKey: string) => Promise<SwapStatus>;
|
|
535
569
|
/** Open the swap modal. */
|
|
536
570
|
/** Opens the swap modal, on the network, assets and amount given; `onSuccess` hears the swap land. */
|
|
537
571
|
openSwapModal: (options?: SwapModalOptions) => void;
|
|
@@ -562,6 +596,16 @@ interface PollarContextValue {
|
|
|
562
596
|
* {@link PollarClient.earnWithdraw}.
|
|
563
597
|
*/
|
|
564
598
|
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
599
|
+
/** The Earn providers on Solana (empty = no Earn there). Mirrors {@link PollarClient.getSolanaEarnProviders}. */
|
|
600
|
+
getSolanaEarnProviders: () => Promise<SolanaEarnProviderId[]>;
|
|
601
|
+
/** The Solana opportunities, APY after fees. Mirrors {@link PollarClient.getSolanaEarnOpportunities}. */
|
|
602
|
+
getSolanaEarnOpportunities: () => Promise<SolanaEarnOpportunity[]>;
|
|
603
|
+
/** The user's position in a Solana opportunity. Mirrors {@link PollarClient.getSolanaEarnPosition}. */
|
|
604
|
+
getSolanaEarnPosition: (opportunity: string) => Promise<SolanaEarnPosition>;
|
|
605
|
+
/** Deposit into a Solana opportunity. Mirrors {@link PollarClient.earnSolanaDeposit}. */
|
|
606
|
+
earnSolanaDeposit: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
607
|
+
/** Withdraw from a Solana opportunity. Mirrors {@link PollarClient.earnSolanaWithdraw}. */
|
|
608
|
+
earnSolanaWithdraw: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
565
609
|
/** Open the Earn modal. */
|
|
566
610
|
/** Opens the earn modal, on the provider, opportunity, tab and amount given; `onSuccess` hears the transaction land. */
|
|
567
611
|
openEarnModal: (options?: EarnModalOptions) => void;
|
|
@@ -1566,4 +1610,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1566
1610
|
}
|
|
1567
1611
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1568
1612
|
|
|
1569
|
-
export { type AuthModalProps, BridgeModal, type BridgeModalOptions, type BridgeModalStep, BridgeModalTemplate, type BridgeModalTemplateProps, CardModal, type CardModalOptions, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, type EarnModalOptions, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampModalOptions, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, type ReceiveModalOptions, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, type SendModalOptions, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, type SwapModalOptions, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, type TxHistoryModalOptions, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|
|
1613
|
+
export { type AuthModalProps, BridgeModal, type BridgeModalOptions, type BridgeModalStep, BridgeModalTemplate, type BridgeModalTemplateProps, CardModal, type CardModalOptions, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, type EarnModalOptions, type EarnNetwork, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampModalOptions, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, type ReceiveModalOptions, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, type SendModalOptions, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, type SwapModalOptions, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, type TxHistoryModalOptions, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|