Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

chore: test global core #35

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"dependencies": {
"@ethereumjs/tx": "^3.5.0",
"@walletconnect/encoding": "^1.0.1",
"@walletconnect/ethereum-provider": "2.15.0",
"@walletconnect/ethereum-provider": "2.19.1-canary-g-c-1",
"@walletconnect/modal": "^2.5.4",
"@walletconnect/types": "2.15.0",
"@walletconnect/utils": "2.15.0",
"@walletconnect/types": "2.19.1-canary-g-c-1",
"@walletconnect/utils": "2.19.1-canary-g-c-1",
"axios": "^0.21.1",
"blockies-ts": "^1.0.0",
"cosmos-wallet": "^1.1.0",
Expand Down
37 changes: 21 additions & 16 deletions examples/dapp/src/contexts/ClientContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,27 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
const createClient = useCallback(async () => {
try {
setIsInitializing(true);

const provider = await EthereumProvider.init({
projectId: DEFAULT_PROJECT_ID || "",
optionalChains: [1],
optionalMethods: [
"eth_sendTransaction",
"personal_sign",
"eth_signTransaction",
"eth_sign",
"eth_signTypedData",
"wallet_switchEthereumChain",
],
showQrModal: true,
});
setEthereumProvider(provider);
setClient(provider.signer.client);
console.log("createClient...");
const result = prompt("Number of clients to create") || "1";
for (let i = 0; i < parseInt(result || "10"); i++) {
console.log("creating client :", i + 1);
const provider = await EthereumProvider.init({
projectId: DEFAULT_PROJECT_ID || "",
optionalChains: [1],
optionalMethods: [
"eth_sendTransaction",
"personal_sign",
"eth_signTransaction",
"eth_sign",
"eth_signTypedData",
"wallet_switchEthereumChain",
],
showQrModal: true,
});

setEthereumProvider(provider);
setClient(provider.signer.client);
}
} catch (err) {
throw err;
} finally {
Expand Down
Loading
Loading