@getpara/react-sdk 1.3.1-dev.2 → 1.4.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/MoonPayEmbed-GAWXP6V7.js +2 -0
- package/dist/MoonPayEmbed-GAWXP6V7.js.br +0 -0
- package/dist/MoonPayEmbed-GAWXP6V7.js.gz +0 -0
- package/dist/index.js +157 -5922
- 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/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +7 -0
- 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/hooks/useActiveWallet.d.ts +1 -0
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +1 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +29 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +33 -0
- package/dist/{provider/providers/ExternalWalletProvider.d.ts → modal/providers/ExternalWalletContext.d.ts} +29 -20
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +21 -0
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +3 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +20 -0
- package/dist/modal/stores/index.d.ts +1 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +3 -6
- package/dist/modal/stores/para/actions.d.ts +3 -0
- package/dist/modal/stores/para/useParaStore.d.ts +10 -0
- package/dist/modal/stores/theme/actions.d.ts +3 -0
- package/dist/modal/stores/theme/useThemeStore.d.ts +20 -0
- package/dist/modal/types/modalProps.d.ts +27 -1
- 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 +1 -3
- package/dist/provider/actions/checkIfUserExists.d.ts +7 -2
- package/dist/provider/actions/createUser.d.ts +10 -2
- package/dist/provider/actions/getAccount.d.ts +6 -9
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/logout.d.ts +1 -4
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +1 -1
- package/dist/provider/hooks/mutations/useLogout.d.ts +2 -3
- package/dist/provider/hooks/queries/useAccount.d.ts +3 -4
- 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 +0 -1
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/slices/index.d.ts +0 -1
- package/dist/provider/stores/types.d.ts +1 -43
- package/dist/provider/types/provider.d.ts +16 -115
- package/dist/provider/types/utils.d.ts +0 -1
- package/package.json +9 -30
- package/dist/cli/cli.mjs +0 -38
- package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -12
- package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
- package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
- package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
- package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
- package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
- package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -10
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -3
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -6
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
- package/dist/provider/stores/setters.d.ts +0 -1
- package/dist/provider/stores/slices/config.d.ts +0 -3
- package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
- package/dist/provider/types/externalWalletProviders.d.ts +0 -12
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import { Context } from 'react';
|
|
2
1
|
import ParaWeb, { WalletType } from '@getpara/web-sdk';
|
|
3
|
-
import { EvmExternalWalletContextType, ParaEvmProvider, WalletList as EvmWalletList } from '@getpara/evm-wallet-connectors';
|
|
4
|
-
import { CosmosExternalWalletContextType, ParaCosmosProvider, WalletList as CosmosWalletList } from '@getpara/cosmos-wallet-connectors';
|
|
5
|
-
import { ParaSolanaProvider, SolanaExternalWalletContextType, WalletList as SolanaWalletList } from '@getpara/solana-wallet-connectors';
|
|
6
|
-
import { ParaModalProps, TExternalWallet } from '../../modal/index.js';
|
|
7
|
-
import { OAuthLogoVariantType } from '../../modal/types/modalProps.js';
|
|
8
2
|
export interface ClientSlice {
|
|
9
3
|
client?: ParaWeb;
|
|
10
4
|
setClient: (_: ParaWeb) => void;
|
|
11
5
|
}
|
|
12
|
-
export interface ConfigSlice {
|
|
13
|
-
appName: string;
|
|
14
|
-
setAppName: (_: string) => void;
|
|
15
|
-
}
|
|
16
6
|
export interface ModalSlice {
|
|
17
|
-
modalConfig?: ParaModalProps;
|
|
18
|
-
setModalConfig: (_?: ParaModalProps) => void;
|
|
19
|
-
isDarkTheme: boolean;
|
|
20
|
-
oAuthLogoVariant: OAuthLogoVariantType;
|
|
21
7
|
isOpen: boolean;
|
|
22
8
|
setIsOpen: (_: boolean) => void;
|
|
23
9
|
}
|
|
@@ -27,32 +13,4 @@ export interface WalletSlice {
|
|
|
27
13
|
setSelectedWallet: (_?: string, __?: WalletType) => void;
|
|
28
14
|
clearSelectedWallet: () => void;
|
|
29
15
|
}
|
|
30
|
-
export
|
|
31
|
-
externalWallets: TExternalWallet[];
|
|
32
|
-
setExternalWallets: (_: TExternalWallet[]) => void;
|
|
33
|
-
evmContext: Context<EvmExternalWalletContextType>;
|
|
34
|
-
setEvmContext: (_: Context<EvmExternalWalletContextType>) => void;
|
|
35
|
-
EvmProvider?: typeof ParaEvmProvider;
|
|
36
|
-
setEvmProvider: (_: typeof ParaEvmProvider) => void;
|
|
37
|
-
evmWallets: EvmWalletList;
|
|
38
|
-
setEvmWallets: (_: EvmWalletList) => void;
|
|
39
|
-
isLoadingEvmLib: boolean;
|
|
40
|
-
setIsLoadingEvmLib: (_: boolean) => void;
|
|
41
|
-
cosmosContext: Context<CosmosExternalWalletContextType>;
|
|
42
|
-
setCosmosContext: (_: Context<CosmosExternalWalletContextType>) => void;
|
|
43
|
-
CosmosProvider?: typeof ParaCosmosProvider;
|
|
44
|
-
setCosmosProvider: (_: typeof ParaCosmosProvider) => void;
|
|
45
|
-
cosmosWallets: CosmosWalletList;
|
|
46
|
-
setCosmosWallets: (_: CosmosWalletList) => void;
|
|
47
|
-
isLoadingCosmosLib: boolean;
|
|
48
|
-
setIsLoadingCosmosLib: (_: boolean) => void;
|
|
49
|
-
solanaContext: Context<SolanaExternalWalletContextType>;
|
|
50
|
-
setSolanaContext: (_: Context<SolanaExternalWalletContextType>) => void;
|
|
51
|
-
SolanaProvider?: typeof ParaSolanaProvider;
|
|
52
|
-
setSolanaProvider: (_: typeof ParaSolanaProvider) => void;
|
|
53
|
-
solanaWallets: SolanaWalletList;
|
|
54
|
-
setSolanaWallets: (_: SolanaWalletList) => void;
|
|
55
|
-
isLoadingSolanaLib: boolean;
|
|
56
|
-
setIsLoadingSolanaLib: (_: boolean) => void;
|
|
57
|
-
}
|
|
58
|
-
export type Store = ClientSlice & ModalSlice & WalletSlice & ExternalWalletsSlice & ConfigSlice;
|
|
16
|
+
export type Store = ClientSlice & ModalSlice & WalletSlice;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { ParaWagmiProviderProps } from '@getpara/evm-wallet-connectors';
|
|
2
1
|
import ParaWeb, { AccountCreationEvent, AccountSetupEvent, ConstructorOpts, Environment, ExternalWalletChangeEvent, LoginEvent, LogoutEvent, PregenWalletClaimedEvent, SignMessageEvent, SignTransactionEvent, WalletCreatedEvent, WalletsChangeEvent } from '@getpara/web-sdk';
|
|
3
2
|
import { PropsWithChildren } from 'react';
|
|
4
|
-
import { Chain, Transport } from 'viem';
|
|
5
|
-
import { ParaModalProps, TExternalWallet } from '../../modal/index.js';
|
|
6
|
-
import { ParaGrazProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
7
|
-
import { ParaCosmosProviderConfigNoWallets, ParaEvmProviderConfigNoWallets, ParaSolanaProviderConfigNoWallets } from './externalWalletProviders.js';
|
|
8
3
|
export type Callbacks = {
|
|
9
4
|
onLogout?: (event: LogoutEvent) => void;
|
|
10
5
|
onLogin?: (event: LoginEvent) => void;
|
|
@@ -18,120 +13,26 @@ export type Callbacks = {
|
|
|
18
13
|
onPregenWalletClaimed?: (event: PregenWalletClaimedEvent) => void;
|
|
19
14
|
};
|
|
20
15
|
export type ParaProviderConfig = {
|
|
21
|
-
/**
|
|
22
|
-
* The name of your app, used throughout the modal and any configured external wallets.
|
|
23
|
-
*/
|
|
24
|
-
appName: string;
|
|
25
|
-
/**
|
|
26
|
-
* Disables the automatic session keep alive that's provided by ParaProvider.
|
|
27
|
-
*/
|
|
28
16
|
disableAutoSessionKeepAlive?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Disables the ParaModal that's provided by ParaProvider. Use this is you're providing a separate modal in another location in your app.
|
|
31
|
-
*/
|
|
32
|
-
disableEmbeddedModal?: boolean;
|
|
33
17
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* A description of your app, displayed in some external wallets.
|
|
37
|
-
*/
|
|
38
|
-
appDescription?: string;
|
|
39
|
-
/**
|
|
40
|
-
* A URL for your app, displayed in some external wallets.
|
|
41
|
-
*/
|
|
42
|
-
appUrl?: string;
|
|
43
|
-
/**
|
|
44
|
-
* An icon for your app, displayed in some external wallets.
|
|
45
|
-
*/
|
|
46
|
-
appIcon?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Config for the EVM external wallets connector using Wagmi.
|
|
49
|
-
*
|
|
50
|
-
* NOTE: In addition to this config, you MUST also have the `@getpara/evm-wallet-connectors` package installed.
|
|
51
|
-
*/
|
|
52
|
-
evmConnector?: {
|
|
53
|
-
/**
|
|
54
|
-
* Config for the Para EVM external wallets connector.
|
|
55
|
-
*/
|
|
56
|
-
config: Omit<ParaEvmProviderConfigNoWallets<chains, transports>, 'appName' | 'appDescription' | 'appUrl' | 'appIcon' | 'projectId'>;
|
|
57
|
-
/**
|
|
58
|
-
* Config for the Wagmi provider.
|
|
59
|
-
*/
|
|
60
|
-
wagmiProviderProps?: ParaWagmiProviderProps;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Config for the Cosmos external wallets connector using Graz.
|
|
64
|
-
*
|
|
65
|
-
* NOTE: In addition to this config, you MUST also have the `@getpara/cosmos-wallet-connectors` package installed.
|
|
66
|
-
*/
|
|
67
|
-
cosmosConnector?: {
|
|
68
|
-
/**
|
|
69
|
-
* Config for the Para Cosmos external wallets connector.
|
|
70
|
-
*/
|
|
71
|
-
config: ParaCosmosProviderConfigNoWallets;
|
|
72
|
-
/**
|
|
73
|
-
* Config for the Graz provider.
|
|
74
|
-
*/
|
|
75
|
-
grazProviderProps?: ParaGrazProviderProps;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Config for the Solana external wallets connector using @solana/wallet-adapter-react.
|
|
79
|
-
*
|
|
80
|
-
* NOTE: In addition to this config, you MUST also have the `@getpara/solana-wallet-connectors` package installed.
|
|
81
|
-
*/
|
|
82
|
-
solanaConnector?: {
|
|
83
|
-
/**
|
|
84
|
-
* Config for the Para Solana external wallets connector.
|
|
85
|
-
*/
|
|
86
|
-
config: Omit<ParaSolanaProviderConfigNoWallets, 'appIdentity'> & Pick<Partial<ParaSolanaProviderConfigNoWallets>, 'appIdentity'>;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Config for any connectors that use Wallet Connect.
|
|
90
|
-
*/
|
|
91
|
-
walletConnect?: {
|
|
92
|
-
/**
|
|
93
|
-
* Your Wallet Connect project ID.
|
|
94
|
-
*/
|
|
95
|
-
projectId: string;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Which external wallets to show and in what order they should be displayed.
|
|
99
|
-
*
|
|
100
|
-
* NOTE: Any wallets that are detected as installed will be sorted first, followed by those that are not detected or not installed.
|
|
101
|
-
*/
|
|
102
|
-
wallets: TExternalWallet[];
|
|
103
|
-
};
|
|
104
|
-
export interface ParaProviderProps<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> extends PropsWithChildren {
|
|
105
|
-
/**
|
|
106
|
-
* Arguments to setup a new Para instance, or a Para instance you have already instantiated.
|
|
107
|
-
*/
|
|
108
|
-
paraClientConfig: {
|
|
109
|
-
/**
|
|
110
|
-
* Environment for your Para instance.
|
|
111
|
-
*/
|
|
18
|
+
interface ParaProviderPropsBase extends PropsWithChildren {
|
|
19
|
+
paraClientConfig?: {
|
|
112
20
|
env: Environment;
|
|
113
|
-
/**
|
|
114
|
-
* API key for you Para instance.
|
|
115
|
-
*
|
|
116
|
-
* NOTE: Be sure this key matches the environment.
|
|
117
|
-
*/
|
|
118
21
|
apiKey: string;
|
|
119
22
|
opts?: ConstructorOpts;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Configuration used for the Para modal.
|
|
123
|
-
*/
|
|
124
|
-
paraModalConfig?: ParaModalProps;
|
|
125
|
-
/**
|
|
126
|
-
* Callbacks fired for events from the Para instance.
|
|
127
|
-
*/
|
|
23
|
+
};
|
|
128
24
|
callbacks?: Callbacks;
|
|
129
|
-
|
|
130
|
-
* Config for the ParaProvider.
|
|
131
|
-
*/
|
|
132
|
-
config: ParaProviderConfig;
|
|
133
|
-
/**
|
|
134
|
-
* Config for any external wallets.
|
|
135
|
-
*/
|
|
136
|
-
externalWalletConfig?: ExternalWalletConfig<chains, transports>;
|
|
25
|
+
config?: ParaProviderConfig;
|
|
137
26
|
}
|
|
27
|
+
export type ParaProviderProps = ({
|
|
28
|
+
config: ParaProviderConfig & {
|
|
29
|
+
paraClientOverride: ParaWeb;
|
|
30
|
+
};
|
|
31
|
+
paraClientConfig?: never;
|
|
32
|
+
} & ParaProviderPropsBase) | ({
|
|
33
|
+
config?: ParaProviderConfig & {
|
|
34
|
+
paraClientOverride?: never;
|
|
35
|
+
};
|
|
36
|
+
paraClientConfig: ParaProviderPropsBase['paraClientConfig'];
|
|
37
|
+
} & ParaProviderPropsBase);
|
|
38
|
+
export {};
|
|
@@ -4,4 +4,3 @@ export type Compute<type> = {
|
|
|
4
4
|
/** Strict version of built-in Omit type */
|
|
5
5
|
export type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
6
6
|
export type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
|
|
7
|
-
export type ChangeFields<T, R> = Omit<T, keyof R> & R;
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"setup-para": "dist/cli/cli.mjs"
|
|
9
|
-
},
|
|
10
7
|
"exports": {
|
|
11
8
|
".": "./dist/index.js",
|
|
12
9
|
"./styles.css": "./dist/css/modal.css"
|
|
@@ -15,51 +12,33 @@
|
|
|
15
12
|
"*.css"
|
|
16
13
|
],
|
|
17
14
|
"dependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@cosmjs/stargate": "<=0.31.3",
|
|
22
|
-
"@cosmjs/tendermint-rpc": "<=0.31.3",
|
|
23
|
-
"@getpara/react-common": "1.3.1",
|
|
24
|
-
"@getpara/react-components": "1.3.1",
|
|
25
|
-
"@getpara/web-sdk": "1.3.1",
|
|
26
|
-
"@solana-mobile/wallet-adapter-mobile": "^2.1.3",
|
|
27
|
-
"@solana/wallet-adapter-base": "^0.9.23",
|
|
28
|
-
"@solana/wallet-adapter-react": "^0.15.35",
|
|
29
|
-
"@solana/wallet-adapter-walletconnect": "^0.1.16",
|
|
30
|
-
"@solana/web3.js": "^1.95.8",
|
|
15
|
+
"@getpara/react-common": "1.4.0",
|
|
16
|
+
"@getpara/react-components": "1.4.0",
|
|
17
|
+
"@getpara/web-sdk": "1.4.0",
|
|
31
18
|
"@tanstack/react-query": "^5.0.0",
|
|
32
19
|
"date-fns": "^3.6.0",
|
|
33
20
|
"detect-browser": "^5.3.0",
|
|
34
21
|
"framer-motion": "11.3.28",
|
|
35
22
|
"libphonenumber-js": "^1.11.1",
|
|
36
23
|
"styled-components": "^6.1.8",
|
|
37
|
-
"zustand": "^4.5.2"
|
|
24
|
+
"zustand": "^4.5.2",
|
|
25
|
+
"zustand-sync-tabs": "^0.2.2"
|
|
38
26
|
},
|
|
39
27
|
"scripts": {
|
|
40
28
|
"post-build": "./scripts/post-build.sh",
|
|
41
29
|
"build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs && yarn post-build",
|
|
42
30
|
"typegen": "tsc --emitDeclarationOnly",
|
|
43
|
-
"test": "vitest run --coverage"
|
|
44
|
-
"cli": "node ./dist/cli/cli.mjs"
|
|
31
|
+
"test": "vitest run --coverage"
|
|
45
32
|
},
|
|
46
33
|
"devDependencies": {
|
|
47
|
-
"@getpara/cosmos-wallet-connectors": "^1.3.1",
|
|
48
|
-
"@getpara/evm-wallet-connectors": "^1.3.1",
|
|
49
|
-
"@getpara/solana-wallet-connectors": "^1.3.1",
|
|
50
34
|
"@testing-library/dom": "^10.1.0",
|
|
51
35
|
"@testing-library/react": "^16.0.0",
|
|
52
36
|
"@types/chrome": "^0.0.237",
|
|
53
37
|
"@types/react": "^18.0.31",
|
|
54
38
|
"@types/react-dom": "^18.2.7",
|
|
55
|
-
"typescript": "^5.4.3"
|
|
56
|
-
"viem": "2.x",
|
|
57
|
-
"wagmi": "2.x"
|
|
39
|
+
"typescript": "^5.4.3"
|
|
58
40
|
},
|
|
59
41
|
"peerDependencies": {
|
|
60
|
-
"@getpara/cosmos-wallet-connectors": "^1.3.1",
|
|
61
|
-
"@getpara/evm-wallet-connectors": "^1.3.1",
|
|
62
|
-
"@getpara/solana-wallet-connectors": "^1.3.1",
|
|
63
42
|
"react": "*",
|
|
64
43
|
"react-dom": "*"
|
|
65
44
|
},
|
|
@@ -71,5 +50,5 @@
|
|
|
71
50
|
"resolutions": {
|
|
72
51
|
"styled-components": "^6"
|
|
73
52
|
},
|
|
74
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "b7610939d5a0121729be24c38d418eb45760258a"
|
|
75
54
|
}
|
package/dist/cli/cli.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as fs from 'node:fs/promises';
|
|
3
|
-
import * as path from 'node:path';
|
|
4
|
-
import { createRequire } from 'module';
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
|
|
7
|
-
const PACKAGES_TO_STUB = [
|
|
8
|
-
'@getpara/evm-wallet-connectors',
|
|
9
|
-
'@getpara/cosmos-wallet-connectors',
|
|
10
|
-
'@getpara/solana-wallet-connectors',
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const checkForPackages = async () => {
|
|
14
|
-
const pathToParaPackages = require.resolve('@getpara/react-sdk');
|
|
15
|
-
|
|
16
|
-
const pathToNodeModules = path.resolve(pathToParaPackages, '../../node_modules');
|
|
17
|
-
|
|
18
|
-
for (let i = 0; i < PACKAGES_TO_STUB.length; i++) {
|
|
19
|
-
const packageName = PACKAGES_TO_STUB[i];
|
|
20
|
-
try {
|
|
21
|
-
await import(packageName);
|
|
22
|
-
} catch (err) {
|
|
23
|
-
if (err.code === 'ERR_MODULE_NOT_FOUND') {
|
|
24
|
-
const packageJsonContent = {
|
|
25
|
-
name: packageName,
|
|
26
|
-
main: './index.js',
|
|
27
|
-
};
|
|
28
|
-
await fs.mkdir(`${pathToNodeModules}/${packageName}`, { recursive: true });
|
|
29
|
-
await fs.writeFile(`${pathToNodeModules}/${packageName}/index.js`, '//STUB');
|
|
30
|
-
await fs.writeFile(`${pathToNodeModules}/${packageName}/package.json`, JSON.stringify(packageJsonContent), {
|
|
31
|
-
encoding: 'utf-8',
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
await checkForPackages();
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,10 +0,0 @@
|
|
|
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>;
|
|
@@ -1,6 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
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>;
|
|
@@ -1,7 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare const setIsOpen: (isOpen: boolean) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ParaCosmosProviderConfig } from '@getpara/cosmos-wallet-connectors';
|
|
2
|
-
import { TExternalWallet } from '../../modal/index.js';
|
|
3
|
-
import { ParaSolanaProviderConfig } from '@getpara/solana-wallet-connectors';
|
|
4
|
-
import { Chain, Transport } from 'viem';
|
|
5
|
-
import { ParaEvmProviderConfig } from '@getpara/evm-wallet-connectors';
|
|
6
|
-
export type ExternalWalletProviderCommon = {
|
|
7
|
-
isUsing: boolean;
|
|
8
|
-
wallets: TExternalWallet[];
|
|
9
|
-
};
|
|
10
|
-
export type ParaEvmProviderConfigNoWallets<chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>> = Omit<ParaEvmProviderConfig<chains, transports>, 'wallets'>;
|
|
11
|
-
export type ParaCosmosProviderConfigNoWallets = Omit<ParaCosmosProviderConfig, 'wallets'>;
|
|
12
|
-
export type ParaSolanaProviderConfigNoWallets = Omit<ParaSolanaProviderConfig, 'wallets'>;
|