@pollar/react 0.5.3 → 0.6.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.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { PollarApplicationConfigContent, PollarLoginOptions, PollarClientConfig, pollarPaths, PollarAdapters, PollarClient, TransactionState, TxBuildBody, WalletType, StellarNetwork, WalletBalanceState, TxHistoryState, EscrowAdapter, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, PaymentInstructions } from '@pollar/core';
2
+ import { PollarApplicationConfigContent, PollarLoginOptions, PollarClientConfig, pollarPaths, PollarAdapters, PollarClient, TransactionState, TxBuildBody, WalletType, StellarNetwork, WalletBalanceState, TxHistoryState, EscrowAdapter, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, PaymentInstructions, WalletBalanceRecord } from '@pollar/core';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  type ConfigResponse = pollarPaths['/applications/config']['get']['responses'][200]['content']['application/json'];
@@ -35,26 +35,28 @@ interface PollarContextValue {
35
35
  isAuthenticated: boolean;
36
36
  login: (options: PollarLoginOptions) => void;
37
37
  logout: () => void;
38
- config: PollarConfig;
38
+ appConfig: PollarConfig;
39
39
  styles: PollarStyles;
40
- openTransactionModal: () => void;
41
- transaction: TransactionState;
40
+ openTxModal: () => void;
41
+ tx: TransactionState;
42
42
  buildTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<void>;
43
43
  signAndSubmitTx: (unsignedXdr: string) => Promise<void>;
44
44
  walletType: WalletType | null;
45
45
  network: StellarNetwork;
46
46
  setNetwork: (network: StellarNetwork) => void;
47
47
  walletBalance: WalletBalanceState;
48
- refreshBalance: (publicKey?: string) => Promise<void>;
48
+ refreshWalletBalance: () => Promise<void>;
49
49
  openKycModal: (options?: {
50
50
  country?: string;
51
51
  level?: 'basic' | 'intermediate' | 'enhanced';
52
52
  onApproved?: () => void;
53
53
  }) => void;
54
- openRampWidget: () => void;
54
+ openRampModal: () => void;
55
55
  txHistory: TxHistoryState;
56
56
  openTxHistoryModal: () => void;
57
57
  openWalletBalanceModal: () => void;
58
+ openSendModal: () => void;
59
+ openReceiveModal: () => void;
58
60
  adapters?: PollarAdapters;
59
61
  }
60
62
  interface PollarProviderProps {
@@ -106,6 +108,16 @@ interface WalletBalanceModalProps {
106
108
  }
107
109
  declare function WalletBalanceModal({ onClose }: WalletBalanceModalProps): react_jsx_runtime.JSX.Element;
108
110
 
111
+ interface SendModalProps {
112
+ onClose: () => void;
113
+ }
114
+ declare function SendModal({ onClose }: SendModalProps): react_jsx_runtime.JSX.Element;
115
+
116
+ interface ReceiveModalProps {
117
+ onClose: () => void;
118
+ }
119
+ declare function ReceiveModal({ onClose }: ReceiveModalProps): react_jsx_runtime.JSX.Element;
120
+
109
121
  interface LoginModalTemplateProps {
110
122
  theme: string;
111
123
  accentColor: string;
@@ -190,6 +202,20 @@ interface TransactionModalTemplateProps {
190
202
  }
191
203
  declare function TransactionModalTemplate({ theme, accentColor, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
192
204
 
205
+ interface TxStatusViewProps {
206
+ transaction: TransactionState;
207
+ showXdr: boolean;
208
+ copied: boolean;
209
+ explorerUrl: string | null;
210
+ walletType?: WalletType | null | undefined;
211
+ onSignAndSend: () => void;
212
+ onToggleXdr: () => void;
213
+ onCopyHash: () => void;
214
+ onRetry?: (() => void) | undefined;
215
+ onDone: () => void;
216
+ }
217
+ declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
218
+
193
219
  interface TxHistoryModalTemplateProps {
194
220
  theme: string;
195
221
  accentColor: string;
@@ -212,4 +238,46 @@ interface WalletBalanceModalTemplateProps {
212
238
  }
213
239
  declare function WalletBalanceModalTemplate({ theme, accentColor, walletBalance, walletAddress, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
214
240
 
215
- export { type AuthContextValue, type AuthModalProps, type AuthProviderProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type PollarConfig, PollarProvider, type PollarStyles, type RampStep, RampWidget, RampWidgetTemplate, RouteDisplay, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, createPollarAdapterHook, usePollar };
241
+ interface SendModalTemplateProps {
242
+ theme: string;
243
+ accentColor: string;
244
+ step: 'form' | 'tx';
245
+ txTitle: string;
246
+ assets: WalletBalanceRecord[];
247
+ selectedAsset: WalletBalanceRecord | null;
248
+ amount: string;
249
+ destination: string;
250
+ formError: string;
251
+ isLoadingBalance: boolean;
252
+ transaction: TransactionState;
253
+ showXdr: boolean;
254
+ copied: boolean;
255
+ explorerUrl: string | null;
256
+ walletType?: WalletType | null | undefined;
257
+ showBack: boolean;
258
+ isInProgress: boolean;
259
+ onClose: () => void;
260
+ onBack: () => void;
261
+ onSelectAsset: (asset: WalletBalanceRecord) => void;
262
+ onAmountChange: (value: string) => void;
263
+ onDestinationChange: (value: string) => void;
264
+ onSubmit: () => void;
265
+ onSignAndSend: () => void;
266
+ onToggleXdr: () => void;
267
+ onCopyHash: () => void;
268
+ onRetry: () => void;
269
+ onDone: () => void;
270
+ }
271
+ 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;
272
+
273
+ interface ReceiveModalTemplateProps {
274
+ theme: string;
275
+ accentColor: string;
276
+ walletAddress: string;
277
+ copied: boolean;
278
+ onCopy: () => void;
279
+ onClose: () => void;
280
+ }
281
+ declare function ReceiveModalTemplate({ theme, accentColor, walletAddress, copied, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
282
+
283
+ export { type AuthContextValue, type AuthModalProps, type AuthProviderProps, 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, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, createPollarAdapterHook, usePollar };