25
怎样拉起 MetaMask, 授权某个合约使用我的钱包 | 登链社区 | 技术问答
source link: https://learnblockchain.cn/question/1939
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
怎样拉起 MetaMask, 授权某个合约使用我的钱包
5 怎样拉起 MetaMask, 授权某个合约使用我的钱包
怎么给某个合约地址授权?
我是这么写的,但是点击按钮,没有反应:
// before all, request privilege, first
const handleReqPri = () => {
const w = new Web3(ether);
const wethAdr = getWETHContract(w);
const strBlindAuctionAdr = getBlindAuctionAddress();
wethAdr.methods
.approve(strBlindAuctionAdr, new BigNumber("100000000000000000"))
.call()
.then(function (result: any) {
console.log("handleReqPri ===>", result);
})
.catch((_error: any) => {
// If the request fails, the Promise will reject with an error.
console.error("privilege error ? : ", _error);
});
};
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK