Files
api/packages/api-contract
Jaco fcee83d803 Split into types-augment (#4350)
* Aplit into types-augment

* Adjust

* Adjust, fix typegen run

* Adjust

* Rebuild

* Adjust

* Adjust

* CC
2021-12-18 17:31:18 +02:00
..
2021-12-18 14:00:58 +00:00
2021-12-18 14:00:58 +00:00

@polkadot/api-contract

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

import {ApiPromise, WsProvider } from '@polkadot/api';
import { Abi } from '@polkadot/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) => { ... });