1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

review updates

This commit is contained in:
Bogdan Fazakas 2022-07-29 05:12:06 +03:00
parent 7955fc809b
commit 2af05c32c2
3 changed files with 5 additions and 2 deletions

View File

@ -82,7 +82,7 @@ export class NftFactory extends SmartContractWithAddress {
gasPrice: await this.getFairGasPrice()
})
return trxReceipt.events.NFTCreated.returnValues[0]
return trxReceipt?.events?.NFTCreated?.returnValues?.[0]
}
/** Get Current NFT Count (NFT created)

View File

@ -18,6 +18,9 @@ export class Dispenser extends SmartContractWithAddress {
*/
public async status(dtAdress: string): Promise<DispenserToken> {
const status: DispenserToken = await this.contract.methods.status(dtAdress).call()
if (!status) {
throw new Error(`Np dispenser found for the given datatoken address`)
}
status.maxTokens = this.web3.utils.fromWei(status.maxTokens)
status.maxBalance = this.web3.utils.fromWei(status.maxBalance)
status.balance = this.web3.utils.fromWei(status.balance)

View File

@ -78,7 +78,7 @@ export class Nft extends SmartContract {
gasPrice: await this.getFairGasPrice()
})
return trxReceipt.events.TokenCreated.returnValues[0]
return trxReceipt?.events?.TokenCreated?.returnValues?.[0]
}
/**