I want to query a smart contract which I deployed on the Aleph Zero testnet. The Polkadot.js documentation is pretty clear and easy to follow regarding connecting to the chain and querying general chain information. But I get a bit confused when it comes to querying information regarding deployed smart contracts.
Here is what I have so far:
// Required imports
import { ApiPromise, WsProvider } from '@polkadot/api';
import { ContractPromise } from '@polkadot/api-contract';
// Initialise the provider to connect to the local node
const provider = new WsProvider('wss://ws.test.azero.dev');
// Create the API and wait until ready
const api = await ApiPromise.create({ provider });
const contract = new ContractPromise(api, metadata, wasm);
I am a bit confused about what the metadata and wasm are in this context. The documentation just sends me in a circle of links here.
Also, when I have established the connection to the right deployed smart contract, how can I query or execute methods to get information about it?