@getpara/react-sdk 1.3.0 → 1.3.1-dev.2
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/cli/cli.mjs +38 -0
- package/dist/index.js +5922 -157
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
- package/dist/modal/components/Controls/Selects.d.ts +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
- package/dist/modal/components/Footer/Footer.d.ts +1 -1
- package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
- package/dist/modal/components/common.d.ts +2 -2
- package/dist/modal/index.d.ts +0 -1
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/modal/useModalStore.d.ts +6 -3
- package/dist/modal/types/modalProps.d.ts +1 -27
- package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
- package/dist/modal/utils/openPopup.d.ts +1 -1
- package/dist/provider/ParaProvider.d.ts +3 -1
- package/dist/provider/actions/checkIfUserExists.d.ts +2 -7
- package/dist/provider/actions/createUser.d.ts +2 -10
- package/dist/provider/actions/getAccount.d.ts +9 -6
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/logout.d.ts +4 -1
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +1 -1
- package/dist/provider/components/CosmosWalletWrapper.d.ts +12 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +10 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +6 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +3 -2
- package/dist/provider/hooks/queries/useAccount.d.ts +4 -3
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useClient.d.ts +1 -1
- package/dist/provider/hooks/utils/useWalletState.d.ts +2 -2
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/{modal/providers/ExternalWalletContext.d.ts → provider/providers/ExternalWalletProvider.d.ts} +20 -29
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/index.d.ts +1 -0
- package/dist/provider/stores/types.d.ts +43 -1
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/provider.d.ts +115 -16
- package/dist/provider/types/utils.d.ts +1 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/package.json +29 -7
- package/dist/MoonPayEmbed-GAWXP6V7.js +0 -2
- package/dist/MoonPayEmbed-GAWXP6V7.js.br +0 -0
- package/dist/MoonPayEmbed-GAWXP6V7.js.gz +0 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -7
- package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -29
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -33
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -21
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -20
- package/dist/modal/stores/para/actions.d.ts +0 -3
- package/dist/modal/stores/para/useParaStore.d.ts +0 -10
- package/dist/modal/stores/theme/actions.d.ts +0 -3
- package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
|
@@ -2,5 +2,5 @@ interface AuthInputProps {
|
|
|
2
2
|
disableEmailLogin?: boolean;
|
|
3
3
|
disablePhoneLogin?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare const AuthInput: ({ disableEmailLogin, disablePhoneLogin }: AuthInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const AuthInput: ({ disableEmailLogin, disablePhoneLogin }: AuthInputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
export declare const useDropdownPosition: (inputRef: MutableRefObject<HTMLCpslInputElement | HTMLDivElement>) => {
|
|
3
|
-
dropdownMaxHeight: number;
|
|
4
|
-
dropdownWidth: number;
|
|
5
|
-
mobileAnchor: number;
|
|
2
|
+
export declare const useDropdownPosition: (inputRef: MutableRefObject<HTMLCpslInputElement | HTMLDivElement | null>) => {
|
|
3
|
+
dropdownMaxHeight: number | undefined;
|
|
4
|
+
dropdownWidth: number | undefined;
|
|
5
|
+
mobileAnchor: number | undefined;
|
|
6
6
|
resize: () => void;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ChainSwitch: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const ChainSwitch: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ChainSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const ChainSelect: () => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
export declare const AccountSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ExternalWalletStep: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const ExternalWalletStep: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Footer: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const Footer: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { WalletType } from '@getpara/web-sdk';
|
|
2
|
-
export declare const ExternalWalletCard: ({ address, showAddFunds }: Pick<SharedWalletCardProps, "address" | "showAddFunds">) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ExternalWalletCard: ({ address, showAddFunds }: Pick<SharedWalletCardProps, "address" | "showAddFunds">) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
interface WalletCardProps {
|
|
4
4
|
id: string;
|
|
5
5
|
type: WalletType;
|
|
6
6
|
showAddFunds?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const WalletCard: ({ id, type, showAddFunds }: WalletCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const WalletCard: ({ id, type, showAddFunds }: WalletCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
interface SharedWalletCardProps {
|
|
10
10
|
address: string;
|
|
11
11
|
id?: string;
|
|
@@ -8,12 +8,12 @@ export declare const FullWidthFilledDisabledInput: typeof CpslInput;
|
|
|
8
8
|
export declare const CenteredText: typeof CpslText;
|
|
9
9
|
export declare const InnerStepContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
10
|
export declare const StepContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
|
|
11
|
-
ref?: import("react").
|
|
11
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
$wide?: boolean;
|
|
14
14
|
}>> & string;
|
|
15
15
|
export declare const Heading: typeof CpslText;
|
|
16
16
|
export declare const StyledCpslTileButton: typeof CpslTileButton;
|
|
17
17
|
export declare const HeroIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>, "ref"> & {
|
|
18
|
-
ref?: import("react").
|
|
18
|
+
ref?: ((instance: HTMLCpslIconElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLCpslIconElement> | null | undefined;
|
|
19
19
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("@getpara/core-components").JSX.CpslIcon & Omit<import("react").HTMLAttributes<HTMLCpslIconElement>, "style"> & import("@getpara/react-components/dist/types/components/stencil-generated/react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLCpslIconElement>>, keyof import("react").Component<any, {}, any>>;
|
package/dist/modal/index.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export { ON_RAMP_PROVIDERS, ON_RAMP_ASSETS, NETWORKS, getAssetIcon, getAssetName
|
|
|
7
7
|
export { SaveRecoverySecret } from './components/RecoverySecretStep/RecoverySecretStep.js';
|
|
8
8
|
export * from './utils/validateOnRampConfig.js';
|
|
9
9
|
export * from './types/externalWallets.js';
|
|
10
|
-
export { useExternalWalletProviderStore } from './stores/externalWalletProvider/useExternalWalletProviderStore.js';
|
|
@@ -3,6 +3,7 @@ import { OnRampConfig as OnRampConfigBase, OnRampPurchase, WalletType } from '@g
|
|
|
3
3
|
import { Tab as AddFundsTabType } from '../../components/AddFunds/AddFunds.js';
|
|
4
4
|
import { AuthMethod } from '@getpara/core-sdk';
|
|
5
5
|
import { BiometricLocationHint } from '@getpara/user-management-client';
|
|
6
|
+
import { TAuthLayout } from '../../types/modalProps.js';
|
|
6
7
|
type Flow = 'login' | 'signUp' | 'account';
|
|
7
8
|
type ActiveWallet = [string | undefined, WalletType | undefined];
|
|
8
9
|
export type OnRampConfig = OnRampConfigBase & {
|
|
@@ -21,7 +22,7 @@ interface ModalState {
|
|
|
21
22
|
webAuthURLForCreate: string | undefined;
|
|
22
23
|
passwordUrlForLogin: string | undefined;
|
|
23
24
|
supportedAuthMethods: Set<AuthMethod>;
|
|
24
|
-
onModalStepChange
|
|
25
|
+
onModalStepChange?: (value: OnModalStepChangeValue) => void | undefined;
|
|
25
26
|
onRampConfig: OnRampConfig | undefined;
|
|
26
27
|
onRampPurchase: Partial<OnRampPurchase> | undefined;
|
|
27
28
|
popupWindow: Window | undefined;
|
|
@@ -36,6 +37,7 @@ interface ModalState {
|
|
|
36
37
|
biometricLocationHints: BiometricLocationHint[] | undefined;
|
|
37
38
|
iFrameUrl: string | undefined;
|
|
38
39
|
isIFrameReady: boolean | undefined;
|
|
40
|
+
authLayout?: TAuthLayout[];
|
|
39
41
|
}
|
|
40
42
|
export interface ModalActions {
|
|
41
43
|
resetState: () => void;
|
|
@@ -49,12 +51,12 @@ export interface ModalActions {
|
|
|
49
51
|
setWebAuthURLForLogin: (url?: string) => void;
|
|
50
52
|
setWebAuthURLForCreate: (url?: string) => void;
|
|
51
53
|
setPasswordUrlForLogin: (url?: string) => void;
|
|
52
|
-
setOnModalStepChange: (fn
|
|
54
|
+
setOnModalStepChange: (fn?: (value: OnModalStepChangeValue) => void) => void;
|
|
53
55
|
setOnRampConfig: (_: OnRampConfig | undefined) => void;
|
|
54
56
|
setOnRampPurchase: (_: Partial<OnRampPurchase> | undefined) => void;
|
|
55
57
|
setPopupWindow: (_: Window | undefined) => void;
|
|
56
58
|
setIsFullyLoggedIn: (isFullyLoggedIn: boolean) => void;
|
|
57
|
-
setAccountAddFundTab: (accountAddFundTab
|
|
59
|
+
setAccountAddFundTab: (accountAddFundTab?: AddFundsTabType) => void;
|
|
58
60
|
setSelectedExternalWalletId: (id?: string) => void;
|
|
59
61
|
setIsUsingMobileConnector: (isUsingMobileConnector?: boolean) => void;
|
|
60
62
|
setIsExternalWalletConnecting: (isExternalWalletConnecting: boolean) => void;
|
|
@@ -64,6 +66,7 @@ export interface ModalActions {
|
|
|
64
66
|
setBiometricLocationHints: (_?: BiometricLocationHint[]) => void;
|
|
65
67
|
setIFrameUrl: (_?: string) => void;
|
|
66
68
|
setIsIFrameReady: (_?: boolean) => void;
|
|
69
|
+
setAuthLayout: (authLayout: TAuthLayout[]) => void;
|
|
67
70
|
}
|
|
68
71
|
export type ModalStore = ModalState & ModalActions;
|
|
69
72
|
export declare const DEFAULT_MODAL_STATE: Omit<ModalState, 'step' | 'onRampConfig'>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import ParaWeb, { CurrentWalletIds, OAuthMethod
|
|
1
|
+
import ParaWeb, { CurrentWalletIds, OAuthMethod } from '@getpara/web-sdk';
|
|
2
2
|
import { Theme } from '@getpara/react-components';
|
|
3
3
|
import { OnModalStepChangeValue } from '../stores/index.js';
|
|
4
4
|
import { ModalStep, ModalStepProp } from '../utils/steps.js';
|
|
5
|
-
import { TExternalWallet } from './externalWallets.js';
|
|
6
5
|
export type ParaModalHandle = {
|
|
7
6
|
/**
|
|
8
7
|
* Move the modal backward
|
|
@@ -33,10 +32,6 @@ export declare enum AuthLayout {
|
|
|
33
32
|
}
|
|
34
33
|
export type TAuthLayout = `${AuthLayout}`;
|
|
35
34
|
export interface ParaModalProps {
|
|
36
|
-
/**
|
|
37
|
-
* Your ParaWeb instance.
|
|
38
|
-
*/
|
|
39
|
-
para?: ParaWeb;
|
|
40
35
|
/**
|
|
41
36
|
* Whether or not the modal is open.
|
|
42
37
|
*/
|
|
@@ -74,21 +69,6 @@ export interface ParaModalProps {
|
|
|
74
69
|
* Logo to be shown throughout the modal.
|
|
75
70
|
*/
|
|
76
71
|
logo?: string;
|
|
77
|
-
/**
|
|
78
|
-
* App name to be shown throughout the modal.
|
|
79
|
-
*/
|
|
80
|
-
appName?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Configure on-ramp providers to allow users to add funds upon signing up.
|
|
83
|
-
* @deprecated Configure on-ramps in the Para Developer Portal.
|
|
84
|
-
*/
|
|
85
|
-
onRampConfig?: deprecated__OnRampConfig;
|
|
86
|
-
/**
|
|
87
|
-
* Configures which EVM networks your app supports, an array of one or more of `["ETHEREUM", "ARBITRUM", "BASE", "OPTIMISM", and "POLYGON"]`.
|
|
88
|
-
* Defaults to `["ETHEREUM"]`.
|
|
89
|
-
* @deprecated Configure this setting in the Para Developer Portal.
|
|
90
|
-
*/
|
|
91
|
-
networks?: deprecated__NetworkProp[];
|
|
92
72
|
/**
|
|
93
73
|
* Whether or not to run configured on-ramp providers in test mode.
|
|
94
74
|
*/
|
|
@@ -110,12 +90,6 @@ export interface ParaModalProps {
|
|
|
110
90
|
*/
|
|
111
91
|
embeddedModal?: boolean;
|
|
112
92
|
className?: string;
|
|
113
|
-
/**
|
|
114
|
-
* Which external wallets to show and in what order they should be displayed.
|
|
115
|
-
*
|
|
116
|
-
* NOTE: Any wallets that are detected as installed will be sorted first, followed by those that are not detected or not installed.
|
|
117
|
-
*/
|
|
118
|
-
externalWallets?: TExternalWallet[];
|
|
119
93
|
/**
|
|
120
94
|
* How the modal should order the components on the main auth screen.
|
|
121
95
|
* Only the first method of each type (auth or external) will be used.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TAuthLayout } from '../types/modalProps.js';
|
|
2
|
-
export declare const hasExternalWallet: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED";
|
|
3
|
-
export declare const hasEmbeddedAuth: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED";
|
|
2
|
+
export declare const hasExternalWallet: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED" | undefined;
|
|
3
|
+
export declare const hasEmbeddedAuth: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getTileButtonFlex: (index: number, totalItems: number) => "1 1 auto" | "0 0 calc(33.333333% - 5.336px)" | "0 0 calc(50% - 4px)";
|
|
1
|
+
export declare const getTileButtonFlex: (index: number, totalItems: number) => "1 1 auto" | "0 0 calc(33.333333% - 5.336px)" | "0 0 calc(50% - 4px)" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function openPopup(popupUrl: string, target: string, type: 'OAUTH' | 'LOGIN_PASSKEY' | 'CREATE_PASSKEY' | 'TRANSACTION_REVIEW' | 'CREATE_PASSWORD' | 'LOGIN_PASSWORD'): Window;
|
|
1
|
+
export declare function openPopup(popupUrl: string, target: string, type: 'OAUTH' | 'LOGIN_PASSKEY' | 'CREATE_PASSKEY' | 'TRANSACTION_REVIEW' | 'CREATE_PASSWORD' | 'LOGIN_PASSWORD'): Window | undefined;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { ParaProviderProps } from './types/provider.js';
|
|
2
|
-
|
|
2
|
+
import { Chain, Transport } from 'viem';
|
|
3
|
+
import { ParaModalHandle } from '../modal/index.js';
|
|
4
|
+
export declare const ParaProvider: import("react").ForwardRefExoticComponent<ParaProviderProps<readonly [Chain, ...Chain[]], Record<number, Transport>> & import("react").RefAttributes<ParaModalHandle>>;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { CountryCallingCode } from 'libphonenumber-js';
|
|
2
|
-
import { CreateUserType } from './createUser.js';
|
|
3
1
|
import ParaWeb from '@getpara/web-sdk';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
identifier: string;
|
|
7
|
-
countryCode?: CountryCallingCode;
|
|
8
|
-
}
|
|
2
|
+
import { Auth } from '@getpara/user-management-client';
|
|
3
|
+
export type CheckIfUserExistsArgs = Auth<'email'> | Auth<'phone'>;
|
|
9
4
|
export declare const checkIfUserExists: (para?: ParaWeb, args?: CheckIfUserExistsArgs) => Promise<boolean>;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
+
import { Auth } from '@getpara/user-management-client';
|
|
1
2
|
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
|
|
3
|
-
export declare enum CreateUserType {
|
|
4
|
-
EMAIL = "EMAIL",
|
|
5
|
-
PHONE = "PHONE"
|
|
6
|
-
}
|
|
7
|
-
export interface CreateUserArgs {
|
|
8
|
-
type: CreateUserType;
|
|
9
|
-
identifier: string;
|
|
10
|
-
countryCode?: CountryCallingCode;
|
|
11
|
-
}
|
|
3
|
+
export type CreateUserArgs = Auth<'email'> | Auth<'phone'>;
|
|
12
4
|
export declare const createUser: (para?: ParaWeb, args?: CreateUserArgs) => Promise<void>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
|
|
1
|
+
import ParaWeb, { Wallet } from '@getpara/web-sdk';
|
|
2
|
+
type AccountType = {
|
|
3
3
|
isConnected: boolean;
|
|
4
|
-
email
|
|
5
|
-
phone
|
|
6
|
-
wallets
|
|
7
|
-
|
|
4
|
+
email?: string;
|
|
5
|
+
phone?: string;
|
|
6
|
+
wallets?: Record<string, Wallet>;
|
|
7
|
+
userId?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const getAccount: (para?: ParaWeb) => Promise<AccountType>;
|
|
10
|
+
export {};
|
|
@@ -2,4 +2,4 @@ import ParaWeb, { WalletType } from '@getpara/web-sdk';
|
|
|
2
2
|
export declare const getWallet: (para?: ParaWeb, selectedWallet?: {
|
|
3
3
|
id?: string;
|
|
4
4
|
type?: WalletType;
|
|
5
|
-
}) => Promise<Omit<import("@getpara/web-sdk").Wallet, "signer"
|
|
5
|
+
}) => Promise<Omit<import("@getpara/web-sdk").Wallet, "signer"> | null | undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ParaWeb from '@getpara/web-sdk';
|
|
2
2
|
export interface WaitForLoginAndSetupArgs {
|
|
3
|
-
|
|
3
|
+
popupWindow?: Window;
|
|
4
4
|
skipSessionRefresh?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const waitForLoginAndSetup: (para?: ParaWeb, args?: WaitForLoginAndSetupArgs) => Promise<import("@getpara/web-sdk").LoginResponse>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ParaCosmosProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
3
|
+
import { ParaGrazProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
4
|
+
export declare const CosmosWalletWrapper: ({ children, cosmosConnectorConfig, grazProviderProps, projectId, onSwitchWallet, }: {
|
|
5
|
+
cosmosConnectorConfig?: ParaCosmosProviderConfigNoWallets;
|
|
6
|
+
grazProviderProps: ParaGrazProviderProps;
|
|
7
|
+
projectId?: string;
|
|
8
|
+
onSwitchWallet: ({ address, error }: {
|
|
9
|
+
address?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
} & PropsWithChildren) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Chain, Transport } from 'viem';
|
|
3
|
+
import { ParaEvmProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
4
|
+
import { ParaWagmiProviderProps } from '@getpara/evm-wallet-connectors';
|
|
5
|
+
export declare const EvmWalletWrapper: <chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]["id"], Transport>>({ children, evmProviderConfig, wagmiProviderProps, onSwitchWallet, }: {
|
|
6
|
+
evmProviderConfig?: ParaEvmProviderConfigNoWallets<chains, transports>;
|
|
7
|
+
wagmiProviderProps: ParaWagmiProviderProps;
|
|
8
|
+
onSwitchWallet: ({ address, error }: {
|
|
9
|
+
address?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
} & PropsWithChildren) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ExternalWalletConfig } from '../types/provider.js';
|
|
3
|
+
import { Chain, Transport } from 'viem';
|
|
4
|
+
interface ExternalWalletWrapperProps<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> extends PropsWithChildren {
|
|
5
|
+
config?: Omit<ExternalWalletConfig<chains, transports>, 'wallets'>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ExternalWalletWrapper: <chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]["id"], Transport>>({ children, config, }: ExternalWalletWrapperProps<chains, transports>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ParaSolanaProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
3
|
+
export declare const SolanaWalletWrapper: ({ children, solanaProviderConfig, onSwitchWallet, }: {
|
|
4
|
+
solanaProviderConfig?: ParaSolanaProviderConfigNoWallets;
|
|
5
|
+
onSwitchWallet: ({ address, error }: {
|
|
6
|
+
address?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
} & PropsWithChildren) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { CosmosExternalWalletContextType, ParaCosmosProvider, WalletList } from '@getpara/cosmos-wallet-connectors';
|
|
3
|
+
export declare const getParaCosmosConnector: () => Promise<{
|
|
4
|
+
Provider: typeof ParaCosmosProvider | undefined;
|
|
5
|
+
context: Context<CosmosExternalWalletContextType>;
|
|
6
|
+
wallets: WalletList;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { EvmExternalWalletContextType, ParaEvmProvider, WalletList } from '@getpara/evm-wallet-connectors';
|
|
3
|
+
export declare const getParaEvmConnector: () => Promise<{
|
|
4
|
+
Provider: typeof ParaEvmProvider | undefined;
|
|
5
|
+
context: Context<EvmExternalWalletContextType>;
|
|
6
|
+
wallets: WalletList;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { ParaSolanaProvider, SolanaExternalWalletContextType, WalletList } from '@getpara/solana-wallet-connectors';
|
|
3
|
+
export declare const getParaSolanaConnector: () => Promise<{
|
|
4
|
+
Provider: typeof ParaSolanaProvider | undefined;
|
|
5
|
+
context: Context<SolanaExternalWalletContextType>;
|
|
6
|
+
wallets: WalletList;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CosmosExternalWalletContextType } from '@getpara/cosmos-wallet-connectors';
|
|
2
|
+
export declare const defaultCosmosExternalWallet: {
|
|
3
|
+
wallets: never[];
|
|
4
|
+
chains: never[];
|
|
5
|
+
chainId: undefined;
|
|
6
|
+
disconnect: () => Promise<void>;
|
|
7
|
+
switchChain: () => Promise<{}>;
|
|
8
|
+
connectParaEmbedded: () => Promise<{}>;
|
|
9
|
+
};
|
|
10
|
+
export declare const CosmosExternalWalletContext: import("react").Context<CosmosExternalWalletContextType>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolanaExternalWalletContextType } from '@getpara/solana-wallet-connectors';
|
|
2
|
+
export declare const defaultSolanaExternalWallet: {
|
|
3
|
+
wallets: never[];
|
|
4
|
+
disconnect: () => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare const SolanaExternalWalletContext: import("react").Context<SolanaExternalWalletContextType>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { LogoutArgs } from '../../actions/logout.js';
|
|
2
3
|
import { Compute } from '../../types/utils.js';
|
|
3
4
|
import { UseMutationReturnType } from '../../types/query.js';
|
|
4
|
-
type UseLogoutReturnType<TData = void, TError = Error, TVariables =
|
|
5
|
+
type UseLogoutReturnType<TData = void, TError = Error, TVariables = LogoutArgs | undefined, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
5
6
|
logout: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
6
7
|
logoutAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
7
8
|
}>;
|
|
8
9
|
/**
|
|
9
10
|
* Hook for logging out a user
|
|
10
11
|
*/
|
|
11
|
-
export declare const useLogout: () => UseLogoutReturnType<void, Error,
|
|
12
|
+
export declare const useLogout: () => UseLogoutReturnType<void, Error, LogoutArgs | undefined, unknown>;
|
|
12
13
|
export {};
|
|
@@ -4,7 +4,8 @@ export declare const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<{
|
|
6
6
|
isConnected: boolean;
|
|
7
|
-
email
|
|
8
|
-
phone
|
|
9
|
-
wallets
|
|
7
|
+
email?: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
wallets?: Record<string, import("@getpara/core-sdk").Wallet>;
|
|
10
|
+
userId?: string;
|
|
10
11
|
}, Error>;
|
|
@@ -2,4 +2,4 @@ export declare const WALLET_BASE_KEY = "PARA_WALLET";
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook for retrieving the selected wallet
|
|
4
4
|
*/
|
|
5
|
-
export declare const useWallet: () => import("@tanstack/react-query").UseQueryResult<Omit<import("@getpara/core-sdk").Wallet, "signer"
|
|
5
|
+
export declare const useWallet: () => import("@tanstack/react-query").UseQueryResult<Omit<import("@getpara/core-sdk").Wallet, "signer"> | null | undefined, Error>;
|
|
@@ -4,8 +4,8 @@ import { WalletType } from '@getpara/web-sdk';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const useWalletState: () => {
|
|
6
6
|
selectedWallet: {
|
|
7
|
-
id: string;
|
|
8
|
-
type: WalletType;
|
|
7
|
+
id: string | undefined;
|
|
8
|
+
type: WalletType | undefined;
|
|
9
9
|
};
|
|
10
10
|
setSelectedWallet: ({ id, type }: {
|
|
11
11
|
id?: string;
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ExternalWalletProviderCommon, ParaCosmosProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
3
|
+
import { ParaCosmosProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
4
|
+
export declare function CosmosExternalWalletProvider({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaCosmosProviderProps, 'config'> & {
|
|
5
|
+
config: ParaCosmosProviderConfigNoWallets;
|
|
6
|
+
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
+
export declare const MemoizedCosmosExternalWalletProvider: import("react").MemoExoticComponent<typeof CosmosExternalWalletProvider>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ParaEvmProviderProps } from '@getpara/evm-wallet-connectors';
|
|
3
|
+
import { Chain, Transport } from 'viem';
|
|
4
|
+
import { ExternalWalletProviderCommon, ParaEvmProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
5
|
+
export declare function EvmExternalWalletProvider<const chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>>({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaEvmProviderProps<chains, transports>, 'config'> & {
|
|
6
|
+
config: ParaEvmProviderConfigNoWallets<chains, transports>;
|
|
7
|
+
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonChain, CommonWallet } from '
|
|
3
|
-
import { EvmExternalWalletContextType } from './EvmExternalWalletContextStub.js';
|
|
4
|
-
import { TExternalWallet } from '../types/externalWallets.js';
|
|
5
|
-
import { SolanaExternalWalletContextType } from './SolanaExternalWalletContextStub.js';
|
|
6
|
-
import { CosmosExternalWalletContextType } from './CosmosExternalWalletContextStub.js';
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { CommonChain, CommonWallet } from '../../modal/types/commonTypes.js';
|
|
7
3
|
export declare const defaultExternalWallet: {
|
|
8
|
-
wallets:
|
|
9
|
-
chains:
|
|
10
|
-
chainId:
|
|
11
|
-
wallet:
|
|
12
|
-
qrUri:
|
|
13
|
-
chainIdSwitchingTo:
|
|
4
|
+
wallets: never[];
|
|
5
|
+
chains: never[];
|
|
6
|
+
chainId: undefined;
|
|
7
|
+
wallet: undefined;
|
|
8
|
+
qrUri: undefined;
|
|
9
|
+
chainIdSwitchingTo: undefined;
|
|
14
10
|
walletDisplayHelpers: {
|
|
15
11
|
showExtension: boolean;
|
|
16
12
|
showMobile: boolean;
|
|
17
13
|
isSolanaMobileIOS: boolean;
|
|
18
14
|
isCosmosMobileWallet: boolean;
|
|
19
15
|
};
|
|
20
|
-
username:
|
|
21
|
-
avatar:
|
|
22
|
-
connectExternalWallet: () => void
|
|
16
|
+
username: undefined;
|
|
17
|
+
avatar: undefined;
|
|
18
|
+
connectExternalWallet: () => Promise<void>;
|
|
23
19
|
disconnectExternalWallet: () => Promise<void>;
|
|
24
20
|
switchChain: () => Promise<void>;
|
|
25
21
|
setChainIdSwitchingTo: () => void;
|
|
22
|
+
connectEmbeddedToExternalConnectors: () => Promise<void>;
|
|
26
23
|
};
|
|
27
|
-
export declare const ExternalWalletContext: Context<{
|
|
24
|
+
export declare const ExternalWalletContext: import("react").Context<{
|
|
28
25
|
wallets: CommonWallet[];
|
|
29
26
|
chains: CommonChain[];
|
|
30
|
-
chainId
|
|
27
|
+
chainId?: string;
|
|
31
28
|
wallet?: CommonWallet;
|
|
32
29
|
qrUri?: string;
|
|
33
30
|
chainIdSwitchingTo?: string;
|
|
@@ -39,23 +36,17 @@ export declare const ExternalWalletContext: Context<{
|
|
|
39
36
|
};
|
|
40
37
|
username?: string;
|
|
41
38
|
avatar?: string;
|
|
42
|
-
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => void
|
|
39
|
+
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => Promise<void>;
|
|
43
40
|
disconnectExternalWallet: () => Promise<void>;
|
|
44
41
|
switchChain: (chainId: string) => Promise<void>;
|
|
45
42
|
setChainIdSwitchingTo: (chainId?: string) => void;
|
|
43
|
+
connectEmbeddedToExternalConnectors: () => Promise<void>;
|
|
46
44
|
}>;
|
|
47
|
-
|
|
48
|
-
children: ReactNode;
|
|
49
|
-
walletSort: TExternalWallet[];
|
|
50
|
-
evmContext: Context<EvmExternalWalletContextType>;
|
|
51
|
-
solanaContext: Context<SolanaExternalWalletContextType>;
|
|
52
|
-
cosmosContext: Context<CosmosExternalWalletContextType>;
|
|
53
|
-
}
|
|
54
|
-
export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function ExternalWalletProvider({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
55
46
|
export declare const useExternalWallets: () => {
|
|
56
47
|
wallets: CommonWallet[];
|
|
57
48
|
chains: CommonChain[];
|
|
58
|
-
chainId
|
|
49
|
+
chainId?: string;
|
|
59
50
|
wallet?: CommonWallet;
|
|
60
51
|
qrUri?: string;
|
|
61
52
|
chainIdSwitchingTo?: string;
|
|
@@ -67,9 +58,9 @@ export declare const useExternalWallets: () => {
|
|
|
67
58
|
};
|
|
68
59
|
username?: string;
|
|
69
60
|
avatar?: string;
|
|
70
|
-
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => void
|
|
61
|
+
connectExternalWallet: (wallet: CommonWallet, isMobile?: boolean, isManualWalletConnect?: boolean) => Promise<void>;
|
|
71
62
|
disconnectExternalWallet: () => Promise<void>;
|
|
72
63
|
switchChain: (chainId: string) => Promise<void>;
|
|
73
64
|
setChainIdSwitchingTo: (chainId?: string) => void;
|
|
65
|
+
connectEmbeddedToExternalConnectors: () => Promise<void>;
|
|
74
66
|
};
|
|
75
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ParaSolanaProviderProps } from '@getpara/solana-wallet-connectors';
|
|
3
|
+
import { ExternalWalletProviderCommon, ParaSolanaProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
4
|
+
export declare function SolanaExternalWalletProvider({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaSolanaProviderProps, 'config'> & {
|
|
5
|
+
config: ParaSolanaProviderConfigNoWallets;
|
|
6
|
+
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
+
export declare const MemoizedSolanaExternalWalletProvider: import("react").MemoExoticComponent<typeof SolanaExternalWalletProvider>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getClient: () => import("@getpara/web-sdk").ParaWeb;
|
|
1
|
+
export declare const getClient: () => import("@getpara/web-sdk").ParaWeb | undefined;
|
|
2
2
|
export declare const getIsOpen: () => boolean;
|
|
3
|
-
export declare const getSelectedWalletId: () => string;
|
|
4
|
-
export declare const getSelectedWalletType: () => import("@getpara/user-management-client").WalletType;
|
|
3
|
+
export declare const getSelectedWalletId: () => string | undefined;
|
|
4
|
+
export declare const getSelectedWalletType: () => import("@getpara/user-management-client").WalletType | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setIsOpen: (isOpen: boolean) => void;
|