@5ire/api-contract 中文文档教程
@polkadot/api-contract
允许对 Substrate 合约 ABI 进行编码和解码的接口。
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) => { ... });
@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) => { ... });
更多
你可能也喜欢
- 2create-task-runner-package 中文文档教程
- 996dev-my-awesome-greeter 中文文档教程
- @0bie/pattern-lib-react 中文文档教程
- @1ziton/react-native-bdidentifi 中文文档教程
- @21cnfe/ok 中文文档教程
- @2hats/react-native-circular-progress 中文文档教程
- @36node/finance-sdk 中文文档教程
- @44north/prettier-config 中文文档教程
- @4a/wechat 中文文档教程
- @58fe/babel-plugin-p5-import 中文文档教程