@pollar/react 0.10.1-rc.0 → 0.10.1-rc.10
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/README.md +27 -27
- package/dist/index.css +278 -182
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +73 -9
- package/dist/index.d.ts +73 -9
- package/dist/index.js +1659 -516
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1659 -517
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampTxStatus, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, 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, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, 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
|
|
|
@@ -115,6 +115,33 @@ interface PollarContextValue {
|
|
|
115
115
|
}) => Promise<SubmitOutcome>;
|
|
116
116
|
/** Open the swap modal. */
|
|
117
117
|
openSwapModal: () => void;
|
|
118
|
+
/**
|
|
119
|
+
* The yield providers this app exposes to end-users (empty = Earn disabled,
|
|
120
|
+
* hide Earn UI). Mirrors {@link PollarClient.getEarnProviders}.
|
|
121
|
+
*/
|
|
122
|
+
getEarnProviders: () => Promise<EarnProviderId[]>;
|
|
123
|
+
/**
|
|
124
|
+
* The vaults (DeFindex) or pools (Blend) a provider exposes, with live APY.
|
|
125
|
+
* Mirrors {@link PollarClient.getEarnOpportunities}.
|
|
126
|
+
*/
|
|
127
|
+
getEarnOpportunities: (provider: EarnProviderId) => Promise<EarnOpportunity[]>;
|
|
128
|
+
/**
|
|
129
|
+
* The connected wallet's position (balance + APY) in a vault/pool. Read-only.
|
|
130
|
+
* Mirrors {@link PollarClient.getEarnPosition}.
|
|
131
|
+
*/
|
|
132
|
+
getEarnPosition: (params: EarnPositionParams) => Promise<EarnPosition>;
|
|
133
|
+
/**
|
|
134
|
+
* Deposit into a vault/pool (asset amount). Drives the transaction state
|
|
135
|
+
* machine. Mirrors {@link PollarClient.earnDeposit}.
|
|
136
|
+
*/
|
|
137
|
+
earnDeposit: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
138
|
+
/**
|
|
139
|
+
* Withdraw from a vault/pool (amount in the position `withdrawUnit`). Mirrors
|
|
140
|
+
* {@link PollarClient.earnWithdraw}.
|
|
141
|
+
*/
|
|
142
|
+
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
143
|
+
/** Open the Earn modal. */
|
|
144
|
+
openEarnModal: () => void;
|
|
118
145
|
openDistributionRulesModal: () => void;
|
|
119
146
|
adapters?: PollarAdapters;
|
|
120
147
|
}
|
|
@@ -169,7 +196,11 @@ interface WalletButtonTemplateProps {
|
|
|
169
196
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
170
197
|
isInProgress: boolean;
|
|
171
198
|
walletType: WalletId | null;
|
|
199
|
+
/** Show the "Create account" action (external wallet not yet on-chain, IMMEDIATE funding). */
|
|
200
|
+
showCreateAccount: boolean;
|
|
201
|
+
creatingAccount: boolean;
|
|
172
202
|
onToggleOpen: () => void;
|
|
203
|
+
onCreateAccount: () => void;
|
|
173
204
|
onCopy: () => void;
|
|
174
205
|
onWalletBalance: () => void;
|
|
175
206
|
onTxHistory: () => void;
|
|
@@ -182,7 +213,7 @@ interface WalletButtonTemplateProps {
|
|
|
182
213
|
onLogout: () => void;
|
|
183
214
|
onLogin: () => void;
|
|
184
215
|
}
|
|
185
|
-
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, onToggleOpen, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
186
217
|
|
|
187
218
|
interface KycModalProps {
|
|
188
219
|
onClose: () => void;
|
|
@@ -232,6 +263,11 @@ interface SwapModalProps {
|
|
|
232
263
|
}
|
|
233
264
|
declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
|
|
234
265
|
|
|
266
|
+
interface EarnModalProps {
|
|
267
|
+
onClose: () => void;
|
|
268
|
+
}
|
|
269
|
+
declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
270
|
+
|
|
235
271
|
interface ReceiveModalProps {
|
|
236
272
|
onClose: () => void;
|
|
237
273
|
}
|
|
@@ -304,11 +340,24 @@ interface KycModalTemplateProps {
|
|
|
304
340
|
isLoading: boolean;
|
|
305
341
|
onSelectProvider: (provider: KycProvider) => void;
|
|
306
342
|
onDoneVerifying: () => void;
|
|
343
|
+
onRefresh: () => void;
|
|
307
344
|
onClose: () => void;
|
|
308
345
|
}
|
|
309
|
-
declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
346
|
+
declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
310
347
|
|
|
311
|
-
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'status' | 'error';
|
|
348
|
+
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
|
|
349
|
+
/** A field a provider declares (via the quote) that the client must collect. */
|
|
350
|
+
interface RampFieldSpec {
|
|
351
|
+
key: string;
|
|
352
|
+
label: string;
|
|
353
|
+
type: 'text' | 'email' | 'tel' | 'select';
|
|
354
|
+
bankType?: 'CLABE' | 'PIX' | 'PSE' | 'ACH' | 'BREB';
|
|
355
|
+
/** For `type: 'select'` — dropdown choices (e.g. Stereum's Bolivian banks). */
|
|
356
|
+
options?: {
|
|
357
|
+
value: string;
|
|
358
|
+
label: string;
|
|
359
|
+
}[];
|
|
360
|
+
}
|
|
312
361
|
interface RampWidgetTemplateProps {
|
|
313
362
|
theme: string;
|
|
314
363
|
accentColor: string;
|
|
@@ -317,27 +366,39 @@ interface RampWidgetTemplateProps {
|
|
|
317
366
|
amount: string;
|
|
318
367
|
currency: string;
|
|
319
368
|
country: string;
|
|
369
|
+
requiredFields: RampFieldSpec[];
|
|
370
|
+
fieldValues: Record<string, string>;
|
|
371
|
+
countries: RampCountry[];
|
|
372
|
+
countriesLoading: boolean;
|
|
373
|
+
refreshing: boolean;
|
|
320
374
|
quotes: RampQuote[];
|
|
321
375
|
isLoading: boolean;
|
|
322
376
|
provider: string;
|
|
323
377
|
txStatus: RampTxStatus | null;
|
|
324
378
|
kycUrl: string | null;
|
|
379
|
+
tosUrl: string | null;
|
|
325
380
|
stellarTxHash: string | null;
|
|
381
|
+
/** Stellar Expert URL for `stellarTxHash` (network-aware); null when unknown. */
|
|
382
|
+
explorerUrl: string | null;
|
|
383
|
+
depositInstructions: Record<string, unknown> | null;
|
|
326
384
|
canComplete: boolean;
|
|
327
385
|
completing: boolean;
|
|
328
386
|
errorMsg: string | null;
|
|
329
387
|
onDirectionChange: (d: RampDirection) => void;
|
|
330
388
|
onAmountChange: (v: string) => void;
|
|
331
|
-
|
|
389
|
+
onFieldChange: (key: string, value: string) => void;
|
|
332
390
|
onCountryChange: (v: string) => void;
|
|
333
391
|
onFindRoute: () => void;
|
|
334
392
|
onSelectQuote: (q: RampQuote) => void;
|
|
393
|
+
onContactContinue: () => void;
|
|
335
394
|
onOpenKyc: () => void;
|
|
395
|
+
onOpenTos: () => void;
|
|
336
396
|
onCompleteWithdraw: () => void;
|
|
337
397
|
onRetry: () => void;
|
|
398
|
+
onRefresh: () => void;
|
|
338
399
|
onClose: () => void;
|
|
339
400
|
}
|
|
340
|
-
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, isLoading, provider, txStatus, kycUrl, stellarTxHash, canComplete, completing, errorMsg, onDirectionChange, onAmountChange,
|
|
401
|
+
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, isLoading, provider, txStatus, kycUrl, tosUrl, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
341
402
|
|
|
342
403
|
interface TransactionModalTemplateProps {
|
|
343
404
|
theme: string;
|
|
@@ -426,6 +487,7 @@ interface SendModalTemplateProps {
|
|
|
426
487
|
isInProgress: boolean;
|
|
427
488
|
onClose: () => void;
|
|
428
489
|
onBack: () => void;
|
|
490
|
+
onRefresh: () => void;
|
|
429
491
|
onSelectAsset: (asset: WalletBalanceRecord) => void;
|
|
430
492
|
onAmountChange: (value: string) => void;
|
|
431
493
|
onDestinationChange: (value: string) => void;
|
|
@@ -436,7 +498,7 @@ interface SendModalTemplateProps {
|
|
|
436
498
|
onRetry: () => void;
|
|
437
499
|
onDone: () => void;
|
|
438
500
|
}
|
|
439
|
-
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;
|
|
501
|
+
declare function SendModalTemplate({ theme, accentColor, step, txTitle, assets, selectedAsset, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
440
502
|
|
|
441
503
|
/** A selectable asset in the sell/buy pickers, normalized across balance/enabled records. */
|
|
442
504
|
interface SwapAssetOption {
|
|
@@ -482,6 +544,8 @@ interface SwapModalTemplateProps {
|
|
|
482
544
|
onRefresh: () => void;
|
|
483
545
|
onSelectSell: (o: SwapAssetOption) => void;
|
|
484
546
|
onSelectBuy: (o: SwapAssetOption) => void;
|
|
547
|
+
/** Add a user-pasted token (code + issuer) to the buy list. Returns an error or null. */
|
|
548
|
+
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
485
549
|
onAmountChange: (value: string) => void;
|
|
486
550
|
onProviderChange: (p: SwapProvider) => void;
|
|
487
551
|
onSwap: () => void;
|
|
@@ -490,7 +554,7 @@ interface SwapModalTemplateProps {
|
|
|
490
554
|
onRetry: () => void;
|
|
491
555
|
onDone: () => void;
|
|
492
556
|
}
|
|
493
|
-
declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
557
|
+
declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
494
558
|
|
|
495
559
|
interface ReceiveModalTemplateProps {
|
|
496
560
|
theme: string;
|
|
@@ -528,4 +592,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
528
592
|
}
|
|
529
593
|
declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
530
594
|
|
|
531
|
-
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 };
|
|
595
|
+
export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, 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,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampTxStatus, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, 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, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, WalletId, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, 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
|
|
|
@@ -115,6 +115,33 @@ interface PollarContextValue {
|
|
|
115
115
|
}) => Promise<SubmitOutcome>;
|
|
116
116
|
/** Open the swap modal. */
|
|
117
117
|
openSwapModal: () => void;
|
|
118
|
+
/**
|
|
119
|
+
* The yield providers this app exposes to end-users (empty = Earn disabled,
|
|
120
|
+
* hide Earn UI). Mirrors {@link PollarClient.getEarnProviders}.
|
|
121
|
+
*/
|
|
122
|
+
getEarnProviders: () => Promise<EarnProviderId[]>;
|
|
123
|
+
/**
|
|
124
|
+
* The vaults (DeFindex) or pools (Blend) a provider exposes, with live APY.
|
|
125
|
+
* Mirrors {@link PollarClient.getEarnOpportunities}.
|
|
126
|
+
*/
|
|
127
|
+
getEarnOpportunities: (provider: EarnProviderId) => Promise<EarnOpportunity[]>;
|
|
128
|
+
/**
|
|
129
|
+
* The connected wallet's position (balance + APY) in a vault/pool. Read-only.
|
|
130
|
+
* Mirrors {@link PollarClient.getEarnPosition}.
|
|
131
|
+
*/
|
|
132
|
+
getEarnPosition: (params: EarnPositionParams) => Promise<EarnPosition>;
|
|
133
|
+
/**
|
|
134
|
+
* Deposit into a vault/pool (asset amount). Drives the transaction state
|
|
135
|
+
* machine. Mirrors {@link PollarClient.earnDeposit}.
|
|
136
|
+
*/
|
|
137
|
+
earnDeposit: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
138
|
+
/**
|
|
139
|
+
* Withdraw from a vault/pool (amount in the position `withdrawUnit`). Mirrors
|
|
140
|
+
* {@link PollarClient.earnWithdraw}.
|
|
141
|
+
*/
|
|
142
|
+
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
143
|
+
/** Open the Earn modal. */
|
|
144
|
+
openEarnModal: () => void;
|
|
118
145
|
openDistributionRulesModal: () => void;
|
|
119
146
|
adapters?: PollarAdapters;
|
|
120
147
|
}
|
|
@@ -169,7 +196,11 @@ interface WalletButtonTemplateProps {
|
|
|
169
196
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
170
197
|
isInProgress: boolean;
|
|
171
198
|
walletType: WalletId | null;
|
|
199
|
+
/** Show the "Create account" action (external wallet not yet on-chain, IMMEDIATE funding). */
|
|
200
|
+
showCreateAccount: boolean;
|
|
201
|
+
creatingAccount: boolean;
|
|
172
202
|
onToggleOpen: () => void;
|
|
203
|
+
onCreateAccount: () => void;
|
|
173
204
|
onCopy: () => void;
|
|
174
205
|
onWalletBalance: () => void;
|
|
175
206
|
onTxHistory: () => void;
|
|
@@ -182,7 +213,7 @@ interface WalletButtonTemplateProps {
|
|
|
182
213
|
onLogout: () => void;
|
|
183
214
|
onLogin: () => void;
|
|
184
215
|
}
|
|
185
|
-
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, onToggleOpen, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
186
217
|
|
|
187
218
|
interface KycModalProps {
|
|
188
219
|
onClose: () => void;
|
|
@@ -232,6 +263,11 @@ interface SwapModalProps {
|
|
|
232
263
|
}
|
|
233
264
|
declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
|
|
234
265
|
|
|
266
|
+
interface EarnModalProps {
|
|
267
|
+
onClose: () => void;
|
|
268
|
+
}
|
|
269
|
+
declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
270
|
+
|
|
235
271
|
interface ReceiveModalProps {
|
|
236
272
|
onClose: () => void;
|
|
237
273
|
}
|
|
@@ -304,11 +340,24 @@ interface KycModalTemplateProps {
|
|
|
304
340
|
isLoading: boolean;
|
|
305
341
|
onSelectProvider: (provider: KycProvider) => void;
|
|
306
342
|
onDoneVerifying: () => void;
|
|
343
|
+
onRefresh: () => void;
|
|
307
344
|
onClose: () => void;
|
|
308
345
|
}
|
|
309
|
-
declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
346
|
+
declare function KycModalTemplate({ theme, accentColor, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
310
347
|
|
|
311
|
-
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'status' | 'error';
|
|
348
|
+
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
|
|
349
|
+
/** A field a provider declares (via the quote) that the client must collect. */
|
|
350
|
+
interface RampFieldSpec {
|
|
351
|
+
key: string;
|
|
352
|
+
label: string;
|
|
353
|
+
type: 'text' | 'email' | 'tel' | 'select';
|
|
354
|
+
bankType?: 'CLABE' | 'PIX' | 'PSE' | 'ACH' | 'BREB';
|
|
355
|
+
/** For `type: 'select'` — dropdown choices (e.g. Stereum's Bolivian banks). */
|
|
356
|
+
options?: {
|
|
357
|
+
value: string;
|
|
358
|
+
label: string;
|
|
359
|
+
}[];
|
|
360
|
+
}
|
|
312
361
|
interface RampWidgetTemplateProps {
|
|
313
362
|
theme: string;
|
|
314
363
|
accentColor: string;
|
|
@@ -317,27 +366,39 @@ interface RampWidgetTemplateProps {
|
|
|
317
366
|
amount: string;
|
|
318
367
|
currency: string;
|
|
319
368
|
country: string;
|
|
369
|
+
requiredFields: RampFieldSpec[];
|
|
370
|
+
fieldValues: Record<string, string>;
|
|
371
|
+
countries: RampCountry[];
|
|
372
|
+
countriesLoading: boolean;
|
|
373
|
+
refreshing: boolean;
|
|
320
374
|
quotes: RampQuote[];
|
|
321
375
|
isLoading: boolean;
|
|
322
376
|
provider: string;
|
|
323
377
|
txStatus: RampTxStatus | null;
|
|
324
378
|
kycUrl: string | null;
|
|
379
|
+
tosUrl: string | null;
|
|
325
380
|
stellarTxHash: string | null;
|
|
381
|
+
/** Stellar Expert URL for `stellarTxHash` (network-aware); null when unknown. */
|
|
382
|
+
explorerUrl: string | null;
|
|
383
|
+
depositInstructions: Record<string, unknown> | null;
|
|
326
384
|
canComplete: boolean;
|
|
327
385
|
completing: boolean;
|
|
328
386
|
errorMsg: string | null;
|
|
329
387
|
onDirectionChange: (d: RampDirection) => void;
|
|
330
388
|
onAmountChange: (v: string) => void;
|
|
331
|
-
|
|
389
|
+
onFieldChange: (key: string, value: string) => void;
|
|
332
390
|
onCountryChange: (v: string) => void;
|
|
333
391
|
onFindRoute: () => void;
|
|
334
392
|
onSelectQuote: (q: RampQuote) => void;
|
|
393
|
+
onContactContinue: () => void;
|
|
335
394
|
onOpenKyc: () => void;
|
|
395
|
+
onOpenTos: () => void;
|
|
336
396
|
onCompleteWithdraw: () => void;
|
|
337
397
|
onRetry: () => void;
|
|
398
|
+
onRefresh: () => void;
|
|
338
399
|
onClose: () => void;
|
|
339
400
|
}
|
|
340
|
-
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, quotes, isLoading, provider, txStatus, kycUrl, stellarTxHash, canComplete, completing, errorMsg, onDirectionChange, onAmountChange,
|
|
401
|
+
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, isLoading, provider, txStatus, kycUrl, tosUrl, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
341
402
|
|
|
342
403
|
interface TransactionModalTemplateProps {
|
|
343
404
|
theme: string;
|
|
@@ -426,6 +487,7 @@ interface SendModalTemplateProps {
|
|
|
426
487
|
isInProgress: boolean;
|
|
427
488
|
onClose: () => void;
|
|
428
489
|
onBack: () => void;
|
|
490
|
+
onRefresh: () => void;
|
|
429
491
|
onSelectAsset: (asset: WalletBalanceRecord) => void;
|
|
430
492
|
onAmountChange: (value: string) => void;
|
|
431
493
|
onDestinationChange: (value: string) => void;
|
|
@@ -436,7 +498,7 @@ interface SendModalTemplateProps {
|
|
|
436
498
|
onRetry: () => void;
|
|
437
499
|
onDone: () => void;
|
|
438
500
|
}
|
|
439
|
-
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;
|
|
501
|
+
declare function SendModalTemplate({ theme, accentColor, step, txTitle, assets, selectedAsset, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
440
502
|
|
|
441
503
|
/** A selectable asset in the sell/buy pickers, normalized across balance/enabled records. */
|
|
442
504
|
interface SwapAssetOption {
|
|
@@ -482,6 +544,8 @@ interface SwapModalTemplateProps {
|
|
|
482
544
|
onRefresh: () => void;
|
|
483
545
|
onSelectSell: (o: SwapAssetOption) => void;
|
|
484
546
|
onSelectBuy: (o: SwapAssetOption) => void;
|
|
547
|
+
/** Add a user-pasted token (code + issuer) to the buy list. Returns an error or null. */
|
|
548
|
+
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
485
549
|
onAmountChange: (value: string) => void;
|
|
486
550
|
onProviderChange: (p: SwapProvider) => void;
|
|
487
551
|
onSwap: () => void;
|
|
@@ -490,7 +554,7 @@ interface SwapModalTemplateProps {
|
|
|
490
554
|
onRetry: () => void;
|
|
491
555
|
onDone: () => void;
|
|
492
556
|
}
|
|
493
|
-
declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
557
|
+
declare function SwapModalTemplate({ theme, accentColor, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
494
558
|
|
|
495
559
|
interface ReceiveModalTemplateProps {
|
|
496
560
|
theme: string;
|
|
@@ -528,4 +592,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
528
592
|
}
|
|
529
593
|
declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
530
594
|
|
|
531
|
-
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 };
|
|
595
|
+
export { type AuthModalProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, 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 };
|