@pollar/react 0.11.4-rc.2 → 0.11.4
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 +9 -1
- package/dist/index.css +193 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +39 -5
- package/dist/index.d.ts +39 -5
- package/dist/index.js +1085 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1085 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -37,6 +37,14 @@ interface PollarContextValue {
|
|
|
37
37
|
getClient: () => PollarClient;
|
|
38
38
|
openLoginModal: () => void;
|
|
39
39
|
isAuthenticated: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the signed-in user has a wallet. False for an app that creates
|
|
42
|
+
* wallets on demand until {@link createWallet} runs, and always for one that
|
|
43
|
+
* creates none.
|
|
44
|
+
*/
|
|
45
|
+
hasWallet: boolean;
|
|
46
|
+
/** Create the signed-in user's wallet; see `PollarClient.createWallet`. */
|
|
47
|
+
createWallet: () => Promise<WalletInfo>;
|
|
40
48
|
/**
|
|
41
49
|
* `true` once the server has confirmed the session (login / refresh /
|
|
42
50
|
* `/auth/session/resume`). `false` while a cold-start session is still
|
|
@@ -167,6 +175,12 @@ interface PollarContextValue {
|
|
|
167
175
|
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
168
176
|
/** Open the Earn modal. */
|
|
169
177
|
openEarnModal: () => void;
|
|
178
|
+
/**
|
|
179
|
+
* Open the Cards modal: sign-up, identity verification, issuing, the card
|
|
180
|
+
* itself and its activity. The card calls live on {@link PollarClient}
|
|
181
|
+
* (`getCardProviders`, `issueCard`, `revealCardSecrets`, ...).
|
|
182
|
+
*/
|
|
183
|
+
openCardModal: () => void;
|
|
170
184
|
openDistributionRulesModal: () => void;
|
|
171
185
|
adapters?: PollarAdapters;
|
|
172
186
|
}
|
|
@@ -299,6 +313,16 @@ interface WalletButtonTemplateProps {
|
|
|
299
313
|
*/
|
|
300
314
|
notReadyReason?: string | null;
|
|
301
315
|
creatingAccount: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Signed in with no wallet yet (an app that creates wallets on demand, or
|
|
318
|
+
* none). The button then shows the account menu instead of Login, with Create
|
|
319
|
+
* wallet only when `onCreateWallet` is set. Optional, so a custom template
|
|
320
|
+
* written before this existed keeps compiling.
|
|
321
|
+
*/
|
|
322
|
+
signedIn?: boolean;
|
|
323
|
+
creatingWallet?: boolean;
|
|
324
|
+
createWalletError?: string | null;
|
|
325
|
+
onCreateWallet?: () => void;
|
|
302
326
|
onToggleOpen: () => void;
|
|
303
327
|
onCreateAccount: () => void;
|
|
304
328
|
onCopy: () => void;
|
|
@@ -313,7 +337,7 @@ interface WalletButtonTemplateProps {
|
|
|
313
337
|
onLogout: () => void;
|
|
314
338
|
onLogin: () => void;
|
|
315
339
|
}
|
|
316
|
-
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, notReadyReason, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
340
|
+
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, notReadyReason, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, onCreateWallet, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
317
341
|
|
|
318
342
|
/**
|
|
319
343
|
* The chain a record lives on, with the legacy shape folded in: sessions and
|
|
@@ -375,6 +399,8 @@ declare function useChains(): UseChainsResult;
|
|
|
375
399
|
|
|
376
400
|
interface KycModalProps {
|
|
377
401
|
corridorId?: string;
|
|
402
|
+
/** A card provider's steps, in place of a route's. */
|
|
403
|
+
cardProviderId?: string;
|
|
378
404
|
/** Open this option directly instead of listing the choices (the one a ramp's KYC gate names). */
|
|
379
405
|
providerId?: string;
|
|
380
406
|
onClose: () => void;
|
|
@@ -385,7 +411,7 @@ interface KycModalProps {
|
|
|
385
411
|
/** Called when KYC is successfully approved. */
|
|
386
412
|
onApproved?: () => void;
|
|
387
413
|
}
|
|
388
|
-
declare function KycModal({ onClose, country, level, onApproved, corridorId, providerId }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
389
415
|
|
|
390
416
|
interface RequirementFormModalProps {
|
|
391
417
|
formId: string;
|
|
@@ -419,7 +445,10 @@ interface RegistryCheckModalProps {
|
|
|
419
445
|
declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
|
|
420
446
|
|
|
421
447
|
interface ProviderRegistrationModalProps {
|
|
422
|
-
|
|
448
|
+
/** The route whose ramp the user registers with. */
|
|
449
|
+
corridorId?: string;
|
|
450
|
+
/** Or the card provider. One of the two. */
|
|
451
|
+
cardProviderId?: string;
|
|
423
452
|
/** Position of this step over the route's steps, when known. */
|
|
424
453
|
progress?: {
|
|
425
454
|
position: number;
|
|
@@ -433,7 +462,7 @@ interface ProviderRegistrationModalProps {
|
|
|
433
462
|
* One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
|
|
434
463
|
* user consents. Registering is the consent; nothing is sent until then.
|
|
435
464
|
*/
|
|
436
|
-
declare function ProviderRegistrationModal({ corridorId, progress, onClose, onRegistered }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
465
|
+
declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
437
466
|
|
|
438
467
|
interface KycStatusProps {
|
|
439
468
|
status: KycStatus$1;
|
|
@@ -483,6 +512,11 @@ interface EarnModalProps {
|
|
|
483
512
|
}
|
|
484
513
|
declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
485
514
|
|
|
515
|
+
interface CardModalProps {
|
|
516
|
+
onClose: () => void;
|
|
517
|
+
}
|
|
518
|
+
declare function CardModal({ onClose }: CardModalProps): react_jsx_runtime.JSX.Element;
|
|
519
|
+
|
|
486
520
|
interface ReceiveModalProps {
|
|
487
521
|
onClose: () => void;
|
|
488
522
|
}
|
|
@@ -1000,4 +1034,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1000
1034
|
}
|
|
1001
1035
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1002
1036
|
|
|
1003
|
-
export { type AuthModalProps, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|
|
1037
|
+
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ interface PollarContextValue {
|
|
|
37
37
|
getClient: () => PollarClient;
|
|
38
38
|
openLoginModal: () => void;
|
|
39
39
|
isAuthenticated: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the signed-in user has a wallet. False for an app that creates
|
|
42
|
+
* wallets on demand until {@link createWallet} runs, and always for one that
|
|
43
|
+
* creates none.
|
|
44
|
+
*/
|
|
45
|
+
hasWallet: boolean;
|
|
46
|
+
/** Create the signed-in user's wallet; see `PollarClient.createWallet`. */
|
|
47
|
+
createWallet: () => Promise<WalletInfo>;
|
|
40
48
|
/**
|
|
41
49
|
* `true` once the server has confirmed the session (login / refresh /
|
|
42
50
|
* `/auth/session/resume`). `false` while a cold-start session is still
|
|
@@ -167,6 +175,12 @@ interface PollarContextValue {
|
|
|
167
175
|
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
168
176
|
/** Open the Earn modal. */
|
|
169
177
|
openEarnModal: () => void;
|
|
178
|
+
/**
|
|
179
|
+
* Open the Cards modal: sign-up, identity verification, issuing, the card
|
|
180
|
+
* itself and its activity. The card calls live on {@link PollarClient}
|
|
181
|
+
* (`getCardProviders`, `issueCard`, `revealCardSecrets`, ...).
|
|
182
|
+
*/
|
|
183
|
+
openCardModal: () => void;
|
|
170
184
|
openDistributionRulesModal: () => void;
|
|
171
185
|
adapters?: PollarAdapters;
|
|
172
186
|
}
|
|
@@ -299,6 +313,16 @@ interface WalletButtonTemplateProps {
|
|
|
299
313
|
*/
|
|
300
314
|
notReadyReason?: string | null;
|
|
301
315
|
creatingAccount: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Signed in with no wallet yet (an app that creates wallets on demand, or
|
|
318
|
+
* none). The button then shows the account menu instead of Login, with Create
|
|
319
|
+
* wallet only when `onCreateWallet` is set. Optional, so a custom template
|
|
320
|
+
* written before this existed keeps compiling.
|
|
321
|
+
*/
|
|
322
|
+
signedIn?: boolean;
|
|
323
|
+
creatingWallet?: boolean;
|
|
324
|
+
createWalletError?: string | null;
|
|
325
|
+
onCreateWallet?: () => void;
|
|
302
326
|
onToggleOpen: () => void;
|
|
303
327
|
onCreateAccount: () => void;
|
|
304
328
|
onCopy: () => void;
|
|
@@ -313,7 +337,7 @@ interface WalletButtonTemplateProps {
|
|
|
313
337
|
onLogout: () => void;
|
|
314
338
|
onLogin: () => void;
|
|
315
339
|
}
|
|
316
|
-
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, notReadyReason, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
340
|
+
declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, notReadyReason, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, onCreateWallet, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
317
341
|
|
|
318
342
|
/**
|
|
319
343
|
* The chain a record lives on, with the legacy shape folded in: sessions and
|
|
@@ -375,6 +399,8 @@ declare function useChains(): UseChainsResult;
|
|
|
375
399
|
|
|
376
400
|
interface KycModalProps {
|
|
377
401
|
corridorId?: string;
|
|
402
|
+
/** A card provider's steps, in place of a route's. */
|
|
403
|
+
cardProviderId?: string;
|
|
378
404
|
/** Open this option directly instead of listing the choices (the one a ramp's KYC gate names). */
|
|
379
405
|
providerId?: string;
|
|
380
406
|
onClose: () => void;
|
|
@@ -385,7 +411,7 @@ interface KycModalProps {
|
|
|
385
411
|
/** Called when KYC is successfully approved. */
|
|
386
412
|
onApproved?: () => void;
|
|
387
413
|
}
|
|
388
|
-
declare function KycModal({ onClose, country, level, onApproved, corridorId, providerId }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
389
415
|
|
|
390
416
|
interface RequirementFormModalProps {
|
|
391
417
|
formId: string;
|
|
@@ -419,7 +445,10 @@ interface RegistryCheckModalProps {
|
|
|
419
445
|
declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
|
|
420
446
|
|
|
421
447
|
interface ProviderRegistrationModalProps {
|
|
422
|
-
|
|
448
|
+
/** The route whose ramp the user registers with. */
|
|
449
|
+
corridorId?: string;
|
|
450
|
+
/** Or the card provider. One of the two. */
|
|
451
|
+
cardProviderId?: string;
|
|
423
452
|
/** Position of this step over the route's steps, when known. */
|
|
424
453
|
progress?: {
|
|
425
454
|
position: number;
|
|
@@ -433,7 +462,7 @@ interface ProviderRegistrationModalProps {
|
|
|
433
462
|
* One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
|
|
434
463
|
* user consents. Registering is the consent; nothing is sent until then.
|
|
435
464
|
*/
|
|
436
|
-
declare function ProviderRegistrationModal({ corridorId, progress, onClose, onRegistered }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
465
|
+
declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
437
466
|
|
|
438
467
|
interface KycStatusProps {
|
|
439
468
|
status: KycStatus$1;
|
|
@@ -483,6 +512,11 @@ interface EarnModalProps {
|
|
|
483
512
|
}
|
|
484
513
|
declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
485
514
|
|
|
515
|
+
interface CardModalProps {
|
|
516
|
+
onClose: () => void;
|
|
517
|
+
}
|
|
518
|
+
declare function CardModal({ onClose }: CardModalProps): react_jsx_runtime.JSX.Element;
|
|
519
|
+
|
|
486
520
|
interface ReceiveModalProps {
|
|
487
521
|
onClose: () => void;
|
|
488
522
|
}
|
|
@@ -1000,4 +1034,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1000
1034
|
}
|
|
1001
1035
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1002
1036
|
|
|
1003
|
-
export { type AuthModalProps, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|
|
1037
|
+
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|