@axiasolar-js/api-contract
v1.1.1
Published
Interfaces for interacting with contracts and contract ABIs
Downloads
1
Readme
@axiasolar-js/api-contract
Interfaces to allow for the encoding and decoding of Substrate contract ABIs.
import {ApiPromise, WsProvider } from '@axiasolar-js/api';
import { Abi } from '@axiasolar-js/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) => { ... });