mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
use getContract() with abiEnterprise in Datatoken
This commit is contained in:
parent
b6a9002bce
commit
ccd62ddecf
@ -54,8 +54,8 @@ export abstract class SmartContract {
|
|||||||
return getFairGasPrice(this.web3, this.config)
|
return getFairGasPrice(this.web3, this.config)
|
||||||
}
|
}
|
||||||
|
|
||||||
getContract(address: string, account?: string): Contract {
|
getContract(address: string, account?: string, abi?: AbiItem | AbiItem[]): Contract {
|
||||||
const contract = new this.web3.eth.Contract(this.abi, address, {
|
const contract = new this.web3.eth.Contract(abi || this.abi, address, {
|
||||||
from: account
|
from: account
|
||||||
})
|
})
|
||||||
return setContractDefaults(contract, this.config)
|
return setContractDefaults(contract, this.config)
|
||||||
|
@ -882,7 +882,7 @@ export class Datatoken extends SmartContract {
|
|||||||
contractInstance?: Contract
|
contractInstance?: Contract
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const dtContract =
|
const dtContract =
|
||||||
contractInstance || new this.web3.eth.Contract(this.abiEnterprise, dtAddress)
|
contractInstance || this.getContract(dtAddress, null, this.abiEnterprise)
|
||||||
|
|
||||||
return estimateGas(
|
return estimateGas(
|
||||||
address,
|
address,
|
||||||
@ -905,7 +905,7 @@ export class Datatoken extends SmartContract {
|
|||||||
orderParams: OrderParams,
|
orderParams: OrderParams,
|
||||||
freParams: FreOrderParams
|
freParams: FreOrderParams
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const dtContract = new this.web3.eth.Contract(this.abiEnterprise, dtAddress)
|
const dtContract = this.getContract(dtAddress, null, this.abiEnterprise)
|
||||||
try {
|
try {
|
||||||
const freContractParams = getFreOrderParams(freParams)
|
const freContractParams = getFreOrderParams(freParams)
|
||||||
|
|
||||||
@ -946,7 +946,7 @@ export class Datatoken extends SmartContract {
|
|||||||
contractInstance?: Contract
|
contractInstance?: Contract
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const dtContract =
|
const dtContract =
|
||||||
contractInstance || new this.web3.eth.Contract(this.abiEnterprise, dtAddress)
|
contractInstance || this.getContract(dtAddress, null, this.abiEnterprise)
|
||||||
|
|
||||||
return estimateGas(
|
return estimateGas(
|
||||||
address,
|
address,
|
||||||
@ -969,7 +969,7 @@ export class Datatoken extends SmartContract {
|
|||||||
orderParams: OrderParams,
|
orderParams: OrderParams,
|
||||||
dispenserContract: string
|
dispenserContract: string
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const dtContract = new this.web3.eth.Contract(this.abiEnterprise, dtAddress)
|
const dtContract = this.getContract(dtAddress, null, this.abiEnterprise)
|
||||||
try {
|
try {
|
||||||
const estGas = await estimateGas(
|
const estGas = await estimateGas(
|
||||||
address,
|
address,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user