1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

fix return value of token transfer

This commit is contained in:
Alex 2020-04-17 01:16:21 +03:00
parent a2f1985079
commit 0f39b44276
2 changed files with 5 additions and 3 deletions

View File

@ -90,11 +90,10 @@ export abstract class ContractBase extends Instantiable {
const estimatedGas = await methodInstance.estimateGas(args, {
from
})
const tx = methodInstance.send({
return methodInstance.send({
from,
gas: estimatedGas
})
return tx
} catch (err) {
const mappedArgs = this.searchMethod(name, args).inputs.map((input, i) => {
return {

View File

@ -1,4 +1,5 @@
import BigNumber from 'bignumber.js'
import { TransactionReceipt } from 'web3-core'
import ContractBase from './ContractBase'
import { InstantiableConfig } from '../../Instantiable.abstract'
@ -24,6 +25,8 @@ export default class OceanToken extends ContractBase {
}
public async transfer(to: string, amount: number, from: string) {
return this.send('transfer', from, [to, amount])
return this.send('transfer', from, [to, amount]).then(
(result: TransactionReceipt) => result.transactionHash
)
}
}