@chainx-v2/api-contract
TypeScript icon, indicating that this package has built-in type declarations

0.0.27 • Public • Published

@chainx-v2/api-contract

Interfaces to allow for the encoding and decoding of Substrate contract ABIs.

import {ApiPromise, WsProvider } from '@chainx-v2/api';
import { Abi } from '@chainx-v2/api-contract';

const wsProvider = new WsProvider(<...Node Url...>);
const api = await ApiPromise.create({ provider: wsProvider });
const abi = new Abi(api.registry, <...JSON ABI...>);

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 @chainx-v2/api-contract

Weekly Downloads

1

Version

0.0.27

License

Apache-2.0

Unpacked Size

72.3 kB

Total Files

45

Last publish

Collaborators

  • qinghuanlyke
  • wliyongfeng