@_mon/contracts-helper 中文文档教程

发布于 5年前 浏览 23 项目主页 更新于 3年前

@_mon/contracts-helper

在单个合约调用中获取多个账户的配额、余额、资金状态。 目前只支持Kovan网络

Install

$ npm install @_mon/contracts-helper

Usage

const { getAllowancesAndBalancesResult } = require('@_mon/contracts-helper');

// getAllowancesAndBalancesResult(networkId, addresses[], tokenAddresses[], spenderAddress, amounts[])
const result = await getAllowancesAndBalancesResult(
  42,
  ['0x0000000000000000000000000000000000000000'],
  ['0x0000000000000000000000000000000000000000'],
  '0x0000000000000000000000000000000000000000',
  ['0']
);
//=> ['0']
'0' - Both Allowanance and Balance not available
'1' - Allowance not available, Balance available
'2' - Allowance available, Balance not available
'3' - Allowance and Balance both available

@_mon/contracts-helper

Fetches allowances, balances, funded status for multiple accounts in a single contract call. Currently supports only Kovan network

Install

$ npm install @_mon/contracts-helper

Usage

const { getAllowancesAndBalancesResult } = require('@_mon/contracts-helper');

// getAllowancesAndBalancesResult(networkId, addresses[], tokenAddresses[], spenderAddress, amounts[])
const result = await getAllowancesAndBalancesResult(
  42,
  ['0x0000000000000000000000000000000000000000'],
  ['0x0000000000000000000000000000000000000000'],
  '0x0000000000000000000000000000000000000000',
  ['0']
);
//=> ['0']
'0' - Both Allowanance and Balance not available
'1' - Allowance not available, Balance available
'2' - Allowance available, Balance not available
'3' - Allowance and Balance both available
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文