Example
CosmWasm.toBinary. This, however, broke Amino support. I thus had to remove it from messages &
queries. The CosmWasm.toBinary helper is still useful to encode sub-messages, e.g. for the send
message of CW20 tokens.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
CosmWasm integration on top of the Cosmos integration.
import { Cosmos, LocalSigner, mw } from '@apophis-sdk/cosmos';
import { DefaultCosmWasmMiddlewares, CosmWasm } from '@apophis-sdk/cosmwasm';
mw.use(...DefaultCosmWasmMiddlewares);
const network = await Cosmos.getNetworkFromRegistry('neutrontestnet');
const signer = LocalSigner.fromMnemonic('...');
await Cosmos.ws(network).ready();
const response = await CosmWasm.query.smart({
network,
'neutron1...', // contract address
{
config: {},
},
});
console.log(response);
await CosmWasm.execute(
network,
signer,
'neutron1...', // contract address
{
increment: {},
},
[Cosmos.coin(1_000000n, 'untrn')], // optional native coin "funds" to pass along the call
);
CosmWasm.toBinary. This, however, broke Amino support. I thus had to remove it from messages &
queries. The CosmWasm.toBinary helper is still useful to encode sub-messages, e.g. for the send
message of CW20 tokens.