This is a rough summary since these things exist in different views.
I have a react native app that uses wallet connect. this allows me to connect to a meta mask wallet on my phone and creates a connector instance.
import {
useWalletConnect,
withWalletConnect,
} from "@walletconnect/react-native-dapp";
const connector = useWalletConnect();
connector.connect();
somewhere else in my application I'm using ethers to deploy..
// local hard hat HTTP and WebSocket JSON-RPC server
let provider = ethers.getDefaultProvider('http://127.0.0.1:8545/');
const signer = provider.getSigner()
let contract = new ethers.Contract(nftaddress, NFT.abi, signer);
let transaction = await contract.createToken(url);
let tx = await transaction.wait();
let event = tx.events[0];
let value = event.args[2];
let tokenId = value.toNumber();
const price = ethers.utils.parseUnits(formInput.price, "ether");
contract = new ethers.Contract(nftmarketaddress, Market.abi, signer);
let listingPrice = await contract.getListingPrice();
listingPrice = listingPrice.toString();
transaction = await contract.createMarketItem(nftaddress, tokenId, price, {
value: listingPrice,
});
await transaction.wait();
I guess I don't fully understand how I use my wallet (connector instance) to sign these transactions. The wallet connector instance doesn't seem to contain a "Signer", it just has a method that lets you a sign a transaction? I'm totally stumped by this.
this is the output