bug fix: unlock for mainnet

This commit is contained in:
CounterFire2023 2024-07-18 18:13:18 +08:00
parent 2597cd0b2c
commit ac9c4fd56d

View File

@ -69,7 +69,7 @@ export class Locker {
await provider.waitForTransaction(txHash)
return txHash
}
async execUnlock(chainId, nft, tokenIds) {
async execUnlock(provider, chainId, nft, tokenIds) {
const preDatas = {
net_id: chainId,
contract_address: nft,
@ -80,8 +80,8 @@ export class Locker {
if (errcode) {
throw new Error(errmsg)
}
const web3Provider = this.bc.passportProvider || this.bc.web3Provider
return this.sendUnlockOrMint(web3Provider, trans_req)
return this.sendUnlockOrMint(provider, trans_req)
}
// imbtl上游戏内资产上链, 用于解锁或铸造
@ -92,7 +92,8 @@ export class Locker {
await this.bc.checkPassportLogin();
await this.bc.checkAndChangeChain();
const chainId = import.meta.env.VUE_APP_NET_ID;
return this.execUnlock(chainId, nft, tokenIds)
const provider = this.bc.passportProvider || this.bc.web3Provider
return this.execUnlock(provider, chainId, nft, tokenIds)
}
/**
@ -106,7 +107,7 @@ export class Locker {
const chainId = parseInt(import.meta.env.VUE_APP_NET_ID_MAIN);
await this.bc.checkPassportLogin();
await this.bc.checkAndChangeChain(chainId, this.bc.eoaProvider);
return this.execUnlock(chainId, nft, tokenIds)
return this.execUnlock(this.bc.eoaProvider, chainId, nft, tokenIds)
}
// 游戏内资产上链, 只用于mint