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:
parent
a2f1985079
commit
0f39b44276
@ -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 {
|
||||
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user