Ocean.js v1.0.0-next.43

JavaScript client library for Ocean Protocol

FixedRateCreateProgressStep

ApprovingDatatoken

Enumeration member
private
src/pools/fixedRate/FixedRateExchange.ts#L54

CreatingExchange

Enumeration member
private
src/pools/fixedRate/FixedRateExchange.ts#L53

LogLevel

Error

Enumeration member
private
src/utils/Logger.ts#L4

Log

Enumeration member
private
src/utils/Logger.ts#L6

None

Enumeration member
private
src/utils/Logger.ts#L3

Verbose

Enumeration member
private
src/utils/Logger.ts#L7

Warn

Enumeration member
private
src/utils/Logger.ts#L5

Aquarius

constructor

Constructor
private
Instantiate Aquarius
src/aquarius/Aquarius.ts#L10

aquariusURL

Property
aquariusURL
src/aquarius/Aquarius.ts#L5

resolve

Method
Resolves a DID

Parameters

did
string

signal?
AbortSignal

abort signal

Returns

Promise<Asset>
src/aquarius/Aquarius.ts#L19

validate

Method
Validate DDO content

Parameters

ddo

DID Descriptor Object content.

signal?
AbortSignal

abort signal

Returns

Promise<ValidateMetadata>
src/aquarius/Aquarius.ts#L88

waitForAqua

Method
Blocks until Aqua will cache the did (or the update for that did) or timeouts

Parameters

did
string

DID of the asset.

txid?
string

used when the did exists and we expect an update with that txid.

signal?
AbortSignal

abort signal

Returns

Promise<Asset>
src/aquarius/Aquarius.ts#L50

Config

constructor

Constructor
private

authMessage

Property
Message shown when the user creates its own token.
authMessage
src/models/Config.ts#L128

authTokenExpiration

Property
Token expiration time in ms.
authTokenExpiration
src/models/Config.ts#L134

chainId

Property
private
Chain ID
chainId
src/models/Config.ts#L148

datatokensABI

Property
datatokens ABI
datatokensABI
src/models/Config.ts#L57

dispenserABI

Property
DispenserABI
dispenserABI
src/models/Config.ts#L99

dispenserAddress

Property
DispenserAddress
dispenserAddress
src/models/Config.ts#L93

erc721FFactoryABI

Property
Factory ABI
erc721FFactoryABI
src/models/Config.ts#L51

erc721FactoryAddress

Property
Factory address
erc721FactoryAddress
src/models/Config.ts#L45

explorerUri

Property
private
Url of the blockchain exporer ex: https://etherscan.io
explorerUri
src/models/Config.ts#L166

fixedRateExchangeAddress

Property
FixedRateExchangeAddress
fixedRateExchangeAddress
src/models/Config.ts#L81

fixedRateExchangeAddressABI

Property
FixedRateExchangeAddressABI
fixedRateExchangeAddressABI
src/models/Config.ts#L87

gasFeeMultiplier

Property
private
Specify the multiplier for the gas fee
gasFeeMultiplier
src/models/Config.ts#L196

metadataCacheUri

Property
Metadata Store URL.
metadataCacheUri
src/models/Config.ts#L21

network

Property
private
Network name ex: mainnet, rinkeby, polygon
network
src/models/Config.ts#L154

nodeUri

Property
Ethereum node URL.
nodeUri
src/models/Config.ts#L9

oceanTokenAddress

Property
Ocean Token address
oceanTokenAddress
src/models/Config.ts#L39

oceanTokenSymbol

Property
private
Ocean toke symbol on the chain, it's used just for convenience to reduce number of calls
oceanTokenSymbol
src/models/Config.ts#L172

opfCommunityFeeCollector

Property
OPFCommunityFeeCollector
opfCommunityFeeCollector
src/models/Config.ts#L105

parityUri

Property
Parity config
parityUri
src/models/Config.ts#L140

poolABI

Property
Pool ABI
poolABI
src/models/Config.ts#L75

poolFactoryABI

Property
Pool Factory ABI
poolFactoryABI
src/models/Config.ts#L69

poolTemplateAddress

Property
Pool Template address
poolTemplateAddress
src/models/Config.ts#L63

providerAddress

Property
Address of Provider.
providerAddress
src/models/Config.ts#L15

providerUri

Property
Provider URL.
providerUri
src/models/Config.ts#L27

sideStakingAddress

Property
SideStaking address
sideStakingAddress
src/models/Config.ts#L111

startBlock

Property
block number of the deployment
startBlock
src/models/Config.ts#L117

subgraphUri

Property
private
Url of the relevant subgraph instance ex: https://subgraph.mainnet.oceanprotocol.com
subgraphUri
src/models/Config.ts#L160

threshold

Property
threshold
src/models/Config.ts#L142

transactionBlockTimeout

Property
private
Specify the transaction Block Timeout
transactionBlockTimeout
src/models/Config.ts#L178

transactionConfirmationBlocks

Property
private
Specify the transaction Confirmation Blocks
transactionConfirmationBlocks
src/models/Config.ts#L184

transactionPollingTimeout

Property
private
Specify the transaction Polling Blocks Timeout
transactionPollingTimeout
src/models/Config.ts#L190

verbose

Property
Log level.
verbose
src/models/Config.ts#L122

web3Provider

Property
Web3 Provider.
web3Provider
src/models/Config.ts#L33

ConfigHelper

constructor

Constructor
private

getAddressesFromEnv

Method

Parameters

network
string

customAddresses?
any

Returns

Partial<Config>
src/utils/ConfigHelper.ts#L145

getConfig

Method

Parameters

network

infuraProjectId?
string

Returns

src/utils/ConfigHelper.ts#L210

Datatoken

constructor

Constructor
private
Instantiate ERC20 Datatokens
src/tokens/Datatoken.ts#L62

config

Property
config
src/tokens/Datatoken.ts#L54

datatokensAbi

Property
datatokensAbi
src/tokens/Datatoken.ts#L51

datatokensEnterpriseAbi

Property
datatokensEnterpriseAbi
src/tokens/Datatoken.ts#L52

factoryABI

Property
factoryABI
src/tokens/Datatoken.ts#L50

factoryAddress

Property
factoryAddress
src/tokens/Datatoken.ts#L49

addMinter

Method
Add Minter for an ERC20 datatoken only ERC20Deployer can succeed

Parameters

dtAddress
string

Datatoken address

address
string

User address

minter
string

User which is going to be a Minter

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L464

addPaymentManager

Method
Add addPaymentManager (can set who's going to collect fee when consuming orders) only ERC20Deployer can succeed

Parameters

dtAddress
string

Datatoken address

address
string

User address

paymentManager
string

User which is going to be a Minter

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L583

approve

Method
Approve

Parameters

dtAddress
string

Datatoken address

spender
string

Spender address

amount
string

Number of datatokens, as number. Will be converted to wei

address
string

User adress

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L116

balance

Method
Get Address Balance for datatoken

Parameters

datatokenAddress
string

address
string

user adress

Returns

Promise<string>
src/tokens/Datatoken.ts#L1307

buyFromDispenserAndOrder

Method
Gets DT from dispenser and then startsOrder, while burning that DT

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderParams

dispenserContract
string

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L1096

buyFromFreAndOrder

Method
Buys 1 DT from the FRE and then startsOrder, while burning that DT

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderParams

Consumer Address

freParams

Amount of tokens that is going to be transfered

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L1031

cleanPermissions

Method
Clean erc20level Permissions (minters, paymentManager and reset the paymentCollector) for an ERC20 datatoken Only NFT Owner (at 721 level) can call it.

Parameters

dtAddress
string

Datatoken address where we want to clean permissions

address
string

User adress

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L1210

createDispenser

Method
Creates a new Dispenser

Parameters

dtAddress
string

Datatoken address

address
string

Caller address

dispenserAddress
string

ispenser contract address

dispenserParams

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L338

createFixedRate

Method
Creates a new FixedRateExchange setup.

Parameters

dtAddress
string

Datatoken address

address
string

Caller address

fixedRateParams

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L229

estGasAddMinter

Method
Estimate gas cost for addMinter method

Parameters

dtAddress
string

Datatoken address

address
string

User address

minter
string

User which is going to be a Minter

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L440

estGasAddPaymentManager

Method
Estimate gas for addPaymentManager method

Parameters

dtAddress
string

Datatoken address

address
string

User address

paymentManager
string

User which is going to be a Minter

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L559

estGasApprove

Method
Estimate gas cost for mint method

Parameters

dtAddress
string

Datatoken address

spender
string

Spender address

amount
string

Number of datatokens, as number. Will be converted to wei

address
string

User adress

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L86

estGasBuyFromDispenserAndOrder

Method
Estimate gas cost for buyFromFreAndOrder method

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderParams

dispenserContract
string

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L1070

estGasBuyFromFreAndOrder

Method
Estimate gas cost for buyFromFreAndOrder method

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderParams

Consumer Address

freParams

Amount of tokens that is going to be transfered

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L1005

estGasCleanPermissions

Method
Estimate gas for cleanPermissions method

Parameters

dtAddress
string

Datatoken address where we want to clean permissions

address
string

User adress

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L1188

estGasCreateDispenser

Method
Estimate gas cost for createDispenser method

Parameters

dtAddress
string

Datatoken address

address
string

Caller address

dispenserAddress
string

ispenser contract address

dispenserParams

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L301

estGasCreateFixedRate

Method
Estimate gas cost for createFixedRate method

Parameters

dtAddress
string

Datatoken address

address
string

Caller address

fixedRateParams

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L185

estGasMint

Method
Estimate gas cost for mint method

Parameters

dtAddress
string

Datatoken address

address
string

Minter address

amount
string

Number of datatokens, as number. Will be converted to wei

toAddress?
string

only if toAddress is different from the minter

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L154

estGasRemoveMinter

Method
Estimate gas for removeMinter method

Parameters

dtAddress
string

Datatoken address

address
string

User address

minter
string

User which will be removed from Minter permission

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L498

estGasRemovePaymentManager

Method
Estimate gas for removePaymentManager method

Parameters

dtAddress
string

Datatoken address

address
string

User address

paymentManager
string

User which will be removed from paymentManager permission

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L621

estGasReuseOrder

Method
Estimate gas cost for reuseOrder method

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderTxId
string

previous valid order

providerFees

provider fees

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L939

estGasSetData

Method
Estimate gas for setData method

Parameters

dtAddress
string

Datatoken address

address
string

User address

value
string

Data to be stored into 725Y standard

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L1132

estGasSetPaymentCollector

Method
Estimate gas for setPaymentCollector method

Parameters

dtAddress
string

datatoken address

address
string

Caller address

paymentCollector
string

User to be set as new payment collector

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L685

estGasStartOrder

Method
Estimate gas cost for startOrder method

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

consumer
string

Consumer Address

serviceIndex
number

Service index in the metadata

providerFees

provider fees

consumeMarketFee?

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L853

estGasTransfer

Method
Estimate gas for transfer method

Parameters

dtAddress
string

Datatoken address

toAddress
string

Receiver address

amount
string

Number of datatokens, as number. Expressed as wei

address
string

User adress

contractInstance?
Contract

optional contract instance

Returns

Promise<any>
src/tokens/Datatoken.ts#L788

getCap

Method
Returns the Datatoken capital

Parameters

dtAddress
string

Datatoken adress

Returns

Promise<string>
src/tokens/Datatoken.ts#L1252

getDTPermissions

Method
Returns ERC20 user's permissions for a datatoken

Parameters

dtAddress
string

Datatoken adress

address
string

user adress

Returns

Promise<Roles>
src/tokens/Datatoken.ts#L1239

getDecimals

Method
It returns the token decimals, how many supported decimal points

Parameters

dtAddress
string

Datatoken adress

Returns

Promise<string>
src/tokens/Datatoken.ts#L1265

getNFTAddress

Method
It returns the token decimals, how many supported decimal points

Parameters

dtAddress
string

Datatoken adress

Returns

Promise<string>
src/tokens/Datatoken.ts#L1278

getPaymentCollector

Method
getPaymentCollector - It returns the current paymentCollector

Parameters

dtAddress
string

datatoken address

Returns

Promise<string>
src/tokens/Datatoken.ts#L752

isERC20Deployer

Method
Returns true if address has deployERC20 role

Parameters

dtAddress
string

Datatoken adress

address
string

Returns

Promise<boolean>
src/tokens/Datatoken.ts#L1292

mint

Method
Mint

Parameters

dtAddress
string

Datatoken address

address
string

Minter address

amount
string

Number of datatokens, as number. Will be converted to wei

toAddress?
string

only if toAddress is different from the minter

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L394

removeMinter

Method
Revoke Minter permission for an ERC20 datatoken only ERC20Deployer can succeed

Parameters

dtAddress
string

Datatoken address

address
string

User address

minter
string

User which will be removed from Minter permission

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L525

removePaymentManager

Method
Revoke paymentManager permission for an ERC20 datatoken only ERC20Deployer can succeed

Parameters

dtAddress
string

Datatoken address

address
string

User address

paymentManager
string

User which will be removed from paymentManager permission

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L645

reuseOrder

Method
Reuse Order: called by payer or consumer having a valid order, but with expired provider access. Pays the provider fee again, but it will not require a new datatoken payment Requires previous approval of provider fee.

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

orderTxId
string

previous valid order

providerFees

provider fees

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L965

setData

Method
setData This function allows to store data with a preset key (keccak256(ERC20Address)) into NFT 725 Store only ERC20Deployer can succeed

Parameters

dtAddress
string

Datatoken address

address
string

User address

value
string

Data to be stored into 725Y standard

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L1156

setPaymentCollector

Method
This function allows to set a new PaymentCollector (receives DT when consuming) If not set the paymentCollector is the NFT Owner only NFT owner can call

Parameters

dtAddress
string

datatoken address

address
string

Caller address

paymentCollector
string

User to be set as new payment collector

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L710

startOrder

Method
Start Order: called by payer or consumer prior ordering a service consume on a marketplace.

Parameters

dtAddress
string

Datatoken address

address
string

User address which calls

consumer
string

Consumer Address

serviceIndex
number

Service index in the metadata

providerFees

provider fees

consumeMarketFee?

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L888

transfer

Method
Transfer as number from address to toAddress

Parameters

dtAddress
string

Datatoken address

toAddress
string

Receiver address

amount
string

Number of datatokens, as number. To be converted to wei.

address
string

User adress

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L769

transferWei

Method
Transfer in wei from address to toAddress

Parameters

dtAddress
string

Datatoken address

toAddress
string

Receiver address

amount
string

Number of datatokens, as number. Expressed as wei

address
string

User adress

Returns

Promise<TransactionReceipt>
src/tokens/Datatoken.ts#L813

Dispenser

constructor

Constructor
private
Instantiate Dispenser
src/pools/dispenser/Dispenser.ts#L40

dispenserAbi

Property
dispenserAbi
src/pools/dispenser/Dispenser.ts#L31

dispenserAddress

Property
dispenserAddress
src/pools/dispenser/Dispenser.ts#L29

dispenserContract

Property
dispenserContract
src/pools/dispenser/Dispenser.ts#L32

activate

Method
Activates a new dispener.

Parameters

dtAddress
string

refers to datatoken address.

maxTokens
string

max amount of tokens to dispense

maxBalance
string

max balance of user. If user balance is >, then dispense will be rejected

address
string

User address (must be owner of the datatoken)

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L179

create

Method
Creates a new Dispenser

Parameters

dtAddress
string

Datatoken address

address
string

Owner address

maxTokens
string

max tokens to dispense

maxBalance
string

max balance of requester

allowedSwapper
string

only account that can ask tokens. set address(0) if not required

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L114

deactivate

Method
Deactivate an existing dispenser.

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the datatoken)

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L228

dispense

Method
Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address

amount
string

amount of datatokens required.

destination
string

who will receive the tokens

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L337

estGasActivate

Method
Estimate gas for activate method

Parameters

dtAddress
string

maxTokens
string

max amount of tokens to dispense

maxBalance
string

max balance of user. If user balance is >, then dispense will be rejected

address
string

User address (must be owner of the datatoken)

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L156

estGasCreate

Method
Estimate gas cost for create method

Parameters

dtAddress
string

Datatoken address

address
string

Owner address

maxTokens
string

max tokens to dispense

maxBalance
string

max balance of requester

allowedSwapper
string

if !=0, only this address can request DTs

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L87

estGasDeactivate

Method
Estimate gas for deactivate method

Parameters

dtAddress
string

address
string

User address (must be owner of the datatoken)

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L218

estGasDispense

Method
Estimate gas for dispense method

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the datatoken)

amount
string

destination
string

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L312

estGasOwnerWithdraw

Method
Estimate gas for ownerWithdraw method

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the datatoken)

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L373

estGasSetAllowedSwapper

Method
Estimate gas for setAllowedSwapper method

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the datatoken)

newAllowedSwapper
string

refers to the new allowedSwapper

Returns

Promise<any>
src/pools/dispenser/Dispenser.ts#L258

isDispensable

Method
Check if tokens can be dispensed

Parameters

dtAddress
string

datatoken

address
string

User address that will receive datatokens

amount
string

amount of datatokens required.

Returns

Promise<Boolean>
src/pools/dispenser/Dispenser.ts#L415

ownerWithdraw

Method
Withdraw all tokens from the dispenser

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the dispenser)

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L383

setAllowedSwapper

Method
Sets a new allowedSwapper.

Parameters

dtAddress
string

refers to datatoken address.

address
string

User address (must be owner of the datatoken)

newAllowedSwapper
string

refers to the new allowedSwapper

Returns

Promise<TransactionReceipt>
src/pools/dispenser/Dispenser.ts#L278

status

Method
Get information about a datatoken dispenser

Parameters

dtAdress
string

Returns

Promise<DispenserToken>
src/pools/dispenser/Dispenser.ts#L63

FixedRateExchange

constructor

Constructor
private
Instantiate FixedRateExchange
src/pools/fixedRate/FixedRateExchange.ts#L75

fixedRateAddress

Property
fixedRateAddress
src/pools/fixedRate/FixedRateExchange.ts#L61

fixedRateContract

Property
fixedRateContract
src/pools/fixedRate/FixedRateExchange.ts#L63

fixedRateExchangeAbi

Property
fixedRateExchangeAbi
src/pools/fixedRate/FixedRateExchange.ts#L62

oceanAddress

Property
Ocean related functions
oceanAddress
src/pools/fixedRate/FixedRateExchange.ts#L60

activate

Method
Activate an exchange

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L442

activateMint

Method
Activate minting option for fixed rate contract

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L733

amountToUnits

Method
private

Parameters

token
string

amount
string

tokenDecimals
number

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L95

buyDT

Method
Atomic swap

Parameters

address
string

User address

exchangeId
string

ExchangeId

datatokenAmount
string

Amount of datatokens

maxBaseTokenAmount
string

max amount of baseToken we want to pay for datatokenAmount

consumeMarketAddress
string

consumeMarketAddress

consumeMarketFee
string

consumeMarketFee in fraction

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L166

calcBaseInGivenOutDT

Method
calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens

Parameters

exchangeId
string

ExchangeId

datatokenAmount
string

Amount of datatokens user wants to buy

consumeMarketFee
string

consumeMarketFee in fraction

Returns

Promise<PriceAndFees>
src/pools/fixedRate/FixedRateExchange.ts#L558

collectBT

Method
Collect BaseTokens in the contract (anyone can call this, funds are sent to erc20.paymentCollector)

Parameters

address
string

User address

exchangeId
string

ExchangeId

amount
string

amount to be collected

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L839

collectDT

Method
Collect datatokens in the contract (anyone can call this, funds are sent to erc20.paymentCollector)

Parameters

address
string

User address

exchangeId
string

ExchangeId

amount
string

amount to be collected

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L905

collectMarketFee

Method
Collect market fee and send it to marketFeeCollector (anyone can call it)

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L960

collectOceanFee

Method
Collect ocean fee and send it to OPF collector (anyone can call it)

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L1003

deactivate

Method
Deactivate an exchange

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L486

deactivateMint

Method
Deactivate minting for fixed rate

Parameters

address
string

User address

exchangeId
string

ExchangeId

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L780

estActivate

Method
Estimate gas cost for activate

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L426

estActivateMint

Method
Estimate gas cost for activate

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L717

estBuyDT

Method
Estimate gas cost for buyDT

Parameters

account
string

datatokenAddress
string

datatokenAddress

dtAmount
string

datatoken amount we want to buy

maxBaseTokenAmount
string

consumeMarketAddress
string

consumeMarketAddress

consumeMarketFee
string

fee recieved by the consume market when a dt is bought from a fixed rate exchange, percent

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L134

estCollectBT

Method
Estimate gas cost for collectBT

Parameters

account
string

exchangeId
string

ExchangeId

amount
string

amount to be collected

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L814

estCollectDT

Method
Estimate gas cost for collecDT

Parameters

account
string

exchangeId
string

ExchangeId

amount
string

amount to be collected

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L879

estCollectMarketFee

Method
Estimate gas cost for collecMarketFee

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L944

estCollectOceanFee

Method
Estimate gas cost for collectOceanFee

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L987

estDeactivate

Method
Estimate gas cost for deactivate

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L470

estDeactivateMint

Method
Estimate gas cost for deactivate

Parameters

account
string

exchangeId
string

ExchangeId

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L764

estSellDT

Method
Estimate gas cost for sellDT

Parameters

account
string

datatokenAddress
string

datatokenAddress

dtAmount
string

datatoken amount we want to sell

maxBaseTokenAmount
string

consumeMarketAddress
string

consumeMarketAddress

consumeMarketFee
string

consumeMarketFee

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L227

estSetAllowedSwapper

Method
Estimate gas cost for setRate

Parameters

account
string

exchangeId
string

ExchangeId

newAllowedSwapper
string

new allowed swapper address

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L380

estSetRate

Method
Estimate gas cost for setRate

Parameters

account
string

exchangeId
string

ExchangeId

newRate
string

New rate

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L328

estUpdateMarketFee

Method
Estimate gas cost for updateMarketFee

Parameters

account
string

exchangeId
string

ExchangeId

newMarketFee
string

New market fee

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L1060

estUpdateMarketFeeCollector

Method
Estimate gas cost for updateMarketFeeCollector

Parameters

account
string

exchangeId
string

ExchangeId

newMarketFeeCollector
string

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L1112

generateExchangeId

Method
Creates unique exchange identifier.

Parameters

baseToken
string

baseToken contract address

datatoken
string

Datatoken contract address

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L117

getAllowedSwapper

Method
Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0))

Parameters

exchangeId
string

ExchangeId

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L547

getAmountBTOut

Method
getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold

Parameters

exchangeId
string

ExchangeId

datatokenAmount
string

Amount of datatokens

consumeMarketFee
string

consumeMarketFee in fraction

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L608

getBTSupply

Method
Get BaseToken Supply in the exchange

Parameters

exchangeId
string

ExchangeId

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L536

getDTSupply

Method
Get Datatoken Supply in the exchange

Parameters

exchangeId
string

ExchangeId

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L525

getExchange

Method
Get exchange details

Parameters

exchangeId
string

ExchangeId

Returns

Promise<FixedPriceExchange>
src/pools/fixedRate/FixedRateExchange.ts#L634

getExchangeOwner

Method
private
Get Exchange Owner given an exchangeId

Parameters

exchangeId
string

ExchangeId

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L1042

getExchanges

Method
Get all exchanges

Returns

Promise<>
src/pools/fixedRate/FixedRateExchange.ts#L696

getFeesInfo

Method
Get fee details for an exchange

Parameters

exchangeId
string

ExchangeId

Returns

Promise<FeesInfo>
src/pools/fixedRate/FixedRateExchange.ts#L670

getNumberOfExchanges

Method
Gets total number of exchanges

Returns

Promise<number>
src/pools/fixedRate/FixedRateExchange.ts#L315

getRate

Method
Get Rate

Parameters

exchangeId
string

ExchangeId

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L514

getRouter

Method
private
Get Router address set in fixed rate contract

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L1027

isActive

Method
Check if an exchange is active

Parameters

exchangeId
string

ExchangeId

Returns

Promise<boolean>
src/pools/fixedRate/FixedRateExchange.ts#L705

sellDT

Method
Atomic swap

Parameters

address
string

User address

exchangeId
string

ExchangeId

datatokenAmount
string

Amount of datatokens

minBaseTokenAmount
string

min amount of baseToken we want to receive back

consumeMarketAddress
string

consumeMarketAddress

consumeMarketFee
string

consumeMarketFee in fraction

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L259

setAllowedSwapper

Method
Set new rate

Parameters

address
string

User account

exchangeId
string

ExchangeId

newAllowedSwapper
string

newAllowedSwapper (set address zero if we want to remove allowed swapper)

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L398

setRate

Method
Set new rate

Parameters

address
string

User account

exchangeId
string

ExchangeId

newRate
string

New rate

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L351

unitsToAmount

Method
private

Parameters

token
string

amount
string

tokenDecimals
number

Returns

Promise<string>
src/pools/fixedRate/FixedRateExchange.ts#L103

updateMarketFee

Method
Set new market fee, only market fee collector can update it

Parameters

address
string

user address

exchangeId
string

ExchangeId

newMarketFee
string

New market fee

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L1083

updateMarketFeeCollector

Method
Set new market fee collector, only market fee collector can update it

Parameters

address
string

user address

exchangeId
string

ExchangeId

newMarketFeeCollector
string

New market fee collector

Returns

Promise<TransactionReceipt>
src/pools/fixedRate/FixedRateExchange.ts#L1135

Logger

constructor

Constructor
private
src/utils/Logger.ts#L12

bypass

Method

Parameters

args
any[]

Returns

void
src/utils/Logger.ts#L18

debug

Method

Parameters

args
any[]

Returns

void
src/utils/Logger.ts#L22

dispatch

Method
private

Parameters

verb
string

args
any[]

Returns

void
src/utils/Logger.ts#L38

error

Method

Parameters

args
any[]

Returns

void
src/utils/Logger.ts#L34

log

Method

Parameters

args
any[]

Returns

void
src/utils/Logger.ts#L26

setLevel

Method

Parameters

logLevel

Returns

void
src/utils/Logger.ts#L14

warn

Method

Parameters

args
any[]

Returns

void
src/utils/Logger.ts#L30

Nft

constructor

Constructor
private
src/tokens/NFT.ts#L36

config

Property
config
src/tokens/NFT.ts#L34

factory721Abi

Property
factory721Abi
src/tokens/NFT.ts#L30

factory721Address

Property
factory721Address
src/tokens/NFT.ts#L29

nftAbi

Property
nftAbi
src/tokens/NFT.ts#L31

startBlock

Property
startBlock
src/tokens/NFT.ts#L33

web3

Property
web3
src/tokens/NFT.ts#L32

addErc20Deployer

Method
Add ERC20Deployer permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

erc20Deployer
string

User adress which is going to have erc20Deployer permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L307

addManager

Method
Add Manager for NFT Contract (only NFT Owner can succeed)

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

manager
string

User adress which is going to be assing manager

Returns

Promise<any>
src/tokens/NFT.ts#L203

addMetadataUpdater

Method
Add Metadata Updater permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

metadataUpdater
string

User adress which is going to have Metadata Updater permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L441

addStoreUpdater

Method
Add Store Updater permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

storeUpdater
string

User adress which is going to have Store Updater permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L574

cleanPermissions

Method
This function allows to remove all ROLES at erc721 level: Managers, ERC20Deployer, MetadataUpdater, StoreUpdater Even NFT Owner has to readd himself as Manager Permissions at erc20 level stay. Only NFT Owner can call it.

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L703

createErc20

Method
Create new ERC20 datatoken - only user with ERC20Deployer permission can succeed

Parameters

nftAddress
string

ERC721 addreess

address
string

User address

minter
string

User set as initial minter for the ERC20

paymentCollector
string

initial paymentCollector for this DT

mpFeeAddress
string

Consume marketplace fee address

feeToken
string

address of the token marketplace wants to add fee on top

feeAmount
string

amount of feeToken to be transferred to mpFeeAddress on top, will be converted to WEI

cap
string

Maximum cap (Number) - will be converted to wei

name?
string

Token name

symbol?
string

Token symbol

templateIndex?
number

NFT template index

Returns

Promise<string>
src/tokens/NFT.ts#L109

esGasRemoveMetadataUpdater

Method
Estimate gas cost for removeFromMetadataList method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

metadataUpdater
string

Address of the user to be revoked Metadata updater Permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L479

estGasAddErc20Deployer

Method
Estimate gas cost for addToCreateERC20List method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

erc20Deployer
string

User adress which is going to have erc20Deployer permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L285

estGasAddManager

Method
Estimate gas cost for add manager call

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

manager
string

User adress which is going to be assing manager

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L180

estGasAddMetadataUpdater

Method
Estimate gas cost for addToMetadataList method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

metadataUpdater
string

User adress which is going to have Metadata Updater permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L418

estGasAddStoreUpdater

Method
Estimate gas cost for addTo725StoreList method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

storeUpdater
string

User adress which is going to have Store Updater permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L551

estGasCleanPermissions

Method
Estimate gas cost for cleanPermissions method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L678

estGasCreateErc20

Method
Estimate gas cost for createERC20 token creation

Parameters

nftAddress
string

ERC721 addreess

address
string

User address

minter
string

User set as initial minter for the ERC20

paymentCollector
string

initial paymentCollector for this DT

mpFeeAddress
string

Consume marketplace fee address

feeToken
string

address of the token marketplace wants to add fee on top

feeAmount
string

amount of feeToken to be transferred to mpFeeAddress on top, will be converted to WEI

cap
string

Maximum cap (Number) - will be converted to wei

name?
string

Token name

symbol?
string

Token symbol

templateIndex?
number

NFT template index

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L63

estGasRemoveErc20Deployer

Method
Estimate gas cost for removeFromCreateERC20List method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

erc20Deployer
string

Address of the user to be revoked ERC20Deployer Permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L348

estGasRemoveManager

Method
Estimate gas cost for removeManager method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

manager
string

User adress which is going to be removed as manager

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L233

estGasRemoveStoreUpdater

Method
Estimate gas cost for removeFrom725StoreList method

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

storeUpdater
string

Address of the user to be revoked Store Updater Permission

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L612

estGasSafeTransferNft

Method
Estimate gas cost for safeTransfer NFT method

Parameters

nftAddress
string

erc721 contract adress

nftOwner
string

Current NFT Owner adress

nftReceiver
string

User which will receive the NFT, will also be set as Manager

tokenId
number

The id of the token to be transfered

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L815

estGasSetMetadata

Method
Estimate gas cost for setMetadata method

Parameters

nftAddress
string

erc721 contract adress

metadataUpdater
string

metadataUpdater address

metadataState
number

User which will receive the NFT, will also be set as Manager

metadataDecryptorUrl
string

metadataDecryptorAddress
string

flags
string

data
string

metadataHash
string

metadataProofs?

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L895

estGasSetMetadataAndTokenURI

Method
Estimate gas cost for setMetadata method

Parameters

nftAddress
string

erc721 contract adress

metadataUpdater
string

metadataUpdater address

metadataAndTokenURI

metaDataAndTokenURI object

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L991

estGasSetMetadataState

Method
Estimate gas cost for setMetadataState method

Parameters

nftAddress
string

erc721 contract adress

metadataUpdater
string

metadataState
number

new metadata state

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L1061

estGasTransferNft

Method
Estimate gas cost for transfer NFT method

Parameters

nftAddress
string

erc721 contract adress

nftOwner
string

Current NFT Owner adress

nftReceiver
string

User which will receive the NFT, will also be set as Manager

tokenId
number

The id of the token to be transfered

contractInstance?
Contract

Returns

Promise<any>
src/tokens/NFT.ts#L737

estSetTokenURI

Method
Estimate gas cost for setTokenURI method

Parameters

nftAddress
string

erc721 contract adress

address
string

user adress

data
string

input data for TokenURI

Returns

Promise<any>
src/tokens/NFT.ts#L1124

getData

Method
Gets data at a given `key`

Parameters

nftAddress
string

erc721 contract adress

key
string

the key which value to retrieve

Returns

Promise<string>
src/tokens/NFT.ts#L1220

getMetadata

Method
Get users Metadata, return Metadata details

Parameters

nftAddress
string

erc721 contract adress

Returns

Promise<Object>
src/tokens/NFT.ts#L1193

getNftOwner

Method
Get Owner

Parameters

nftAddress
string

erc721 contract adress

Returns

Promise<string>
src/tokens/NFT.ts#L1166

getNftPermissions

Method
Get users NFT Permissions

Parameters

nftAddress
string

erc721 contract adress

address
string

user adress

Returns

Promise<Roles>
src/tokens/NFT.ts#L1180

getTokenURI

Method
Gets data at a given `key`

Parameters

nftAddress
string

erc721 contract adress

id
number

Returns

Promise<string>
src/tokens/NFT.ts#L1234

isErc20Deployer

Method
Get users ERC20Deployer role

Parameters

nftAddress
string

erc721 contract adress

address
string

user adress

Returns

Promise<boolean>
src/tokens/NFT.ts#L1206

removeErc20Deployer

Method
Remove ERC20Deployer permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

erc20Deployer
string

Address of the user to be revoked ERC20Deployer Permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L375

removeManager

Method
Removes a specific manager for NFT Contract (only NFT Owner can succeed)

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Owner adress

manager
string

User adress which is going to be removed as manager

Returns

Promise<any>
src/tokens/NFT.ts#L255

removeMetadataUpdater

Method
Remove Metadata Updater permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

metadataUpdater
string

Address of the user to be revoked Metadata updater Permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L506

removeStoreUpdater

Method
Remove Store Updater permission - only Manager can succeed

Parameters

nftAddress
string

erc721 contract adress

address
string

NFT Manager adress

storeUpdater
string

Address of the user to be revoked Store Updater Permission

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L635

safeTransferNft

Method
safeTransferNFT Used for transferring the NFT, can be used by an approved relayer will clean all permissions both on erc721 and erc20 level.

Parameters

nftAddress
string

erc721 contract adress

nftOwner
string

Current NFT Owner adress

nftReceiver
string

User which will receive the NFT, will also be set as Manager

tokenId?
number

The id of the token to be transfered

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L847

setMetadata

Method
safeTransferNFT Used for transferring the NFT, can be used by an approved relayer will clean all permissions both on erc721 and erc20 level.

Parameters

nftAddress
string

erc721 contract adress

address
string

Caller address NFT Owner adress

metadataState
number

metadataDecryptorUrl
string

metadataDecryptorAddress
string

flags
string

data
string

metadataHash
string

metadataProofs?

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L934

setMetadataAndTokenURI

Method
Helper function to improve UX sets both MetaData & TokenURI in one tx

Parameters

nftAddress
string

erc721 contract adress

metadataUpdater
string

metadataAndTokenURI

metaDataAndTokenURI object

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L1021

setMetadataState

Method
setMetadataState Used for updating the metadata State

Parameters

nftAddress
string

erc721 contract adress

address
string

Caller address => metadata updater

metadataState
number

new metadata state

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L1088

setTokenURI

Method
set TokenURI on an nft

Parameters

nftAddress
string

erc721 contract adress

address
string

user adress

data
string

input data for TokenURI

Returns

Promise<any>
src/tokens/NFT.ts#L1143

transferNft

Method
Transfers the NFT will clean all permissions both on erc721 and erc20 level.

Parameters

nftAddress
string

erc721 contract adress

nftOwner
string

Current NFT Owner adress

nftReceiver
string

User which will receive the NFT, will also be set as Manager

tokenId?
number

The id of the token to be transfered

Returns

Promise<TransactionReceipt>
src/tokens/NFT.ts#L769

NftFactory

Provides an interface for NFT Factory contract

constructor

Constructor
private
Instantiate Datatokens.
src/factories/NFTFactory.ts#L66

factory721

Property
factory721
src/factories/NFTFactory.ts#L58

factory721Abi

Property
factory721Abi
src/factories/NFTFactory.ts#L55

factory721Address

Property
factory721Address
src/factories/NFTFactory.ts#L54

addNFTTemplate

Method
Add a new erc721 token template - only factory Owner

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L274

addTokenTemplate

Method
Add a new erc721 token template - only factory Owner

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L433

checkDatatoken

Method
Check if ERC20 is deployed from the factory

Parameters

datatoken
string

Datatoken address we want to check

Returns

Promise<Boolean>
src/factories/NFTFactory.ts#L237

checkNFT

Method
Check if NFT is deployed from the factory

Parameters

nftAddress
string

nftAddress address we want to check

Returns

Promise<String>
src/factories/NFTFactory.ts#L246

createNFT

Method
Create new NFT

Parameters

address
string

Returns

Promise<string>
src/factories/NFTFactory.ts#L110

createNftErc20WithDispenser

Method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

dispenserParams

input data for Dispenser Creation

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L846

createNftErc20WithFixedRate

Method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

freParams

input data for FixedRate Creation

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L784

createNftErc20WithPool

Method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

poolParams

input data for Pool Creation

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L721

createNftWithErc20

Method

Parameters

address
string

Caller address

nftCreateData

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L660

disableNFTTemplate

Method
Disable token template - only factory Owner

Parameters

address
string

templateIndex
number

index of the template we want to disable

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L326

disableTokenTemplate

Method
Disable token template - only factory Owner

Parameters

address
string

templateIndex
number

index of the template we want to disable

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L485

estGasAddNFTTemplate

Method
Estimate gas cost for add721TokenTemplate method

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<any>
src/factories/NFTFactory.ts#L257

estGasAddTokenTemplate

Method
Estimate gas cost for addTokenTemplate method

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<any>
src/factories/NFTFactory.ts#L420

estGasCreateNFT

Method
Get estimated gas cost for deployERC721Contract value

Parameters

address
string

Returns

Promise<string>
src/factories/NFTFactory.ts#L89

estGasCreateNftErc20WithDispenser

Method
Estimate gas cost for createNftErc20WithFixedRate method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

dispenserParams

input data for Dispenser Creation

Returns

Promise<any>
src/factories/NFTFactory.ts#L820

estGasCreateNftErc20WithFixedRate

Method
Estimate gas cost for createNftErc20WithFixedRate method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

freParams

input data for FixedRate Creation

Returns

Promise<any>
src/factories/NFTFactory.ts#L757

estGasCreateNftErc20WithPool

Method
Estimate gas cost for createNftErc20WithPool method

Parameters

address
string

Caller address

nftCreateData

input data for NFT Creation

ercParams

input data for ERC20 Creation

poolParams

input data for Pool Creation

Returns

Promise<any>
src/factories/NFTFactory.ts#L694

estGasCreateNftWithErc20

Method
Estimate gas cost for createNftWithErc20 method

Parameters

address
string

Caller address

nftCreateData

Returns

Promise<any>
src/factories/NFTFactory.ts#L637

estGasDisableNFTTemplate

Method
Estimate gas cost for disable721TokenTemplate method

Parameters

address
string

templateIndex
number

index of the template we want to disable

Returns

Promise<any>
src/factories/NFTFactory.ts#L309

estGasDisableTokenTemplate

Method
Estimate gas cost for disableTokenTemplate method

Parameters

address
string

templateIndex
number

index of the template we want to disable

Returns

Promise<any>
src/factories/NFTFactory.ts#L468

estGasReactivateNFTTemplate

Method
Reactivate a previously disabled token template - only factory Owner

Parameters

address
string

templateIndex
number

index of the template we want to reactivate

Returns

Promise<any>
src/factories/NFTFactory.ts#L364

estGasReactivateTokenTemplate

Method
Estimate gas cost for reactivateTokenTemplate method

Parameters

address
string

templateIndex
number

index of the template we want to reactivate

Returns

Promise<any>
src/factories/NFTFactory.ts#L526

estGasStartMultipleTokenOrder

Method
Estimate gas cost for startMultipleTokenOrder method

Parameters

address
string

Caller address

orders

an array of struct tokenOrder

Returns

Promise<any>
src/factories/NFTFactory.ts#L584

getCurrentNFTCount

Method
Get Current NFT Count (NFT created)

Returns

Promise<number>
src/factories/NFTFactory.ts#L171

getCurrentNFTTemplateCount

Method
Get Current NFT Template Count

Returns

Promise<number>
src/factories/NFTFactory.ts#L195

getCurrentTokenCount

Method
Get Current Datatoken Count

Returns

Promise<number>
src/factories/NFTFactory.ts#L179

getCurrentTokenTemplateCount

Method
Get Current Template Datatoken (ERC20) Count

Returns

Promise<number>
src/factories/NFTFactory.ts#L203

getNFTTemplate

Method
Get NFT Template

Parameters

index
number

Template index

Returns

Promise<Template>
src/factories/NFTFactory.ts#L212

getOwner

Method
Get Factory Owner

Returns

Promise<string>
src/factories/NFTFactory.ts#L187

getTokenTemplate

Method
Get Datatoken(erc20) Template

Parameters

index
number

Template index

Returns

Promise<Template>
src/factories/NFTFactory.ts#L228

reactivateNFTTemplate

Method
Reactivate a previously disabled token template - only factory Owner

Parameters

address
string

templateIndex
number

index of the template we want to reactivate

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L381

reactivateTokenTemplate

Method
Reactivate a previously disabled token template - only factory Owner

Parameters

address
string

templateIndex
number

index of the template we want to reactivate

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L543

startMultipleTokenOrder

Method

Parameters

address
string

Caller address

orders

an array of struct tokenOrder

Returns

Promise<TransactionReceipt>
src/factories/NFTFactory.ts#L603

Pool

Provides an interface to Ocean friendly fork from Balancer BPool

constructor

Constructor
private
src/pools/balancer/Pool.ts#L43

config

Property
private
config
src/pools/balancer/Pool.ts#L41

poolAbi

Property
poolAbi
src/pools/balancer/Pool.ts#L39

amountToUnits

Method
private

Parameters

token
string

amount
string

tokenDecimals?
number

Returns

Promise<string>
src/pools/balancer/Pool.ts#L55

calcPoolInGivenSingleOut

Method
Returns number of poolshares needed to withdraw exact tokenAmountOut tokens

Parameters

poolAddress
string

tokenOut
string

tokenOut

tokenAmountOut
string

expected amount of tokensOut

poolDecimals?
number

optional number of decimals of the pool

tokenOutDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L1591

calcPoolOutGivenSingleIn

Method
Returns number of poolshares obtain by staking exact tokenAmountIn tokens

Parameters

poolAddress
string

tokenIn
string

tokenIn

tokenAmountIn
string

exact number of tokens staked

poolDecimals?
number

optional number of decimals of the poool

tokenInDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L1482

calcSingleInGivenPoolOut

Method
Returns number of tokens to be staked to the pool in order to get an exact number of poolshares

Parameters

poolAddress
string

tokenIn
string

tokenIn

poolAmountOut
string

expected amount of pool shares

poolDecimals?
number

optional number of decimals of the pool

tokenInDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L1519

calcSingleOutGivenPoolIn

Method
Returns expected amount of tokenOut for removing exact poolAmountIn pool shares from the pool

Parameters

poolAddress
string

tokenOut
string

tokenOut

poolAmountIn
string

amount of shares spent

poolDecimals?
number

optional number of decimals of the pool

tokenOutDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L1557

collectMarketFee

Method
private
collectOPF - collect market fees - can be called by the publishMarketCollector

Parameters

address
string

poolAddress
string

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L665

collectOPC

Method
private
collectOPF - collect opf fee - can be called by anyone

Parameters

address
string

poolAddress
string

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L615

estCollectMarketFee

Method
Estimate gas cost for collectMarketFee

Parameters

address
string

poolAddress
string

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L643

estCollectOPC

Method
Estimate gas cost for collectOPF

Parameters

address
string

poolAddress
string

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L594

estExitswapPoolAmountIn

Method
Estimate gas cost for exitswapPoolAmountIn

Parameters

address
string

poolAddress
string

poolAmountIn
string

exact number of pool shares to spend

minTokenAmountOut
string

minimum amount of basetokens expected

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L1164

estJoinswapExternAmountIn

Method
Estimate gas cost for joinswapExternAmountIn

Parameters

address
string

poolAddress
string

tokenAmountIn
string

exact number of base tokens to spend

minPoolAmountOut
string

minimum of pool shares expectex

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L1074

estSetSwapFee

Method
Estimate gas cost for setSwapFee

Parameters

account
string

poolAddress
string

fee
string

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L102

estSwapExactAmountIn

Method
Estimate gas cost for swapExactAmountIn

Parameters

address
string

poolAddress
string

tokenInOutMarket

object contianing addresses like tokenIn, tokenOut, consumeMarketFeeAddress

amountsInOutMaxFee

object contianing tokenAmountIn, minAmountOut, maxPrice, consumeMarketSwapFee

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L777

estSwapExactAmountOut

Method
Estimate gas cost for swapExactAmountOut

Parameters

address
string

poolAddress
string

tokenInOutMarket

amountsInOutMaxFee

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L928

estUpdatePublishMarketFee

Method
Estimate gas cost for updatePublishMarketFee

Parameters

address
string

poolAddress
string

newPublishMarketAddress
string

new market address

newPublishMarketSwapFee
string

new market swap fee

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/balancer/Pool.ts#L700

exitswapPoolAmountIn

Method
private
Single side remove liquidity from the pool, expecting a minAmountOut of basetokens for spending poolAmountIn pool shares Pay poolAmountIn pool shares into the pool, getting minTokenAmountOut of the baseToken

Parameters

account
string

poolAddress
string

poolAmountIn
string

exact number of pool shares to spend

minTokenAmountOut
string

minimum amount of basetokens expected

poolDecimals?
number

optional number of decimals of the poool

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L1197

getAmountInExactOut

Method
How many tokensIn do you need in order to get exact tokenAmountOut. Returns: tokenAmountIn, swapFee, opcFee , consumeMarketSwapFee, publishMarketSwapFee Returns: tokenAmountIn, LPFee, opcFee , publishMarketSwapFee, consumeMarketSwapFee

Parameters

poolAddress
string

tokenIn
string

token to be swaped

tokenOut
string

token to get

tokenAmountOut
string

exact amount of tokenOut

swapMarketFee
string

consume market swap fee

tokenInDecimals?
number

optional number of decimals of the token to be swaped

tokenOutDecimals?
number

optional number of decimals of the token to get

Returns

Promise<PoolPriceAndFees>
src/pools/balancer/Pool.ts#L1325

getAmountOutExactIn

Method
How many tokensOut you will get for a exact tokenAmountIn Returns: tokenAmountOut, LPFee, opcFee , publishMarketSwapFee, consumeMarketSwapFee

Parameters

poolAddress
string

tokenIn
string

token to be swaped

tokenOut
string

token to get

tokenAmountIn
string

exact amount of tokenIn

swapMarketFee
string

tokenInDecimals?
number

optional number of decimals of the token to be swaped

tokenOutDecimals?
number

optional number of decimals of the token to get

Returns

Promise<PoolPriceAndFees>
src/pools/balancer/Pool.ts#L1405

getBaseToken

Method
private
Returns the current baseToken address of the pool

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L259

getCommunityFees

Method
private
Get Community Fees available to be collected for a specific token

Parameters

poolAddress
string

token
string

token we want to check fees

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L566

getController

Method
private
Returns the current controller address (ssBot)

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L240

getCurrentMarketFees

Method
private
Get Community Get the current amount of fees which can be withdrawned by the Market

Parameters

poolAddress
string

Returns

Promise<CurrentFees>
src/pools/balancer/Pool.ts#L525

getCurrentOPCFees

Method
private
Get getCurrentOPFFees Get the current amount of fees which can be withdrawned by OPF

Parameters

poolAddress
string

Returns

Promise<CurrentFees>
src/pools/balancer/Pool.ts#L544

getCurrentTokens

Method
private
Get tokens composing this poo Returns tokens bounded to pool, before the pool is finalizedl

Parameters

poolAddress
string

Returns

Promise<>
src/pools/balancer/Pool.ts#L197

getDatatoken

Method
private
Returns the current datatoken address

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L278

getDenormalizedWeight

Method
private
Returns denormalized weight of a token

Parameters

poolAddress
string

token
string

token to be checked

Returns

Promise<string>
src/pools/balancer/Pool.ts#L454

getExitEventSignature

Method
Get LOG_EXIT encoded topic

Returns

string
src/pools/balancer/Pool.ts#L1651

getFinalTokens

Method
private
Get the final tokens composing this pool Returns tokens bounded to pool, after the pool was finalized

Parameters

poolAddress
string

Returns

Promise<>
src/pools/balancer/Pool.ts#L219

getJoinEventSignature

Method
Get LOG_JOIN encoded topic

Returns

string
src/pools/balancer/Pool.ts#L1638

getMarketFee

Method
private
Get getMarketFee

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L297

getMarketFeeCollector

Method
private
Get marketFeeCollector of this pool

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L316

getMarketFees

Method
private
Returns the current fee of publishingMarket Get Market Fees available to be collected for a specific token

Parameters

poolAddress
string

token
string

token we want to check fees

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L502

getNormalizedWeight

Method
private
Returns normalized weight of a token. The combined normalized weights of all tokens will sum up to 1. (Note: the actual sum may be 1 plus or minus a few wei due to division precision loss)

Parameters

poolAddress
string

token
string

token to be checked

Returns

Promise<string>
src/pools/balancer/Pool.ts#L431

getNumTokens

Method
private
Returns number of tokens bounded to pool

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L155

getPoolSharesTotalSupply

Method
private
Get total supply of pool shares

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L174

getReserve

Method
private
Returns the current token reserve amount

Parameters

poolAddress
string

token
string

Address of the token to be checked

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/balancer/Pool.ts#L361

getSpotPrice

Method
private
Return the spot price of swapping tokenIn to tokenOut

Parameters

poolAddress
string

tokenIn
string

in token

tokenOut
string

out token

swapMarketFee
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L1256

getSwapEventSignature

Method
Get LOG_SWAP encoded topic

Returns

string
src/pools/balancer/Pool.ts#L1625

getSwapFee

Method
private
Returns the current Liquidity Providers swap fee

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L408

getTotalDenormalizedWeight

Method
private
getTotalDenormalizedWeight Returns total denormalized weught of the pool

Parameters

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L477

isBound

Method
private
Get if a token is bounded to a pool Returns true if token is bound

Parameters

poolAddress
string

token
string

Address of the token to be checked

Returns

Promise<boolean>
src/pools/balancer/Pool.ts#L339

isFinalized

Method
private
Get if a pool is finalized Returns true if pool is finalized

Parameters

poolAddress
string

Returns

Promise<boolean>
src/pools/balancer/Pool.ts#L387

joinswapExternAmountIn

Method
private
Single side add liquidity to the pool, expecting a minPoolAmountOut of shares for spending tokenAmountIn basetokens. Pay tokenAmountIn of baseToken to join the pool, getting poolAmountOut of the pool shares.

Parameters

account
string

poolAddress
string

tokenAmountIn
string

exact number of base tokens to spend

minPoolAmountOut
string

minimum of pool shares expectex

tokenInDecimals?
number

optional number of decimals of the token

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L1107

setSwapFee

Method
private
Allows controller to change the swapFee

Parameters

account
string

poolAddress
string

fee
string

swap fee (1e17 = 10 % , 1e16 = 1% , 1e15 = 0.1%, 1e14 = 0.01%)

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L124

sharesBalance

Method
private
Get user shares of pool tokens

Parameters

account
string

poolAddress
string

Returns

Promise<string>
src/pools/balancer/Pool.ts#L77

swapExactAmountIn

Method
private
Swaps an exact amount of tokensIn to get a mimum amount of tokenOut Trades an exact tokenAmountIn of tokenIn taken from the caller by the pool, in exchange for at least minAmountOut of tokenOut given to the caller from the pool, with a maximum marginal price of maxPrice. Returns (tokenAmountOut, spotPriceAfter), where tokenAmountOut is the amount of token that came out of the pool, and spotPriceAfter is the new marginal spot price, ie, the result of getSpotPrice after the call. (These values are what are limited by the arguments; you are guaranteed tokenAmountOut >= minAmountOut and spotPriceAfter <= maxPrice).

Parameters

address
string

poolAddress
string

tokenInOutMarket

object contianing addresses like tokenIn, tokenOut, consumeMarketFeeAddress

amountsInOutMaxFee

object contianing tokenAmountIn, minAmountOut, maxPrice, consumeMarketSwapFee

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L840

swapExactAmountOut

Method
private
Swaps a maximum maxAmountIn of tokensIn to get an exact amount of tokenOut

Parameters

account
string

poolAddress
string

tokenInOutMarket

Object containing addresses like tokenIn, tokenOut, consumeMarketFeeAddress

amountsInOutMaxFee

Object containging maxAmountIn,tokenAmountOut,maxPrice, consumeMarketSwapFee]

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L986

unitsToAmount

Method
private

Parameters

token
string

amount
string

tokenDecimals?
number

Returns

Promise<string>
src/pools/balancer/Pool.ts#L63

updatePublishMarketFee

Method
private
updatePublishMarketFee - sets a new newPublishMarketAddress and new newPublishMarketSwapFee- can be called only by the marketFeeCollector

Parameters

address
string

poolAddress
string

newPublishMarketAddress
string

new market fee collector address

newPublishMarketSwapFee
string

fee recieved by the publisher market when a dt is swaped from a pool, percent

Returns

Promise<TransactionReceipt>
src/pools/balancer/Pool.ts#L730

Provider

constructor

Constructor
private

checkDidFiles

Method
Get DDO File details (if possible)

Parameters

did
string

did

serviceId
number

the id of the service for which to check the files

providerUri
string

uri of the provider that will be used to check the file

signal?
AbortSignal

abort signal

Returns

Promise<>
src/provider/Provider.ts#L169

checkFileUrl

Method
Get URL details (if possible)

Parameters

url
string

or did

providerUri
string

uri of the provider that will be used to check the file

signal?
AbortSignal

abort signal

Returns

Promise<>
src/provider/Provider.ts#L211

computeDelete

Method
Deletes a compute job.

Parameters

did
string

consumerAddress
string

jobId
string

providerUri
string

web3
default

signal?
AbortSignal

abort signal

Returns

Promise<>
src/provider/Provider.ts#L686

computeStart

Method
Instruct the provider to start a compute job

Parameters

providerUri
string

web3
default

consumerAddress
string

computeEnv
string

signal?
AbortSignal

abort signal

additionalDatasets?

Returns

Promise<>
src/provider/Provider.ts#L440

computeStatus

Method
Get compute status for a specific jobId/documentId/owner.

Parameters

providerUri
string

The URI of the provider we want to query

consumerAddress
string

The consumer ethereum address

jobId?
string

The ID of a compute job.

did?
string

The ID of the asset

signal?
AbortSignal

abort signal

Returns

Promise<>
src/provider/Provider.ts#L587

computeStop

Method
Instruct the provider to Stop the execution of a to stop a compute job.

Parameters

did
string

consumerAddress
string

jobId
string

providerUri
string

web3
default

signal?
AbortSignal

abort signal

Returns

Promise<>
src/provider/Provider.ts#L513

encrypt

Method
Encrypt data using the Provider's own symmetric key

Parameters

data
any

data in json format that needs to be sent , it can either be a DDO or a File array

providerUri
string

provider uri address

signal?
AbortSignal

abort signal

Returns

Promise<string>
src/provider/Provider.ts#L132

getComputeEnvironments

Method
Get Compute Environments

Parameters

providerUri
string

signal?
AbortSignal

Returns

Promise<>
src/provider/Provider.ts#L249

getComputeResultUrl

Method
Get compute result url

Parameters

providerUri
string

The URI of the provider we want to query

web3
default

Web3 instance

consumerAddress
string

The consumer ethereum address

jobId
string

The ID of a compute job.

index
number

Result index

Returns

Promise<string>
src/provider/Provider.ts#L641

getDownloadUrl

Method
Gets fully signed URL for download

Parameters

did
string

accountId
string

serviceId
string

fileIndex
number

transferTxId
string

providerUri
string

web3
default

userCustomParameters?

Returns

Promise<any>
src/provider/Provider.ts#L395

getEndpointURL

Method
private

Parameters

servicesEndpoints

serviceName
string

src/provider/Provider.ts#L43

getEndpoints

Method
private
Returns the provider endpoints

Parameters

providerUri
string

Returns

Promise<any>
src/provider/Provider.ts#L33

getNonce

Method
Gets current nonce

Parameters

providerUri
string

provider uri address

consumerAddress
string

Publisher address

signal?
AbortSignal

abort signal

providerEndpoints?
any

Identifier of the asset to be registered in ocean

serviceEndpoints?

document description object (DDO)=

Returns

Promise<string>
src/provider/Provider.ts#L77

getServiceEndpoints

Method
Returns the service endpoints that exist in provider.

Parameters

providerEndpoint
string

endpoints
any

Returns

Promise<>
src/provider/Provider.ts#L56

initialize

Method
Initialize a service request.

Parameters

did
string

serviceId
string

fileIndex
number

consumerAddress
string

providerUri
string

Identifier of the asset to be registered in ocean

signal?
AbortSignal

abort signal

userCustomParameters?

computeEnv?
string

validUntil?
number

Returns

Promise<ProviderInitialize>
src/provider/Provider.ts#L286

initializeCompute

Method
Initialize a compute request.

Parameters

assets

computeEnv
string

validUntil
number

providerUri
string

Identifier of the asset to be registered in ocean

accountId
string

signal?
AbortSignal

abort signal

Returns

Promise<ProviderComputeInitializeResults>
src/provider/Provider.ts#L341

isValidProvider

Method
Check for a valid provider at URL

Parameters

url
string

provider uri address

signal?
AbortSignal

abort signal

Returns

Promise<boolean>
src/provider/Provider.ts#L761

signProviderRequest

Method

Parameters

web3
default

accountId
string

message
string

password?
string

Returns

Promise<string>
src/provider/Provider.ts#L109

Router

Provides an interface for FactoryRouter contract

constructor

Constructor
private
Instantiate Router.
src/pools/Router.ts#L26

RouterAbi

Property
RouterAbi
src/pools/Router.ts#L15

config

Property
config
src/pools/Router.ts#L17

router

Property
router
src/pools/Router.ts#L18

routerAddress

Property
routerAddress
src/pools/Router.ts#L14

web3

Property
web3
src/pools/Router.ts#L16

addApprovedToken

Method
Add a new token to oceanTokens list, pools with baseToken in this list have NO opf Fee

Parameters

address
string

caller address

tokenAddress
string

token address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L138

addDispenserContract

Method
Add a new contract to dispenser list, after is added, can be used when deploying a new pool

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L397

addFixedRateContract

Method
Add a new contract to fixedRate list, after is added, can be used when deploying a new pool

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L309

addPoolTemplate

Method
Add a new template to poolTemplates mapping, after template is added,it can be used

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L563

addSSContract

Method
Add a new contract to ssContract list, after is added, can be used when deploying a new pool

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L223

buyDTBatch

Method
BuyDTBatch

Parameters

address
string

operations

Operations objects array

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L59

estGasAddApprovedToken

Method
Estimate gas cost for addApprovedToken

Parameters

address
string

tokenAddress
string

token address we want to add

contractInstance?
Contract

Returns

Promise<any>
src/pools/Router.ts#L124

estGasAddDispenserContract

Method
Estimate gas cost for addDispenserContract method

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L384

estGasAddFixedRateContract

Method
Estimate gas cost for addFixedRateContract method

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L296

estGasAddPoolTemplate

Method
Estimate gas cost for addPoolTemplate method

Parameters

address
string

templateAddress
string

template address to add

Returns

Promise<any>
src/pools/Router.ts#L550

estGasAddSSContract

Method
Estimate gas cost for addSSContract method

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L213

estGasBuyDTBatch

Method
Estimate gas cost for buyDTBatch method

Parameters

address
string

operations

Operations objects array

Returns

Promise<any>
src/pools/Router.ts#L49

estGasRemoveApprovedToken

Method
Estimate gas cost for removeApprovedToken

Parameters

address
string

caller address

tokenAddress
string

token address we want to add

contractInstance?
Contract

Returns

Promise<any>
src/pools/Router.ts#L169

estGasRemoveDispenserContract

Method
Estimate gas cost for addDispenserContract method

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L427

estGasRemoveFixedRateContract

Method
Estimate gas cost for addFixedRateContract method

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L339

estGasRemovePoolTemplate

Method
Estimate gas cost for removePoolTemplate method

Parameters

address
string

templateAddress
string

template address to remove

Returns

Promise<any>
src/pools/Router.ts#L593

estGasRemoveSSContract

Method
Estimate gas cost for removeSSContract method

Parameters

address
string

caller address

tokenAddress
string

contract address to add

Returns

Promise<any>
src/pools/Router.ts#L253

estGasUpdateOPCFee

Method
Estimate gas cost for updateOPFFee method

Parameters

address
string

newSwapOceanFee
number

newSwapNonOceanFee
number

newConsumeFee
number

newProviderFee
number

Returns

Promise<any>
src/pools/Router.ts#L486

getCurrentOPCFee

Method
Get Current OPF Fee

Returns

Promise<number>
src/pools/Router.ts#L476

getNFTFactory

Method
Get NFT Factory address

Returns

Promise<string>
src/pools/Router.ts#L106

getOPCFee

Method
Get OPF Fee per token

Parameters

baseToken
string

Returns

Promise<number>
src/pools/Router.ts#L469

getOwner

Method
Get Router Owner

Returns

Promise<string>
src/pools/Router.ts#L99

isApprovedToken

Method
Check if a token is on approved tokens list, if true opfFee is lower in pools with that token/DT

Parameters

address
string

Returns

Promise<boolean>
src/pools/Router.ts#L78

isFixedPrice

Method
Check if an address is a Fixed Rate contract.

Parameters

address
string

Returns

Promise<boolean>
src/pools/Router.ts#L92

isPoolTemplate

Method
Check if an address is a pool template contract.

Parameters

address
string

Returns

Promise<boolean>
src/pools/Router.ts#L113

isSideStaking

Method
Check if an address is a side staking contract.

Parameters

address
string

Returns

Promise<boolean>
src/pools/Router.ts#L85

removeApprovedToken

Method
Remove a token from oceanTokens list, pools without baseToken in this list have a opf Fee

Parameters

address
string

tokenAddress
string

address to remove

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L183

removeDispenserContract

Method
Add a new contract to dispenser list, after is added, can be used when deploying a new pool

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L440

removeFixedRateContract

Method
Removes a contract from fixedRate list

Parameters

address
string

tokenAddress
string

contract address to add

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L352

removePoolTemplate

Method
Remove template from poolTemplates mapping, after template is removed,it can be used anymore

Parameters

address
string

templateAddress
string

template address to remove

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L606

removeSSContract

Method
Removes a new contract from ssContract list

Parameters

address
string

caller address

tokenAddress
string

contract address to removed

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L266

updateOPCFee

Method
Add a new contract to fixedRate list, after is added, can be used when deploying a new pool

Parameters

address
string

newSwapOceanFee
number

Amount charged for swapping with ocean approved tokens

newSwapNonOceanFee
number

Amount charged for swapping with non ocean approved tokens

newConsumeFee
number

Amount charged from consumeFees

newProviderFee
number

Amount charged for providerFees

Returns

Promise<TransactionReceipt>
src/pools/Router.ts#L512

SideStaking

constructor

Constructor
private
src/pools/ssContracts/SideStaking.ts#L20

estGetVesting

Method
Estimate gas cost for getVesting

Parameters

account
string

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/ssContracts/SideStaking.ts#L273

estSetPoolSwapFee

Method
Estimate gas cost for getVesting

Parameters

account
string

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

poolAddress
string

swapFee
number

contractInstance?
Contract

optional contract instance

Returns

Promise<number>
src/pools/ssContracts/SideStaking.ts#L326

getBaseToken

Method
private
Get

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L111

getBaseTokenBalance

Method
private
Get baseToken balance in the contract

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L145

getDatatokenBalance

Method
private
Get dt balance in the staking contract available for being added as liquidity

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L166

getDatatokenCirculatingSupply

Method
private
Get (total vesting amount + token released from the contract when adding liquidity)

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatoken address

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L46

getDatatokenCurrentCirculatingSupply

Method
private
Get actual dts in circulation (vested token withdrawn from the contract + token released from the contract when adding liquidity)

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatoken address

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L69

getPoolAddress

Method
private
Get Pool Address

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L128

getPublisherAddress

Method
private
Get Publisher address

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatoken address

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L91

getRouter

Method
private
Get Router address set in side staking contract

Parameters

ssAddress
string

side staking contract address

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L390

getVesting

Method
private
Send vested tokens available to the publisher address, can be called by anyone

Parameters

account
string

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<TransactionReceipt>
src/pools/ssContracts/SideStaking.ts#L292

getvestingAmount

Method
private
Get total amount vesting

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L206

getvestingAmountSoFar

Method
private
Get how much has been taken from the vesting amount

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

tokenDecimals?
number

optional number of decimals of the token

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L249

getvestingEndBlock

Method
private
Get block when vesting ends

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L188

getvestingLastBlock

Method
private
Get last block publisher got some vested tokens

Parameters

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L228

setPoolSwapFee

Method
private
Send vested tokens available to the publisher address, can be called by anyone

Parameters

account
string

ssAddress
string

side staking contract address

datatokenAddress
string

datatokenAddress

poolAddress
string

swapFee
number

Returns

Promise<TransactionReceipt>
src/pools/ssContracts/SideStaking.ts#L353

unitsToAmount

Method
private

Parameters

token
string

amount
string

tokenDecimals?
number

Returns

Promise<string>
src/pools/ssContracts/SideStaking.ts#L32

AmountsInMaxFee

maxPrice

Property
private
maxPrice
src/@types/Pool.ts#L34

minAmountOut

Property
private
minAmountOut
src/@types/Pool.ts#L32

swapMarketFee

Property
private
swapMarketFee
src/@types/Pool.ts#L33

tokenAmountIn

Property
private
tokenAmountIn
src/@types/Pool.ts#L31

AmountsOutMaxFee

maxAmountIn

Property
private
maxAmountIn
src/@types/Pool.ts#L39

maxPrice

Property
private
maxPrice
src/@types/Pool.ts#L41

swapMarketFee

Property
private
swapMarketFee
src/@types/Pool.ts#L40

tokenAmountOut

Property
private
tokenAmountOut
src/@types/Pool.ts#L38

Asset

@context

Property
private
Contexts used for validation.
@context
src/@types/DDO/DDO.ts#L15

chainId

Property
private
ChainId of the network the DDO was published to.
chainId
src/@types/DDO/DDO.ts#L41

credentials

Property
private
Describes the credentials needed to access a dataset in addition to the services definition.
credentials
src/@types/DDO/DDO.ts#L60

datatokens

Property
private
Contains information about the ERC20 datatokens attached to asset services.
datatokens
src/@types/Asset.ts#L111

event

Property
private
Contains information about the last transaction that created or updated the DDO.
event
src/@types/Asset.ts#L117

id

Property
private
DID, descentralized ID. Computed as sha256(address of ERC721 contract + chainId)
id
src/@types/DDO/DDO.ts#L22

metadata

Property
private
Stores an object describing the asset.
metadata
src/@types/DDO/DDO.ts#L47

nft

Property
private
Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
nft
src/@types/Asset.ts#L105

nftAddress

Property
private
NFT contract address
nftAddress
src/@types/DDO/DDO.ts#L35

purgatory

Property
private
Contains information about an asset's purgatory status defined in [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory). Marketplace interfaces are encouraged to prevent certain user actions like adding liquidity on assets in purgatory.
purgatory
src/@types/Asset.ts#L137

services

Property
private
Stores an array of services defining access to the asset.
services
src/@types/DDO/DDO.ts#L53

stats

Property
private
The stats section contains different statistics fields.
stats
src/@types/Asset.ts#L123

version

Property
private
Version information in SemVer notation referring to the DDO spec version
version
src/@types/DDO/DDO.ts#L29

AssetDatatoken

address

Property
private
Contract address of the deployed ERC20 contract.
address
src/@types/Asset.ts#L71

name

Property
private
Name of NFT set in contract.
name
src/@types/Asset.ts#L77

serviceId

Property
private
ID of the service the datatoken is attached to.
serviceId
src/@types/Asset.ts#L89

symbol

Property
private
Symbol of NFT set in contract.
symbol
src/@types/Asset.ts#L83

AssetLastEvent

block

Property
private
block
src/@types/Asset.ts#L94

contract

Property
private
contract
src/@types/Asset.ts#L96

datetime

Property
private
datetime
src/@types/Asset.ts#L97

from

Property
private
from
src/@types/Asset.ts#L95

tx

Property
private
tx
src/@types/Asset.ts#L93

AssetNft

address

Property
private
Contract address of the deployed ERC721 NFT contract.
address
src/@types/Asset.ts#L8

created

Property
private
Contains the date of NFT creation.
created
src/@types/Asset.ts#L43

name

Property
private
Name of NFT set in contract.
name
src/@types/Asset.ts#L14

owner

Property
private
ETH account address of the NFT owner.
owner
src/@types/Asset.ts#L26

state

Property
private
State of the asset reflecting the NFT contract value. 0 Active. 1 End-of-life. 2 Deprecated (by another asset). 3 Revoked by publisher. 4 Ordering is temporary disabled.
state
src/@types/Asset.ts#L37

symbol

Property
private
Symbol of NFT set in contract.
symbol
src/@types/Asset.ts#L20

tokenURI

Property
private
NFT token URI.
tokenURI
src/@types/Asset.ts#L49

ComputeAlgorithm

algocustomdata

Property
private
algocustomdata
src/@types/Compute.ts#L74

documentId

Property
private
documentId
src/@types/Compute.ts#L70

meta

Property
private
meta
src/@types/Compute.ts#L72

serviceId

Property
private
serviceId
src/@types/Compute.ts#L71

transferTxId

Property
private
transferTxId
src/@types/Compute.ts#L73

userdata

Property
private
userdata
src/@types/Compute.ts#L75

ComputeAsset

documentId

Property
private
documentId
src/@types/Compute.ts#L63

serviceId

Property
private
serviceId
src/@types/Compute.ts#L64

transferTxId

Property
private
transferTxId
src/@types/Compute.ts#L65

userdata

Property
private
userdata
src/@types/Compute.ts#L66

ComputeEnvironment

consumerAddress

Property
private
consumerAddress
src/@types/Compute.ts#L21

cpuNumber

Property
private
cpuNumber
src/@types/Compute.ts#L11

cpuType

Property
private
cpuType
src/@types/Compute.ts#L12

currentJobs

Property
private
currentJobs
src/@types/Compute.ts#L19

desc

Property
private
desc
src/@types/Compute.ts#L18

diskGB

Property
private
diskGB
src/@types/Compute.ts#L16

gpuNumber

Property
private
gpuNumber
src/@types/Compute.ts#L13

gpuType

Property
private
gpuType
src/@types/Compute.ts#L14

id

Property
private
id
src/@types/Compute.ts#L10

lastSeen

Property
private
lastSeen
src/@types/Compute.ts#L24

maxJobDuration

Property
private
maxJobDuration
src/@types/Compute.ts#L23

maxJobs

Property
private
maxJobs
src/@types/Compute.ts#L20

priceMin

Property
private
priceMin
src/@types/Compute.ts#L17

ramGB

Property
private
ramGB
src/@types/Compute.ts#L15

storageExpiry

Property
private
storageExpiry
src/@types/Compute.ts#L22

ComputeJob

agreementId

Property
private
agreementId
src/@types/Compute.ts#L45

algoDID

Property
private
algoDID
src/@types/Compute.ts#L44

dateCreated

Property
private
dateCreated
src/@types/Compute.ts#L38

dateFinished

Property
private
dateFinished
src/@types/Compute.ts#L39

did

Property
private
did
src/@types/Compute.ts#L36

expireTimestamp

Property
private
expireTimestamp
src/@types/Compute.ts#L46

inputDID

Property
private
inputDID
src/@types/Compute.ts#L43

jobId

Property
private
jobId
src/@types/Compute.ts#L37

owner

Property
private
owner
src/@types/Compute.ts#L35

results

Property
private
results
src/@types/Compute.ts#L42

status

Property
private
status
src/@types/Compute.ts#L40

statusText

Property
private
statusText
src/@types/Compute.ts#L41

ComputeOutput

metadata

Property
private
metadata
src/@types/Compute.ts#L54

metadataUri

Property
private
metadataUri
src/@types/Compute.ts#L55

nodeUri

Property
private
nodeUri
src/@types/Compute.ts#L56

owner

Property
private
owner
src/@types/Compute.ts#L57

providerAddress

Property
private
providerAddress
src/@types/Compute.ts#L52

providerUri

Property
private
providerUri
src/@types/Compute.ts#L53

publishAlgorithmLog

Property
private
publishAlgorithmLog
src/@types/Compute.ts#L50

publishOutput

Property
private
publishOutput
src/@types/Compute.ts#L51

secretStoreUri

Property
private
secretStoreUri
src/@types/Compute.ts#L58

whitelist

Property
private
whitelist
src/@types/Compute.ts#L59

ComputeResult

filename

Property
private
filename
src/@types/Compute.ts#L28

filesize

Property
private
filesize
src/@types/Compute.ts#L29

index

Property
private
index
src/@types/Compute.ts#L31

type

Property
private
type
src/@types/Compute.ts#L30

ConsumeMarketFee

consumeMarketFeeAddress

Property
private
consumeMarketFeeAddress
src/@types/Erc20.ts#L14

consumeMarketFeeAmount

Property
private
consumeMarketFeeAmount
src/@types/Erc20.ts#L16

consumeMarketFeeToken

Property
private
consumeMarketFeeToken
src/@types/Erc20.ts#L15

Credential

type

Property
private
type
src/@types/DDO/Credentials.ts#L2

values

Property
private
values
src/@types/DDO/Credentials.ts#L3

Credentials

allow

Property
private
allow
src/@types/DDO/Credentials.ts#L7

deny

Property
private
deny
src/@types/DDO/Credentials.ts#L8

CurrentFees

amounts

Property
private
amounts
src/@types/Pool.ts#L19

tokens

Property
private
tokens
src/@types/Pool.ts#L18

DDO

DID Descriptor Object. Contains metadata about the asset, and define access in at least one service.

@context

Property
private
Contexts used for validation.
@context
src/@types/DDO/DDO.ts#L15

chainId

Property
private
ChainId of the network the DDO was published to.
chainId
src/@types/DDO/DDO.ts#L41

credentials

Property
private
Describes the credentials needed to access a dataset in addition to the services definition.
credentials
src/@types/DDO/DDO.ts#L60

event

Property
private
Describes the event of last metadata event
event
src/@types/DDO/DDO.ts#L66

id

Property
private
DID, descentralized ID. Computed as sha256(address of ERC721 contract + chainId)
id
src/@types/DDO/DDO.ts#L22

metadata

Property
private
Stores an object describing the asset.
metadata
src/@types/DDO/DDO.ts#L47

nftAddress

Property
private
NFT contract address
nftAddress
src/@types/DDO/DDO.ts#L35

services

Property
private
Stores an array of services defining access to the asset.
services
src/@types/DDO/DDO.ts#L53

version

Property
private
Version information in SemVer notation referring to the DDO spec version
version
src/@types/DDO/DDO.ts#L29

DispenserCreationParams

allowedSwapper

Property
private
allowedSwapper
src/@types/Dispenser.ts#L6

dispenserAddress

Property
private
dispenserAddress
src/@types/Dispenser.ts#L2

maxBalance

Property
private
maxBalance
src/@types/Dispenser.ts#L4

maxTokens

Property
private
maxTokens
src/@types/Dispenser.ts#L3

withMint

Property
private
withMint
src/@types/Dispenser.ts#L5

DispenserParams

allowedSwapper

Property
private
allowedSwapper
src/tokens/Datatoken.ts#L45

maxBalance

Property
private
maxBalance
src/tokens/Datatoken.ts#L43

maxTokens

Property
private
maxTokens
src/tokens/Datatoken.ts#L42

withMint

Property
private
withMint
src/tokens/Datatoken.ts#L44

DispenserToken

active

Property
private
active
src/pools/dispenser/Dispenser.ts#L18

allowedSwapper

Property
private
allowedSwapper
src/pools/dispenser/Dispenser.ts#L24

balance

Property
private
balance
src/pools/dispenser/Dispenser.ts#L22

isMinter

Property
private
isMinter
src/pools/dispenser/Dispenser.ts#L23

maxBalance

Property
private
maxBalance
src/pools/dispenser/Dispenser.ts#L21

maxTokens

Property
private
maxTokens
src/pools/dispenser/Dispenser.ts#L20

owner

Property
private
owner
src/pools/dispenser/Dispenser.ts#L19

Erc20CreateParams

cap

Property
private
cap
src/@types/Erc20.ts#L8

feeAmount

Property
private
feeAmount
src/@types/Erc20.ts#L7

feeToken

Property
private
feeToken
src/@types/Erc20.ts#L6

minter

Property
private
minter
src/@types/Erc20.ts#L3

mpFeeAddress

Property
private
mpFeeAddress
src/@types/Erc20.ts#L5

name

Property
private
name
src/@types/Erc20.ts#L9

paymentCollector

Property
private
paymentCollector
src/@types/Erc20.ts#L4

symbol

Property
private
symbol
src/@types/Erc20.ts#L10

templateIndex

Property
private
templateIndex
src/@types/Erc20.ts#L2

FeesInfo

exchangeId

Property
private
exchangeId
src/pools/fixedRate/FixedRateExchange.ts#L42

marketFee

Property
private
marketFee
src/pools/fixedRate/FixedRateExchange.ts#L38

marketFeeAvailable

Property
private
marketFeeAvailable
src/pools/fixedRate/FixedRateExchange.ts#L40

marketFeeCollector

Property
private
marketFeeCollector
src/pools/fixedRate/FixedRateExchange.ts#L39

oceanFeeAvailable

Property
private
oceanFeeAvailable
src/pools/fixedRate/FixedRateExchange.ts#L41

FileMetadata

contentLength

Property
private
File content length.
contentLength
src/@types/FileMetadata.ts#L19

contentType

Property
private
File format, if applicable.
contentType
src/@types/FileMetadata.ts#L13

index

Property
private
File index.
index
src/@types/FileMetadata.ts#L25

method

Property
private
HTTP method used
method
src/@types/FileMetadata.ts#L37

type

Property
private
File URL.
type
src/@types/FileMetadata.ts#L6

url

Property
private
File URL.
url
src/@types/FileMetadata.ts#L31

valid

Property
private
check if file exists
valid
src/@types/FileMetadata.ts#L43

FixedPriceExchange

allowedSwapper

Property
private
allowedSwapper
src/pools/fixedRate/FixedRateExchange.ts#L32

baseToken

Property
private
baseToken
src/pools/fixedRate/FixedRateExchange.ts#L23

btBalance

Property
private
btBalance
src/pools/fixedRate/FixedRateExchange.ts#L28

btDecimals

Property
private
btDecimals
src/pools/fixedRate/FixedRateExchange.ts#L26

btSupply

Property
private
btSupply
src/pools/fixedRate/FixedRateExchange.ts#L30

datatoken

Property
private
datatoken
src/pools/fixedRate/FixedRateExchange.ts#L22

dtBalance

Property
private
dtBalance
src/pools/fixedRate/FixedRateExchange.ts#L27

dtDecimals

Property
private
dtDecimals
src/pools/fixedRate/FixedRateExchange.ts#L25

dtSupply

Property
private
dtSupply
src/pools/fixedRate/FixedRateExchange.ts#L29

exchangeId

Property
private
exchangeId
src/pools/fixedRate/FixedRateExchange.ts#L33

exchangeOwner

Property
private
exchangeOwner
src/pools/fixedRate/FixedRateExchange.ts#L21

fixedRate

Property
private
fixedRate
src/pools/fixedRate/FixedRateExchange.ts#L24

withMint

Property
private
withMint
src/pools/fixedRate/FixedRateExchange.ts#L31

FixedPriceSwap

baseTokenAmount

Property
private
baseTokenAmount
src/pools/fixedRate/FixedRateExchange.ts#L47

datatokenAmount

Property
private
datatokenAmount
src/pools/fixedRate/FixedRateExchange.ts#L48

exchangeId

Property
private
exchangeId
src/pools/fixedRate/FixedRateExchange.ts#L45

FreCreationParams

allowedConsumer

Property
private
allowedConsumer
src/@types/FixedPrice.ts#L11

baseTokenAddress

Property
private
baseTokenAddress
src/@types/FixedPrice.ts#L3

baseTokenDecimals

Property
private
baseTokenDecimals
src/@types/FixedPrice.ts#L6

datatokenDecimals

Property
private
datatokenDecimals
src/@types/FixedPrice.ts#L7

fixedRate

Property
private
fixedRate
src/@types/FixedPrice.ts#L8

fixedRateAddress

Property
private
fixedRateAddress
src/@types/FixedPrice.ts#L2

marketFee

Property
private
marketFee
src/@types/FixedPrice.ts#L9

marketFeeCollector

Property
private
marketFeeCollector
src/@types/FixedPrice.ts#L5

owner

Property
private
owner
src/@types/FixedPrice.ts#L4

withMint

Property
private
withMint
src/@types/FixedPrice.ts#L10

FreOrderParams

exchangeContract

Property
private
exchangeContract
src/@types/FixedPrice.ts#L15

exchangeId

Property
private
exchangeId
src/@types/FixedPrice.ts#L16

marketFeeAddress

Property
private
marketFeeAddress
src/@types/FixedPrice.ts#L19

maxBaseTokenAmount

Property
private
maxBaseTokenAmount
src/@types/FixedPrice.ts#L17

swapMarketFee

Property
private
swapMarketFee
src/@types/FixedPrice.ts#L18

HttpCallback

Metadata

additionalInformation

Property
private
Stores additional information, this is customizable by publisher
additionalInformation
src/@types/DDO/Metadata.ts#L137

algorithm

Property
private
Information about asset of typealgorithm
algorithm
src/@types/DDO/Metadata.ts#L131

author

Property
private
Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).
author
src/@types/DDO/Metadata.ts#L87

categories

Property
private
Array of categories associated to the asset. Note: recommended to use tags instead of this.
categories
src/@types/DDO/Metadata.ts#L113

contentLanguage

Property
private
The language of the content. Use one of the language codes from the IETF BCP 47 standard
contentLanguage
src/@types/DDO/Metadata.ts#L125

copyrightHolder

Property
private
The party holding the legal copyright. Empty by default.
copyrightHolder
src/@types/DDO/Metadata.ts#L119

created

Property
private
Contains the date of publishing in ISO Date Time
created
src/@types/DDO/Metadata.ts#L56

description

Property
private
Details of what the resource is.
description
src/@types/DDO/Metadata.ts#L74

license

Property
private
Short name referencing the license of the asset. If it’s not specified, the following value will be added: “No License Specified”.
license
src/@types/DDO/Metadata.ts#L94

name

Property
private
Descriptive name or title of the asset.
name
src/@types/DDO/Metadata.ts#L68

tags

Property
private
Array of keywords or tags used to describe this content. Empty by default.
tags
src/@types/DDO/Metadata.ts#L107

type

Property
private
Asset type. Includes "dataset" (e.g. csv file), "algorithm" (e.g. Python script). Each type needs a different subset of metadata attributes.
type
src/@types/DDO/Metadata.ts#L81

updated

Property
private
Contains the the date of last update in ISO Date Time
updated
src/@types/DDO/Metadata.ts#L62

MetadataAlgorithm

container

Property
private
Object describing the Docker container image.
container
src/@types/DDO/Metadata.ts#L24

language

Property
private
Language used to implement the software.
language
src/@types/DDO/Metadata.ts#L6

rawcode

Property
private
Rawcode
rawcode
src/@types/DDO/Metadata.ts#L18

version

Property
private
Version of the software preferably in SemVer notation.
version
src/@types/DDO/Metadata.ts#L12

MetadataAndTokenURI

data

Property
private
data
src/@types/Erc721.ts#L8

flags

Property
private
flags
src/@types/Erc721.ts#L7

metaDataDecryptorAddress

Property
private
metaDataDecryptorAddress
src/@types/Erc721.ts#L6

metaDataDecryptorUrl

Property
private
metaDataDecryptorUrl
src/@types/Erc721.ts#L5

metaDataHash

Property
private
metaDataHash
src/@types/Erc721.ts#L9

metaDataState

Property
private
metaDataState
src/@types/Erc721.ts#L4

metadataProofs

Property
private
metadataProofs
src/@types/Erc721.ts#L12

tokenId

Property
private
tokenId
src/@types/Erc721.ts#L10

tokenURI

Property
private
tokenURI
src/@types/Erc721.ts#L11

MetadataProof

validatorAddress

Property
private
validatorAddress
src/@types/DDO/Metadata.ts#L141

NftCreateData

name

Property
private
name
src/factories/NFTFactory.ts#L42

owner

Property
private
owner
src/factories/NFTFactory.ts#L47

symbol

Property
private
symbol
src/factories/NFTFactory.ts#L43

templateIndex

Property
private
templateIndex
src/factories/NFTFactory.ts#L44

tokenURI

Property
private
tokenURI
src/factories/NFTFactory.ts#L45

transferable

Property
private
transferable
src/factories/NFTFactory.ts#L46

Operation

amountsIn

Property
private
when swapExactAmountIn is EXACT amount IN expressed in Wei
amountsIn
src/@types/Router.ts#L31

amountsOut

Property
private
when swapExactAmountIn is MIN amount OUT expressed in Wei
amountsOut
src/@types/Router.ts#L42

exchangeIds

Property
private
used only for FixedRate or Dispenser, but needs to be filled even for pool
exchangeIds
src/@types/Router.ts#L6

marketFeeAddress

Property
private
market fee address to receive fees
marketFeeAddress
src/@types/Router.ts#L58

maxPrice

Property
private
max price (only for pools) expressed in Wei
maxPrice
src/@types/Router.ts#L48

operation

Property
private
operation: 0 - swapExactAmountIn 1 - swapExactAmountOut 2 - FixedRateExchange 3 - Dispenser
operation
src/@types/Router.ts#L20

source

Property
private
pool Address
source
src/@types/Router.ts#L11

swapMarketFee

Property
private
swap fee amount
swapMarketFee
src/@types/Router.ts#L53

tokenIn

Property
private
token in address
tokenIn
src/@types/Router.ts#L25

tokenOut

Property
private
token out address
tokenOut
src/@types/Router.ts#L36

OrderParams

_consumeMarketFee

Property
private
_consumeMarketFee
src/tokens/Datatoken.ts#L38

_providerFee

Property
private
_providerFee
src/tokens/Datatoken.ts#L37

consumer

Property
private
consumer
src/tokens/Datatoken.ts#L35

serviceIndex

Property
private
serviceIndex
src/tokens/Datatoken.ts#L36

PoolCreationParams

baseTokenAddress

Property
private
baseTokenAddress
src/@types/Pool.ts#L3

baseTokenDecimals

Property
private
baseTokenDecimals
src/@types/Pool.ts#L9

baseTokenSender

Property
private
baseTokenSender
src/@types/Pool.ts#L4

initialBaseTokenLiquidity

Property
private
initialBaseTokenLiquidity
src/@types/Pool.ts#L12

marketFeeCollector

Property
private
marketFeeCollector
src/@types/Pool.ts#L6

poolTemplateAddress

Property
private
poolTemplateAddress
src/@types/Pool.ts#L7

publisherAddress

Property
private
publisherAddress
src/@types/Pool.ts#L5

rate

Property
private
rate
src/@types/Pool.ts#L8

ssContract

Property
private
ssContract
src/@types/Pool.ts#L2

swapFeeLiquidityProvider

Property
private
swapFeeLiquidityProvider
src/@types/Pool.ts#L13

swapFeeMarketRunner

Property
private
swapFeeMarketRunner
src/@types/Pool.ts#L14

vestedBlocks

Property
private
vestedBlocks
src/@types/Pool.ts#L11

vestingAmount

Property
private
vestingAmount
src/@types/Pool.ts#L10

PoolPriceAndFees

consumeMarketSwapFeeAmount

Property
private
consumeMarketSwapFeeAmount
src/@types/Pool.ts#L49

liquidityProviderSwapFeeAmount

Property
private
liquidityProviderSwapFeeAmount
src/@types/Pool.ts#L46

oceanFeeAmount

Property
private
oceanFeeAmount
src/@types/Pool.ts#L47

publishMarketSwapFeeAmount

Property
private
publishMarketSwapFeeAmount
src/@types/Pool.ts#L48

tokenAmount

Property
private
tokenAmount
src/@types/Pool.ts#L45

PriceAndFees

baseTokenAmount

Property
private
baseTokenAmount
src/@types/FixedPrice.ts#L23

consumeMarketFeeAmount

Property
private
consumeMarketFeeAmount
src/@types/FixedPrice.ts#L26

marketFeeAmount

Property
private
marketFeeAmount
src/@types/FixedPrice.ts#L25

oceanFeeAmount

Property
private
oceanFeeAmount
src/@types/FixedPrice.ts#L24

ProviderComputeInitialize

datatoken

Property
private
datatoken
src/@types/Provider.ts#L20

providerFee

Property
private
providerFee
src/@types/Provider.ts#L22

validOrder

Property
private
validOrder
src/@types/Provider.ts#L21

ProviderComputeInitializeResults

algorithm

Property
private
algorithm
src/@types/Provider.ts#L26

datasets

Property
private
datasets
src/@types/Provider.ts#L27

ProviderFees

providerData

Property
private
providerData
src/@types/Provider.ts#L8

providerFeeAddress

Property
private
providerFeeAddress
src/@types/Provider.ts#L2

providerFeeAmount

Property
private
providerFeeAmount
src/@types/Provider.ts#L4

providerFeeToken

Property
private
providerFeeToken
src/@types/Provider.ts#L3

r

Property
private
r
src/@types/Provider.ts#L6

s

Property
private
s
src/@types/Provider.ts#L7

v

Property
private
v
src/@types/Provider.ts#L5

validUntil

Property
private
validUntil
src/@types/Provider.ts#L9

ProviderInitialize

computeAddress

Property
private
computeAddress
src/@types/Provider.ts#L15

datatoken

Property
private
datatoken
src/@types/Provider.ts#L13

nonce

Property
private
nonce
src/@types/Provider.ts#L14

providerFee

Property
private
providerFee
src/@types/Provider.ts#L16

PublisherTrustedAlgorithm

containerSectionChecksum

Property
private
Hash of algorithm’s metadata.algorithm.container section.
containerSectionChecksum
src/@types/DDO/Service.ts#L18

did

Property
private
The DID of the algorithm which is trusted by the publisher.
did
src/@types/DDO/Service.ts#L6

filesChecksum

Property
private
Hash of algorithm’s files section.
filesChecksum
src/@types/DDO/Service.ts#L12

Purgatory

reason

Property
private
If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
reason
src/@types/Asset.ts#L63

state

Property
private
If `true`, asset is in purgatory.
state
src/@types/Asset.ts#L57

Service

additionalInformation

Property
private
Stores service specific additional information, this is customizable by publisher
additionalInformation
src/@types/DDO/Service.ts#L109

compute

Property
private
If service is of type compute, holds information about the compute-related privacy settings & resources.
compute
src/@types/DDO/Service.ts#L103

datatokenAddress

Property
private
Datatoken address
datatokenAddress
src/@types/DDO/Service.ts#L73

description

Property
private
Service description
description
src/@types/DDO/Service.ts#L97

files

Property
private
Encrypted file URLs.
files
src/@types/DDO/Service.ts#L67

id

Property
private
Unique ID
id
src/@types/DDO/Service.ts#L55

name

Property
private
Service friendly name
name
src/@types/DDO/Service.ts#L91

serviceEndpoint

Property
private
Provider URL (schema + host).
serviceEndpoint
src/@types/DDO/Service.ts#L79

timeout

Property
private
Describing how long the service can be used after consumption is initiated.
timeout
src/@types/DDO/Service.ts#L85

type

Property
private
Type of service (access, compute, wss.
type
src/@types/DDO/Service.ts#L61

ServiceComputeOptions

allowNetworkAccess

Property
private
If true, the algorithm job will have network access.
allowNetworkAccess
src/@types/DDO/Service.ts#L34

allowRawAlgorithm

Property
private
If true, any passed raw text will be allowed to run. Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input. Should be false by default in all implementations.
allowRawAlgorithm
src/@types/DDO/Service.ts#L28

publisherTrustedAlgorithmPublishers

Property
private
If empty, then any published algorithm is allowed. Otherwise, only published algorithms by some publishers are allowed
publisherTrustedAlgorithmPublishers
src/@types/DDO/Service.ts#L41

publisherTrustedAlgorithms

Property
private
If empty, then any published algorithm is allowed. (see below)
publisherTrustedAlgorithms
src/@types/DDO/Service.ts#L47

ServiceEndpoint

method

Property
private
method
src/provider/Provider.ts#L21

serviceName

Property
private
serviceName
src/provider/Provider.ts#L20

urlPath

Property
private
urlPath
src/provider/Provider.ts#L22

TokenInOutMarket

marketFeeAddress

Property
private
marketFeeAddress
src/@types/Pool.ts#L25

tokenIn

Property
private
tokenIn
src/@types/Pool.ts#L23

tokenInDecimals

Property
private
tokenInDecimals
src/@types/Pool.ts#L26

tokenOut

Property
private
tokenOut
src/@types/Pool.ts#L24

tokenOutDecimals

Property
private
tokenOutDecimals
src/@types/Pool.ts#L27

TokenOrder

_consumeMarketFee

Property
private
_consumeMarketFee
src/factories/NFTFactory.ts#L38

_providerFee

Property
private
_providerFee
src/factories/NFTFactory.ts#L37

consumer

Property
private
consumer
src/factories/NFTFactory.ts#L35

serviceIndex

Property
private
serviceIndex
src/factories/NFTFactory.ts#L36

tokenAddress

Property
private
tokenAddress
src/factories/NFTFactory.ts#L34

UserCustomParameters

ValidateMetadata

errors

Property
private
errors
src/@types/DDO/Metadata.ts#L148

hash

Property
private
hash
src/@types/DDO/Metadata.ts#L149

proof

Property
private
proof
src/@types/DDO/Metadata.ts#L150

valid

Property
private
valid
src/@types/DDO/Metadata.ts#L147

ComputeResultType

GASLIMIT_DEFAULT

LoggerInstance

ProviderInstance

ZERO_ADDRESS

configHelperNetworks

allowance

amountToUnits

approve

balance

calcMaxExactIn

calcMaxExactOut

downloadFile

downloadFileBrowser

estApprove

estTransfer

estimateGas

fetchData

generateDid

generateDtName

getData

getErcCreationParams

getFairGasPrice

getFreCreationParams

getFreOrderParams

getHash

getMaxAddLiquidity

getMaxRemoveLiquidity

getMaxSwapExactIn

getMaxSwapExactOut

getPoolCreationParams

postData

setContractDefaults

signHash

sleep

transfer

unitsToAmount