本文整理汇总了TypeScript中ts/redux/dispatcher.Dispatcher.replaceTokenAllowanceByAddress方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Dispatcher.replaceTokenAllowanceByAddress方法的具体用法?TypeScript Dispatcher.replaceTokenAllowanceByAddress怎么用?TypeScript Dispatcher.replaceTokenAllowanceByAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ts/redux/dispatcher.Dispatcher
的用法示例。
在下文中一共展示了Dispatcher.replaceTokenAllowanceByAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setProxyAllowanceAsync
public async setProxyAllowanceAsync(token: Token, amountInBaseUnits: BigNumber.BigNumber): Promise<void> {
utils.assert(this.isValidAddress(token.address), BlockchainCallErrs.TOKEN_ADDRESS_IS_INVALID);
utils.assert(this.doesUserAddressExist(), BlockchainCallErrs.USER_HAS_NO_ASSOCIATED_ADDRESSES);
utils.assert(!_.isUndefined(this.zeroEx), 'ZeroEx must be instantiated.');
await this.zeroEx.token.setProxyAllowanceAsync(
token.address, this.userAddress, amountInBaseUnits,
);
const allowance = amountInBaseUnits;
this.dispatcher.replaceTokenAllowanceByAddress(token.address, allowance);
}