Rename environment variable for wallet connect project id

This commit is contained in:
Shreerang Kale 2024-03-08 08:59:22 +05:30
parent 8ca5a1d8a9
commit 503bc29218
3 changed files with 4 additions and 5 deletions

2
.env
View File

@ -1 +1 @@
PROJECT_ID=
WALLET_CONNECT_PROJECT_ID=

View File

@ -1,6 +1,6 @@
declare module 'react-native-config' {
export interface NativeConfig {
PROJECT_ID: string;
WALLET_CONNECT_PROJECT_ID: string;
}
export const Config: NativeConfig;

View File

@ -1,6 +1,7 @@
import '@walletconnect/react-native-compat';
import '@ethersproject/shims';
import { useState, useCallback, useEffect } from 'react';
import Config from 'react-native-config';
import { Core } from '@walletconnect/core';
@ -10,11 +11,9 @@ import { Web3Wallet, IWeb3Wallet } from '@walletconnect/web3wallet';
export let web3wallet: IWeb3Wallet;
export let core: ICore;
import { useState, useCallback, useEffect } from 'react';
export async function createWeb3Wallet() {
const core = new Core({
projectId: Config.PROJECT_ID,
projectId: Config.WALLET_CONNECT_PROJECT_ID,
});
web3wallet = await Web3Wallet.init({