@pollar/react 0.10.1-rc.5 → 0.10.1-rc.7

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.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
  }
@@ -547,4 +583,4 @@ interface DistributionRulesModalTemplateProps {
547
583
  }
548
584
  declare function DistributionRulesModalTemplate({ theme, accentColor, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
549
585
 
550
- 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 };