本文整理匯總了TypeScript中ethers.utils.bigNumberify方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript utils.bigNumberify方法的具體用法?TypeScript utils.bigNumberify怎麽用?TypeScript utils.bigNumberify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ethers.utils
的用法示例。
在下文中一共展示了utils.bigNumberify方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: deposit
public async deposit(
address: Address,
amount: ethers.utils.BigNumber,
threshold: ethers.utils.BigNumber
) {
const stateChannelInfo = await this.queryStateChannel();
const isPeerA =
stateChannelInfo.data.stateChannel.freeBalance.alice === this.fromAddress;
const signingKeys = [this.toAddress, this.fromAddress];
const appInstance = new ETHBalanceRefundApp(address, signingKeys);
const deposits = {
[this.fromAddress]: ethers.utils.bigNumberify("0"),
[this.toAddress]: ethers.utils.bigNumberify("0")
};
const state = [this.fromAddress, this.multisigAddress, threshold];
const balanceRefund = await this.install(
"ETHBalanceRefundApp",
appInstance,
deposits,
state
);
await this.depositToMultisig(amount);
await balanceRefund.uninstall({
peerABalance: isPeerA ? amount : ethers.utils.bigNumberify(0),
peerBBalance: isPeerA ? ethers.utils.bigNumberify(0) : amount
});
}
示例2: constructor
constructor(appAddress: string, signingKeys: string[]) {
const timeout = 100;
const terms = new Terms(
0,
ethers.utils.bigNumberify("0"),
ethers.constants.AddressZero
);
const abiEncodings = AppInstance.generateAbiEncodings(
ETHBalanceRefundAppContract.abi
);
const appDefinition: AppDefinition = {
address: appAddress,
appStateEncoding: abiEncodings.appStateEncoding,
appActionEncoding: abiEncodings.appActionEncoding
};
super(signingKeys, appDefinition, terms, timeout);
}
示例3: constructor
constructor(
readonly address: Address,
balance: number | ethers.utils.BigNumber
) {
this.balance = ethers.utils.bigNumberify(balance.toString());
}
示例4:
const deserializeBigNumber = data => ethers.utils.bigNumberify(data._hex);