To instantiate any contract you must pass the correct instantiateMessage that creates the contract. Then encode it base64 and create a wasm.instantiate message.
//this object depends on the contract to instantiate
let instantiateMessage = JSON.stringify({});
let msgBin = Buffer.from(instantiateMessage).toString("base64");
const {proposal, transactionHash} = await multisig.createProposal({
from: "<sender address>",
description: "<proposal description>",
messages: [
{
wasm: {
instantiate: {
admin: "<admin of contract>,
code_id: <contract codeID>,
funds: [],
label: "<contract label>",
msg: msgBin,
},
},
},
],
});
Transfer CW20 tokens
Any contract related transaction should have the message to send wrapped inside a wasm.execute. On this example we create a message to transfer 1 CW20 token with 18 decimal places.
A staking message is a special type of message that isnt wrapped in the commin wasm.execute. It can have different types, here we expose as example the delegate staking.
const {transactionHash, proposal} = await multisig.createProposal({
from: "<sender address>",
description: "<proposal description>",
manualExecution: false,
messages: [
{
staking: {
delegate: {
amount: {
denom: "<network denom>",
amount: "<amount>",
},
validator: validatorAddr,
},
},
},
],
});
//TO WITHDRAW TOKENS, these can have a withdraw period depending on the network
//{
//staking: {
//undelegate: {
//amount: {
//denom: network.stakeCurrency.coinMinimalDenom,
//amount: amount,
//},
//validator: validatorAddr,
//},
//},
//},
Astrovault deposit
An example of contract interaction is the astrovault deposit, astrovault is an Automated Market Maker living on the archway blockchain.