1.29.0-beta.7 • Published 4 years ago

@scry/api-contract v1.29.0-beta.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

@scry/api-contract

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

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