8.1.1 • Published 2 years ago
@cherrylabs/api-contract v8.1.1
@polkadot/api-contract
Interfaces to allow for the encoding and decoding of Substrate contract ABIs.
import {ApiPromise, WsProvider } from '@cherrylabs/api';
import { Abi } from '@cherrylabs/api-contract';
const wsProvider = new WsProvider(<...Node Url...>);
const api = await ApiPromise.create({ provider: wsProvider });
const abi = new Abi(<...JSON ABI...>, api.registry.getChainProperties());
api.tx.contracts
.call(<contract addr>, <value>, <max gas>, abi.messages.<method name>(<...params...>))
.signAndSend(<keyring pair>, (result: SubmittableResult) => { ... });
8.1.1
2 years ago