@cherrylabs/api-contract

8.1.1 • Public • Published

@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) => { ... });

Readme

Keywords

none

Package Sidebar

Install

npm i @cherrylabs/api-contract

Weekly Downloads

1

Version

8.1.1

License

Apache-2.0

Unpacked Size

1.14 MB

Total Files

122

Last publish

Collaborators

  • cherrylabs