Fundamentals
Contracts
Contract connection and interaction utilities.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Contract connection and interaction utilities.
// set up a remote node provider
const provider = new quais.JsonRpcProvider(
"https://rpc.quai.network",
undefined,
{ usePathing: true }
);
// connect to the contract using the provider
const contract = new quais.Contract(contractAddress, contractABI, provider);
// get the contract's symbol
const symbol = await contract.symbol();
// get the contract's name
const name = await contract.name();
// get signer from pelagus provider
const provider = new quais.BrowserProvider(window.pelagus);
const signer = provider.getSigner();
// connect the signer to the contract
const contract = new quais.Contract(contractAddress, contractABI, signer);
// call a state changing contract function
const result = await contract.transferTo(
"1.0",
"0x1234567890123456789012345678901234567890"
);
Was this page helpful?
