@white-matrix/theirsverse-sdk
v1.0.10
Published
``` const winProvider = await detectEthereumProvider() if (winProvider) { winProvider.on('accountsChanged', () => { window.location.reload() }) winProvider.on('chainChanged', () => { window.location.reload(
Downloads
13
Keywords
Readme
Solidity SDK Seed
Sample
const winProvider = await detectEthereumProvider()
if (winProvider) {
winProvider.on('accountsChanged', () => {
window.location.reload()
})
winProvider.on('chainChanged', () => {
window.location.reload()
})
winProvider = new ethers.providers.Web3Provider(winProvider)
return
}
when query
const client = TheirsverseProvider(false)
client.connectProvider(address, winProvider) // contract address (could be found in deployment.json)
// can do all the calls with out connect account
// example: get minted token counts
const minted = await client.totalSupply()
when execute
const client = TheirsverseProvider(false)
client.connectProvider(address, winProvider) // contract address (could be found in deployment.json)
// we need to set siger, before execute
const signer = winProvider.getSigner()
client.connectSigner(signer)
// then, we can do mint things like:
const { transactionHash, newTokenIds } = await client.goldMemberMint(10, {
value:XXX
})