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

0.2.2 • Public • Published

@polkadot/api-contract

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

import {ApiPromise, WsProvider } from '@5ire/api';
import { Abi } from '@5ire/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 @5ire/api-contract

Weekly Downloads

2

Version

0.2.2

License

Apache-2.0

Unpacked Size

225 kB

Total Files

84

Last publish

Collaborators

  • 5ire