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:
parent
7955fc809b
commit
2af05c32c2
@ -82,7 +82,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
gasPrice: await this.getFairGasPrice()
|
gasPrice: await this.getFairGasPrice()
|
||||||
})
|
})
|
||||||
|
|
||||||
return trxReceipt.events.NFTCreated.returnValues[0]
|
return trxReceipt?.events?.NFTCreated?.returnValues?.[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get Current NFT Count (NFT created)
|
/** Get Current NFT Count (NFT created)
|
||||||
|
@ -18,6 +18,9 @@ export class Dispenser extends SmartContractWithAddress {
|
|||||||
*/
|
*/
|
||||||
public async status(dtAdress: string): Promise<DispenserToken> {
|
public async status(dtAdress: string): Promise<DispenserToken> {
|
||||||
const status: DispenserToken = await this.contract.methods.status(dtAdress).call()
|
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.maxTokens = this.web3.utils.fromWei(status.maxTokens)
|
||||||
status.maxBalance = this.web3.utils.fromWei(status.maxBalance)
|
status.maxBalance = this.web3.utils.fromWei(status.maxBalance)
|
||||||
status.balance = this.web3.utils.fromWei(status.balance)
|
status.balance = this.web3.utils.fromWei(status.balance)
|
||||||
|
@ -78,7 +78,7 @@ export class Nft extends SmartContract {
|
|||||||
gasPrice: await this.getFairGasPrice()
|
gasPrice: await this.getFairGasPrice()
|
||||||
})
|
})
|
||||||
|
|
||||||
return trxReceipt.events.TokenCreated.returnValues[0]
|
return trxReceipt?.events?.TokenCreated?.returnValues?.[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user