Skip to content

Commit

Permalink
4th pass
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Nov 29, 2024
1 parent bd519f3 commit bf94e10
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/contracts/AccessList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Signer } from 'ethers'
import AccessList from '@oceanprotocol/contracts/artifacts/contracts/accesslists/AccessList.sol/AccessList.json'
import { sendTx } from '../utils'
import { sendTx } from '../utils/ContractUtils'
import { AbiItem, ReceiptOrEstimate } from '../@types'
import { Config } from '../config'
import { SmartContractWithAddress } from './SmartContractWithAddress'
Expand Down
4 changes: 3 additions & 1 deletion src/contracts/AccessListFactory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { BigNumber, Signer } from 'ethers'
import { Config } from '../config'
import AccessListFactory from '@oceanprotocol/contracts/artifacts/contracts/accesslists/AccessListFactory.sol/AccessListFactory.json'
import { generateDtName, sendTx, getEventFromTx, ZERO_ADDRESS } from '../utils'
import { sendTx, getEventFromTx } from '../utils/ContractUtils'
import { ZERO_ADDRESS } from '../utils/Constants'
import { AbiItem, ReceiptOrEstimate } from '../@types'
import { SmartContractWithAddress } from './SmartContractWithAddress'
import { generateDtName } from '../utils/DatatokenName'

/**
* Provides an interface for Access List Factory contract
Expand Down
3 changes: 2 additions & 1 deletion src/contracts/Datatoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { ethers, Signer } from 'ethers'
import Decimal from 'decimal.js'
import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json'
import ERC20TemplateEnterprise from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json'
import { amountToUnits, sendTx, ZERO_ADDRESS } from '../utils'
import { amountToUnits, sendTx } from '../utils/ContractUtils'
import { ZERO_ADDRESS } from '../utils/Constants'
import {
AbiItem,
ConsumeMarketFee,
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Datatoken4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ERC20Template4 from '@oceanprotocol/contracts/artifacts/contracts/templat
import { AbiItem, ReceiptOrEstimate } from '../@types'
import { AccessListContract } from './AccessList'
import { Config } from '../config'
import { sendTx } from '../utils'
import { sendTx } from '../utils/ContractUtils'

export class Datatoken4 extends Datatoken {
public accessList: AccessListContract
Expand Down
7 changes: 4 additions & 3 deletions src/contracts/NFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {
AbiItem
} from '../@types'
import { SmartContract } from './SmartContract'

import { generateDtName } from '../utils/DatatokenName'
import { ZERO_ADDRESS } from '../utils/Constants'
import { getEventFromTx, sendTx } from '../utils/ContractUtils'
import {
calculateActiveTemplateIndex,
getOceanArtifactsAdressesByChainId
} from '../utils/Assets'
import { generateDtName } from '../utils/DatatokenName'
import { ZERO_ADDRESS } from '../utils/Constants'
import { getEventFromTx, sendTx } from '../utils/ContractUtils'

export class Nft extends SmartContract {
getDefaultAbi() {
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/df/DfRewards.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dfRewardsABI from '@oceanprotocol/contracts/artifacts/contracts/df/DFRewards.sol/DFRewards.json'
import { sendTx } from '../../utils'
import { sendTx } from '../../utils/ContractUtils'
import { SmartContractWithAddress } from '../SmartContractWithAddress'
import { AbiItem, ReceiptOrEstimate } from '../../@types'

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/df/DfStrategyV1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dfStrategyV1ABI from '@oceanprotocol/contracts/artifacts/contracts/df/DFStrategyV1.sol/DFStrategyV1.json'
import { sendTx } from '../../utils'
import { sendTx } from '../../utils/ContractUtils'
import { SmartContractWithAddress } from '../SmartContractWithAddress'
import { ReceiptOrEstimate, AbiItem } from '../../@types'
/**
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/ve/VeAllocate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import veAllocateABI from '@oceanprotocol/contracts/artifacts/contracts/ve/veAllocate.sol/veAllocate.json'
import { sendTx } from '../../utils'
import { sendTx } from '../../utils/ContractUtils'
import { SmartContractWithAddress } from '../SmartContractWithAddress'
import { ReceiptOrEstimate, AbiItem } from '../../@types'
/**
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/ve/VeFeeDistributor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import veFeeABI from '@oceanprotocol/contracts/artifacts/contracts/ve/veFeeDistributor.vy/veFeeDistributor.json'
import { sendTx } from '../../utils'
import { sendTx } from '../../utils/ContractUtils'
import { SmartContractWithAddress } from '../SmartContractWithAddress'
import { ReceiptOrEstimate, AbiItem } from '../../@types'
/**
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/ve/VeOcean.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import veOceanABI from '@oceanprotocol/contracts/artifacts/contracts/ve/veOCEAN.vy/veOCEAN.json'
import { sendTx } from '../../utils'
import { sendTx } from '../../utils/ContractUtils'
import { SmartContractWithAddress } from '../SmartContractWithAddress'
import { ReceiptOrEstimate, AbiItem } from '../../@types'
/**
Expand Down
3 changes: 2 additions & 1 deletion src/services/Aquarius.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fetch from 'cross-fetch'
import { LoggerInstance, sleep } from '../utils'
import { LoggerInstance } from '../utils/Logger'
import { Asset, DDO, ValidateMetadata } from '../@types'
import { sleep } from '../utils/General'

export interface SearchQuery {
from?: number
Expand Down
2 changes: 1 addition & 1 deletion src/services/Provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fetch from 'cross-fetch'
import { ethers, Signer, providers } from 'ethers'
import { LoggerInstance } from '../utils'
import { LoggerInstance } from '../utils/Logger'
import {
Arweave,
FileInfo,
Expand Down
26 changes: 11 additions & 15 deletions src/utils/OrderUtils.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { Signer } from 'ethers'
import {
ProviderInstance,
Datatoken,
Dispenser,
Config,
OrderParams,
Asset,
FreOrderParams,
approve,
FixedRateExchange,
ConsumeMarketFee,
ProviderFees,
ZERO_ADDRESS,
approveWei
} from '../index'
import Decimal from 'decimal.js'
import { Asset } from '../@types/Asset'
import { Config } from '../config/Config'
import { Datatoken } from '../contracts/Datatoken'
import { ConsumeMarketFee, OrderParams } from '../@types/Datatoken'
import { ProviderFees } from '../@types/Provider'
import { ProviderInstance } from '../services/Provider'
import { ZERO_ADDRESS } from './Constants'
import { approve, approveWei } from './TokenUtils'
import { Dispenser } from '../contracts/Dispenser'
import { FixedRateExchange } from '../contracts/FixedRateExchange'
import { FreOrderParams } from '../@types/FixedPrice'

/**
* Orders an asset based on the specified pricing schema and configuration.
Expand Down

0 comments on commit bf94e10

Please sign in to comment.