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,
|
amount: number,
|
||||||
account: Account
|
account: Account
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const datatoken = new this.web3.eth.Contract(
|
const weiAmount = this.web3.utils.toWei(String(amount))
|
||||||
this.datatokensABI,
|
return this.transferWei(dataTokenAddress, toAddress, weiAmount, account)
|
||||||
dataTokenAddress,
|
|
||||||
{ from: account }
|
|
||||||
)
|
|
||||||
const trxReceipt = await datatoken.methods
|
|
||||||
.transfer(toAddress, this.web3.utils.toWei(String(amount)))
|
|
||||||
.send()
|
|
||||||
return trxReceipt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -232,8 +225,8 @@ export class DataTokens {
|
|||||||
dataTokenAddress,
|
dataTokenAddress,
|
||||||
{ from: account }
|
{ from: account }
|
||||||
)
|
)
|
||||||
const trxReceipt = await datatoken.methods.balanceOf(account).call()
|
const balance = await datatoken.methods.balanceOf(account).call()
|
||||||
return this.web3.utils.fromWei(trxReceipt)
|
return this.web3.utils.fromWei(balance)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -371,7 +371,7 @@ export class Assets extends Instantiable {
|
|||||||
*/
|
*/
|
||||||
public async createAccessServiceAttributes(
|
public async createAccessServiceAttributes(
|
||||||
creator: Account,
|
creator: Account,
|
||||||
dtCost: string,
|
cost: string,
|
||||||
datePublished: string,
|
datePublished: string,
|
||||||
timeout: number = 0
|
timeout: number = 0
|
||||||
): Promise<ServiceAccess> {
|
): Promise<ServiceAccess> {
|
||||||
@ -383,7 +383,7 @@ export class Assets extends Instantiable {
|
|||||||
main: {
|
main: {
|
||||||
creator: creator.getId(),
|
creator: creator.getId(),
|
||||||
datePublished,
|
datePublished,
|
||||||
cost: dtCost,
|
cost,
|
||||||
timeout: timeout,
|
timeout: timeout,
|
||||||
name: 'dataAssetAccess'
|
name: 'dataAssetAccess'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user