@pollar/react 0.10.0-rc.8 → 0.10.0

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 CHANGED
@@ -1,28 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { WalletId, AuthState, pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, PollarAdapter, KycStatus as KycStatus$1, RampQuote, KycProvider, KycStartResponse, RampDirection, PaymentInstructions, EnabledAssetRecord, WalletBalanceRecord, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapQuoteParams, SwapQuote, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampTxStatus, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
3
3
  export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  type ConfigResponse = pollarPaths['/applications/config']['get']['responses'][200]['content']['application/json'];
7
7
  type PollarConfig = ConfigResponse['content'];
8
8
  type PollarStyles = PollarConfig['styles'];
9
- /**
10
- * Props passed by `@pollar/react` to a `renderWallets` slot. External wallet
11
- * picker components receive these and call `onConnect(id)` when the user picks
12
- * a wallet; `@pollar/react` wraps that into `client.login({ provider: id })`.
13
- */
14
- interface RenderWalletsProps {
15
- /** Wrapper around `client.login({ provider: id })`. */
16
- onConnect: (id: WalletId) => void;
17
- /** Current auth state — picker can disable buttons / surface loading. */
18
- authState: AuthState;
19
- }
20
- /**
21
- * Signature for the `ui.renderWallets` slot on `<PollarProvider>`. When
22
- * provided, replaces the default Freighter/Albedo buttons in the LoginModal
23
- * with whatever the slot returns (typically a kit-powered wallet grid).
24
- */
25
- type RenderWalletsSlot = (props: RenderWalletsProps) => ReactNode;
26
9
  interface LoginButtonProps {
27
10
  onSuccess?: () => void;
28
11
  onError?: (error: Error) => void;
@@ -60,8 +43,6 @@ interface PollarContextValue {
60
43
  openSessionsModal: () => void;
61
44
  appConfig: PollarConfig;
62
45
  styles: PollarStyles;
63
- /** UI slot overriding the per-adapter wallet button list (forwarded from provider props). */
64
- renderWallets?: RenderWalletsSlot;
65
46
  openTxModal: () => void;
66
47
  tx: TransactionState;
67
48
  buildTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<BuildOutcome>;
@@ -110,6 +91,20 @@ interface PollarContextValue {
110
91
  openWalletBalanceModal: () => void;
111
92
  openSendModal: () => void;
112
93
  openReceiveModal: () => void;
94
+ /**
95
+ * Quote an asset-to-asset swap across the requested venue(s). Read-only;
96
+ * returns quotes ranked best-first. Mirrors {@link PollarClient.getSwapQuote}.
97
+ */
98
+ getSwapQuote: (params: SwapQuoteParams) => Promise<SwapQuote[]>;
99
+ /**
100
+ * Execute a swap from a quote (establishes the buy-asset trustline first when
101
+ * needed). Drives the transaction state machine. Mirrors {@link PollarClient.swap}.
102
+ */
103
+ swap: (quote: SwapQuote, opts?: {
104
+ autoTrustline?: boolean;
105
+ }) => Promise<SubmitOutcome>;
106
+ /** Open the swap modal. */
107
+ openSwapModal: () => void;
113
108
  openDistributionRulesModal: () => void;
114
109
  adapters?: PollarAdapters;
115
110
  }
@@ -130,11 +125,6 @@ interface PollarProviderProps {
130
125
  * `/applications/config` on mount.
131
126
  */
132
127
  appConfig?: PollarConfig;
133
- /** UI customization slots. */
134
- ui?: {
135
- /** Replaces the default per-adapter wallet button list with a custom picker. */
136
- renderWallets?: RenderWalletsSlot;
137
- };
138
128
  adapters?: PollarAdapters;
139
129
  /**
140
130
  * Notified when persistent storage silently degrades to in-memory mode
@@ -148,7 +138,7 @@ interface PollarProviderProps {
148
138
  onStorageDegrade?: OnStorageDegrade;
149
139
  children: ReactNode;
150
140
  }
151
- declare function PollarProvider({ client, appConfig: appConfigProp, ui, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
141
+ declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
152
142
  declare function usePollar(): PollarContextValue;
153
143
 
154
144
  type WrappedAdapter<T extends PollarAdapter> = {
@@ -227,6 +217,11 @@ interface SendModalProps {
227
217
  }
228
218
  declare function SendModal({ onClose }: SendModalProps): react_jsx_runtime.JSX.Element;
229
219
 
220
+ interface SwapModalProps {
221
+ onClose: () => void;
222
+ }
223
+ declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
224
+
230
225
  interface ReceiveModalProps {
231
226
  onClose: () => void;
232
227
  }
@@ -247,6 +242,7 @@ type WalletAdapterEntry = {
247
242
  meta: {
248
243
  label: string;
249
244
  iconUrl?: string;
245
+ group?: string;
250
246
  };
251
247
  };
252
248
  interface LoginModalTemplateProps {
@@ -277,8 +273,6 @@ interface LoginModalTemplateProps {
277
273
  onLoginSmartWallet?: () => void;
278
274
  /** Create a new passkey + smart wallet (new user). */
279
275
  onCreateSmartWallet?: () => void;
280
- /** Optional override for the wallet picker view. Defaults to a Freighter+Albedo list. */
281
- renderWallets?: RenderWalletsSlot;
282
276
  authState: AuthState;
283
277
  codeInputKey?: number;
284
278
  onCodeSubmit?: (code: string) => void;
@@ -286,7 +280,7 @@ interface LoginModalTemplateProps {
286
280
  onCancel: () => void;
287
281
  onRetry: () => void;
288
282
  }
289
- declare function LoginModalTemplate({ theme, accentColor, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, renderWallets, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
283
+ declare function LoginModalTemplate({ theme, accentColor, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
290
284
 
291
285
  type KycStep = 'select_provider' | 'verifying' | 'polling' | 'done';
292
286
  interface KycModalTemplateProps {
@@ -304,7 +298,7 @@ interface KycModalTemplateProps {
304
298
  }
305
299
  declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
306
300
 
307
- type RampStep = 'input' | 'loading_quote' | 'select_route' | 'payment_instructions';
301
+ type RampStep = 'input' | 'loading_quote' | 'select_route' | 'status' | 'error';
308
302
  interface RampWidgetTemplateProps {
309
303
  theme: string;
310
304
  accentColor: string;
@@ -314,18 +308,26 @@ interface RampWidgetTemplateProps {
314
308
  currency: string;
315
309
  country: string;
316
310
  quotes: RampQuote[];
317
- paymentInstructions: PaymentInstructions | null;
318
311
  isLoading: boolean;
312
+ provider: string;
313
+ txStatus: RampTxStatus | null;
314
+ kycUrl: string | null;
315
+ stellarTxHash: string | null;
316
+ canComplete: boolean;
317
+ completing: boolean;
318
+ errorMsg: string | null;
319
319
  onDirectionChange: (d: RampDirection) => void;
320
320
  onAmountChange: (v: string) => void;
321
321
  onCurrencyChange: (v: string) => void;
322
322
  onCountryChange: (v: string) => void;
323
323
  onFindRoute: () => void;
324
324
  onSelectQuote: (q: RampQuote) => void;
325
- onCopy: (value: string) => void;
325
+ onOpenKyc: () => void;
326
+ onCompleteWithdraw: () => void;
327
+ onRetry: () => void;
326
328
  onClose: () => void;
327
329
  }
328
- declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, paymentInstructions, isLoading, onDirectionChange, onAmountChange, onCurrencyChange, onCountryChange, onFindRoute, onSelectQuote, onCopy, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
330
+ declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, isLoading, provider, txStatus, kycUrl, stellarTxHash, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onCurrencyChange, onCountryChange, onFindRoute, onSelectQuote, onOpenKyc, onCompleteWithdraw, onRetry, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
329
331
 
330
332
  interface TransactionModalTemplateProps {
331
333
  theme: string;
@@ -426,6 +428,53 @@ interface SendModalTemplateProps {
426
428
  }
427
429
  declare function SendModalTemplate({ theme, accentColor, step, txTitle, assets, selectedAsset, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onSelectAsset, onAmountChange, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
428
430
 
431
+ /** A selectable asset in the sell/buy pickers, normalized across balance/enabled records. */
432
+ interface SwapAssetOption {
433
+ ref: SwapQuoteParams['sellAsset'];
434
+ code: string;
435
+ issuer?: string | undefined;
436
+ available?: string | undefined;
437
+ enabledInApp?: boolean | undefined;
438
+ }
439
+ interface SwapModalTemplateProps {
440
+ theme: string;
441
+ accentColor: string;
442
+ step: 'form' | 'tx';
443
+ txTitle: string;
444
+ sellOptions: SwapAssetOption[];
445
+ buyOptions: SwapAssetOption[];
446
+ selectedSell: SwapAssetOption | null;
447
+ selectedBuy: SwapAssetOption | null;
448
+ amount: string;
449
+ provider: SwapProvider;
450
+ providers: SwapProvider[];
451
+ quote: SwapQuote | null;
452
+ quoteLoading: boolean;
453
+ quoteError: string;
454
+ formError: string;
455
+ isLoadingData: boolean;
456
+ smartUnsupported: boolean;
457
+ transaction: TransactionState;
458
+ showXdr: boolean;
459
+ copied: boolean;
460
+ explorerUrl: string | null;
461
+ walletType?: WalletId | null | undefined;
462
+ showBack: boolean;
463
+ isInProgress: boolean;
464
+ onClose: () => void;
465
+ onBack: () => void;
466
+ onSelectSell: (o: SwapAssetOption) => void;
467
+ onSelectBuy: (o: SwapAssetOption) => void;
468
+ onAmountChange: (value: string) => void;
469
+ onProviderChange: (p: SwapProvider) => void;
470
+ onSwap: () => void;
471
+ onToggleXdr: () => void;
472
+ onCopyHash: () => void;
473
+ onRetry: () => void;
474
+ onDone: () => void;
475
+ }
476
+ declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onSelectSell, onSelectBuy, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
477
+
429
478
  interface ReceiveModalTemplateProps {
430
479
  theme: string;
431
480
  accentColor: string;
@@ -462,4 +511,4 @@ interface DistributionRulesModalTemplateProps {
462
511
  }
463
512
  declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
464
513
 
465
- export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type PollarConfig, PollarProvider, type PollarStyles, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, type RenderWalletsProps, type RenderWalletsSlot, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, createPollarAdapterHook, usePollar };
514
+ export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type PollarConfig, PollarProvider, type PollarStyles, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, createPollarAdapterHook, usePollar };
package/dist/index.d.ts CHANGED
@@ -1,28 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { WalletId, AuthState, pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, PollarAdapter, KycStatus as KycStatus$1, RampQuote, KycProvider, KycStartResponse, RampDirection, PaymentInstructions, EnabledAssetRecord, WalletBalanceRecord, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapQuoteParams, SwapQuote, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampTxStatus, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
3
3
  export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  type ConfigResponse = pollarPaths['/applications/config']['get']['responses'][200]['content']['application/json'];
7
7
  type PollarConfig = ConfigResponse['content'];
8
8
  type PollarStyles = PollarConfig['styles'];
9
- /**
10
- * Props passed by `@pollar/react` to a `renderWallets` slot. External wallet
11
- * picker components receive these and call `onConnect(id)` when the user picks
12
- * a wallet; `@pollar/react` wraps that into `client.login({ provider: id })`.
13
- */
14
- interface RenderWalletsProps {
15
- /** Wrapper around `client.login({ provider: id })`. */
16
- onConnect: (id: WalletId) => void;
17
- /** Current auth state — picker can disable buttons / surface loading. */
18
- authState: AuthState;
19
- }
20
- /**
21
- * Signature for the `ui.renderWallets` slot on `<PollarProvider>`. When
22
- * provided, replaces the default Freighter/Albedo buttons in the LoginModal
23
- * with whatever the slot returns (typically a kit-powered wallet grid).
24
- */
25
- type RenderWalletsSlot = (props: RenderWalletsProps) => ReactNode;
26
9
  interface LoginButtonProps {
27
10
  onSuccess?: () => void;
28
11
  onError?: (error: Error) => void;
@@ -60,8 +43,6 @@ interface PollarContextValue {
60
43
  openSessionsModal: () => void;
61
44
  appConfig: PollarConfig;
62
45
  styles: PollarStyles;
63
- /** UI slot overriding the per-adapter wallet button list (forwarded from provider props). */
64
- renderWallets?: RenderWalletsSlot;
65
46
  openTxModal: () => void;
66
47
  tx: TransactionState;
67
48
  buildTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<BuildOutcome>;
@@ -110,6 +91,20 @@ interface PollarContextValue {
110
91
  openWalletBalanceModal: () => void;
111
92
  openSendModal: () => void;
112
93
  openReceiveModal: () => void;
94
+ /**
95
+ * Quote an asset-to-asset swap across the requested venue(s). Read-only;
96
+ * returns quotes ranked best-first. Mirrors {@link PollarClient.getSwapQuote}.
97
+ */
98
+ getSwapQuote: (params: SwapQuoteParams) => Promise<SwapQuote[]>;
99
+ /**
100
+ * Execute a swap from a quote (establishes the buy-asset trustline first when
101
+ * needed). Drives the transaction state machine. Mirrors {@link PollarClient.swap}.
102
+ */
103
+ swap: (quote: SwapQuote, opts?: {
104
+ autoTrustline?: boolean;
105
+ }) => Promise<SubmitOutcome>;
106
+ /** Open the swap modal. */
107
+ openSwapModal: () => void;
113
108
  openDistributionRulesModal: () => void;
114
109
  adapters?: PollarAdapters;
115
110
  }
@@ -130,11 +125,6 @@ interface PollarProviderProps {
130
125
  * `/applications/config` on mount.
131
126
  */
132
127
  appConfig?: PollarConfig;
133
- /** UI customization slots. */
134
- ui?: {
135
- /** Replaces the default per-adapter wallet button list with a custom picker. */
136
- renderWallets?: RenderWalletsSlot;
137
- };
138
128
  adapters?: PollarAdapters;
139
129
  /**
140
130
  * Notified when persistent storage silently degrades to in-memory mode
@@ -148,7 +138,7 @@ interface PollarProviderProps {
148
138
  onStorageDegrade?: OnStorageDegrade;
149
139
  children: ReactNode;
150
140
  }
151
- declare function PollarProvider({ client, appConfig: appConfigProp, ui, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
141
+ declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
152
142
  declare function usePollar(): PollarContextValue;
153
143
 
154
144
  type WrappedAdapter<T extends PollarAdapter> = {
@@ -227,6 +217,11 @@ interface SendModalProps {
227
217
  }
228
218
  declare function SendModal({ onClose }: SendModalProps): react_jsx_runtime.JSX.Element;
229
219
 
220
+ interface SwapModalProps {
221
+ onClose: () => void;
222
+ }
223
+ declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
224
+
230
225
  interface ReceiveModalProps {
231
226
  onClose: () => void;
232
227
  }
@@ -247,6 +242,7 @@ type WalletAdapterEntry = {
247
242
  meta: {
248
243
  label: string;
249
244
  iconUrl?: string;
245
+ group?: string;
250
246
  };
251
247
  };
252
248
  interface LoginModalTemplateProps {
@@ -277,8 +273,6 @@ interface LoginModalTemplateProps {
277
273
  onLoginSmartWallet?: () => void;
278
274
  /** Create a new passkey + smart wallet (new user). */
279
275
  onCreateSmartWallet?: () => void;
280
- /** Optional override for the wallet picker view. Defaults to a Freighter+Albedo list. */
281
- renderWallets?: RenderWalletsSlot;
282
276
  authState: AuthState;
283
277
  codeInputKey?: number;
284
278
  onCodeSubmit?: (code: string) => void;
@@ -286,7 +280,7 @@ interface LoginModalTemplateProps {
286
280
  onCancel: () => void;
287
281
  onRetry: () => void;
288
282
  }
289
- declare function LoginModalTemplate({ theme, accentColor, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, renderWallets, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
283
+ declare function LoginModalTemplate({ theme, accentColor, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
290
284
 
291
285
  type KycStep = 'select_provider' | 'verifying' | 'polling' | 'done';
292
286
  interface KycModalTemplateProps {
@@ -304,7 +298,7 @@ interface KycModalTemplateProps {
304
298
  }
305
299
  declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
306
300
 
307
- type RampStep = 'input' | 'loading_quote' | 'select_route' | 'payment_instructions';
301
+ type RampStep = 'input' | 'loading_quote' | 'select_route' | 'status' | 'error';
308
302
  interface RampWidgetTemplateProps {
309
303
  theme: string;
310
304
  accentColor: string;
@@ -314,18 +308,26 @@ interface RampWidgetTemplateProps {
314
308
  currency: string;
315
309
  country: string;
316
310
  quotes: RampQuote[];
317
- paymentInstructions: PaymentInstructions | null;
318
311
  isLoading: boolean;
312
+ provider: string;
313
+ txStatus: RampTxStatus | null;
314
+ kycUrl: string | null;
315
+ stellarTxHash: string | null;
316
+ canComplete: boolean;
317
+ completing: boolean;
318
+ errorMsg: string | null;
319
319
  onDirectionChange: (d: RampDirection) => void;
320
320
  onAmountChange: (v: string) => void;
321
321
  onCurrencyChange: (v: string) => void;
322
322
  onCountryChange: (v: string) => void;
323
323
  onFindRoute: () => void;
324
324
  onSelectQuote: (q: RampQuote) => void;
325
- onCopy: (value: string) => void;
325
+ onOpenKyc: () => void;
326
+ onCompleteWithdraw: () => void;
327
+ onRetry: () => void;
326
328
  onClose: () => void;
327
329
  }
328
- declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, paymentInstructions, isLoading, onDirectionChange, onAmountChange, onCurrencyChange, onCountryChange, onFindRoute, onSelectQuote, onCopy, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
330
+ declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, isLoading, provider, txStatus, kycUrl, stellarTxHash, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onCurrencyChange, onCountryChange, onFindRoute, onSelectQuote, onOpenKyc, onCompleteWithdraw, onRetry, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
329
331
 
330
332
  interface TransactionModalTemplateProps {
331
333
  theme: string;
@@ -426,6 +428,53 @@ interface SendModalTemplateProps {
426
428
  }
427
429
  declare function SendModalTemplate({ theme, accentColor, step, txTitle, assets, selectedAsset, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onSelectAsset, onAmountChange, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
428
430
 
431
+ /** A selectable asset in the sell/buy pickers, normalized across balance/enabled records. */
432
+ interface SwapAssetOption {
433
+ ref: SwapQuoteParams['sellAsset'];
434
+ code: string;
435
+ issuer?: string | undefined;
436
+ available?: string | undefined;
437
+ enabledInApp?: boolean | undefined;
438
+ }
439
+ interface SwapModalTemplateProps {
440
+ theme: string;
441
+ accentColor: string;
442
+ step: 'form' | 'tx';
443
+ txTitle: string;
444
+ sellOptions: SwapAssetOption[];
445
+ buyOptions: SwapAssetOption[];
446
+ selectedSell: SwapAssetOption | null;
447
+ selectedBuy: SwapAssetOption | null;
448
+ amount: string;
449
+ provider: SwapProvider;
450
+ providers: SwapProvider[];
451
+ quote: SwapQuote | null;
452
+ quoteLoading: boolean;
453
+ quoteError: string;
454
+ formError: string;
455
+ isLoadingData: boolean;
456
+ smartUnsupported: boolean;
457
+ transaction: TransactionState;
458
+ showXdr: boolean;
459
+ copied: boolean;
460
+ explorerUrl: string | null;
461
+ walletType?: WalletId | null | undefined;
462
+ showBack: boolean;
463
+ isInProgress: boolean;
464
+ onClose: () => void;
465
+ onBack: () => void;
466
+ onSelectSell: (o: SwapAssetOption) => void;
467
+ onSelectBuy: (o: SwapAssetOption) => void;
468
+ onAmountChange: (value: string) => void;
469
+ onProviderChange: (p: SwapProvider) => void;
470
+ onSwap: () => void;
471
+ onToggleXdr: () => void;
472
+ onCopyHash: () => void;
473
+ onRetry: () => void;
474
+ onDone: () => void;
475
+ }
476
+ declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onSelectSell, onSelectBuy, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
477
+
429
478
  interface ReceiveModalTemplateProps {
430
479
  theme: string;
431
480
  accentColor: string;
@@ -462,4 +511,4 @@ interface DistributionRulesModalTemplateProps {
462
511
  }
463
512
  declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
464
513
 
465
- export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type PollarConfig, PollarProvider, type PollarStyles, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, type RenderWalletsProps, type RenderWalletsSlot, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, createPollarAdapterHook, usePollar };
514
+ export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type PollarConfig, PollarProvider, type PollarStyles, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, createPollarAdapterHook, usePollar };