@pollar/react 0.10.1-rc.4 → 0.10.1-rc.6
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 +100 -7
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +42 -4
- package/dist/index.d.ts +42 -4
- package/dist/index.js +802 -283
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +802 -284
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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, RampCountry, 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
|
}
|
|
@@ -334,6 +370,7 @@ interface RampWidgetTemplateProps {
|
|
|
334
370
|
provider: string;
|
|
335
371
|
txStatus: RampTxStatus | null;
|
|
336
372
|
kycUrl: string | null;
|
|
373
|
+
tosUrl: string | null;
|
|
337
374
|
stellarTxHash: string | null;
|
|
338
375
|
depositInstructions: Record<string, unknown> | null;
|
|
339
376
|
canComplete: boolean;
|
|
@@ -347,12 +384,13 @@ interface RampWidgetTemplateProps {
|
|
|
347
384
|
onSelectQuote: (q: RampQuote) => void;
|
|
348
385
|
onContactContinue: () => void;
|
|
349
386
|
onOpenKyc: () => void;
|
|
387
|
+
onOpenTos: () => void;
|
|
350
388
|
onCompleteWithdraw: () => void;
|
|
351
389
|
onRetry: () => void;
|
|
352
390
|
onRefresh: () => void;
|
|
353
391
|
onClose: () => void;
|
|
354
392
|
}
|
|
355
|
-
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, isLoading, provider, txStatus, kycUrl, stellarTxHash, depositInstructions, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onContactContinue, onOpenKyc, onCompleteWithdraw, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function RampWidgetTemplate({ theme, accentColor, step, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, isLoading, provider, txStatus, kycUrl, tosUrl, stellarTxHash, depositInstructions, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
356
394
|
|
|
357
395
|
interface TransactionModalTemplateProps {
|
|
358
396
|
theme: string;
|
|
@@ -545,4 +583,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
545
583
|
}
|
|
546
584
|
declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
547
585
|
|
|
548
|
-
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 };
|
|
586
|
+
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 };
|