mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
resolve comments
This commit is contained in:
parent
1b2522e679
commit
ed8eef68d8
@ -159,15 +159,8 @@ export class DataTokens {
|
||||
amount: number,
|
||||
account: Account
|
||||
): Promise<string> {
|
||||
const datatoken = new this.web3.eth.Contract(
|
||||
this.datatokensABI,
|
||||
dataTokenAddress,
|
||||
{ from: account }
|
||||
)
|
||||
const trxReceipt = await datatoken.methods
|
||||
.transfer(toAddress, this.web3.utils.toWei(String(amount)))
|
||||
.send()
|
||||
return trxReceipt
|
||||
const weiAmount = this.web3.utils.toWei(String(amount))
|
||||
return this.transferWei(dataTokenAddress, toAddress, weiAmount, account)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,8 +225,8 @@ export class DataTokens {
|
||||
dataTokenAddress,
|
||||
{ from: account }
|
||||
)
|
||||
const trxReceipt = await datatoken.methods.balanceOf(account).call()
|
||||
return this.web3.utils.fromWei(trxReceipt)
|
||||
const balance = await datatoken.methods.balanceOf(account).call()
|
||||
return this.web3.utils.fromWei(balance)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -371,7 +371,7 @@ export class Assets extends Instantiable {
|
||||
*/
|
||||
public async createAccessServiceAttributes(
|
||||
creator: Account,
|
||||
dtCost: string,
|
||||
cost: string,
|
||||
datePublished: string,
|
||||
timeout: number = 0
|
||||
): Promise<ServiceAccess> {
|
||||
@ -383,7 +383,7 @@ export class Assets extends Instantiable {
|
||||
main: {
|
||||
creator: creator.getId(),
|
||||
datePublished,
|
||||
cost: dtCost,
|
||||
cost,
|
||||
timeout: timeout,
|
||||
name: 'dataAssetAccess'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user