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

use TransactionReceipt

This commit is contained in:
alexcos20 2020-09-01 00:27:33 -07:00
parent fec3670e6a
commit 9c7ea98fce

View File

@ -1,5 +1,6 @@
import defaultFixedRateExchangeABI from '@oceanprotocol/contracts/artifacts/FixedRateExchange.json' import defaultFixedRateExchangeABI from '@oceanprotocol/contracts/artifacts/FixedRateExchange.json'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import { TransactionReceipt } from 'web3-core'
export interface FixedPricedExchange { export interface FixedPricedExchange {
exchangeID?: string exchangeID?: string
@ -93,13 +94,13 @@ export class OceanFixedRateExchange {
* @param {String} exchangeId ExchangeId * @param {String} exchangeId ExchangeId
* @param {Number} dataTokenAmount Amount of Data Tokens * @param {Number} dataTokenAmount Amount of Data Tokens
* @param {String} address User address * @param {String} address User address
* @return {Promise<any>} transaction receipt * @return {Promise<TransactionReceipt>} transaction receipt
*/ */
public async buyDT( public async buyDT(
exchangeId: string, exchangeId: string,
dataTokenAmount: string, dataTokenAmount: string,
address: string address: string
): Promise<any> { ): Promise<TransactionReceipt> {
let estGas let estGas
try { try {
estGas = await this.contract.methods estGas = await this.contract.methods
@ -144,13 +145,13 @@ export class OceanFixedRateExchange {
* @param {String} exchangeId ExchangeId * @param {String} exchangeId ExchangeId
* @param {Number} newRate New rate * @param {Number} newRate New rate
* @param {String} address User account * @param {String} address User account
* @return {Promise<any>} transaction receipt * @return {Promise<TransactionReceipt>} transaction receipt
*/ */
public async setRate( public async setRate(
exchangeId: string, exchangeId: string,
newRate: number, newRate: number,
address: string address: string
): Promise<any> { ): Promise<TransactionReceipt> {
let estGas let estGas
try { try {
estGas = await this.contract.methods estGas = await this.contract.methods
@ -178,9 +179,12 @@ export class OceanFixedRateExchange {
* Activate an exchange * Activate an exchange
* @param {String} exchangeId ExchangeId * @param {String} exchangeId ExchangeId
* @param {String} address User address * @param {String} address User address
* @return {Promise<any>} transaction receipt * @return {Promise<TransactionReceipt>} transaction receipt
*/ */
public async activate(exchangeId: string, address: string): Promise<any> { public async activate(
exchangeId: string,
address: string
): Promise<TransactionReceipt> {
let estGas let estGas
try { try {
estGas = await this.contract.methods estGas = await this.contract.methods
@ -206,9 +210,12 @@ export class OceanFixedRateExchange {
* Deactivate an exchange * Deactivate an exchange
* @param {String} exchangeId ExchangeId * @param {String} exchangeId ExchangeId
* @param {String} address User address * @param {String} address User address
* @return {Promise<any>} transaction receipt * @return {Promise<TransactionReceipt>} transaction receipt
*/ */
public async deactivate(exchangeId: string, address: string): Promise<any> { public async deactivate(
exchangeId: string,
address: string
): Promise<TransactionReceipt> {
let estGas let estGas
try { try {
estGas = await this.contract.methods estGas = await this.contract.methods