diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c48c551..1b83a729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,3 +213,28 @@ jobs: - name: Create Guide & Commit if there are changes run: npm run commit:guides + + update_docs: + runs-on: ubuntu-latest + needs: [test_unit, test_integration] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: checkout ocean.js repo + uses: actions/checkout@v3 + with: + repository: 'oceanprotocol/ocean.js' + path: 'ocean.js' + ref: ${{ github.event.pull_request.head.sha }} + + - name: setup git config + run: | + # setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default + git config user.name "GitHub Actions Bot" + git config user.email "<>" + + - name: Create updated docs & commit changes + run: npm run commit:docs diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..b4249b76 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,192 @@ +@oceanprotocol/lib / [Exports](modules.md) + +[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com) + +

ocean.js

+ +> JavaScript library to privately & securely publish, exchange, and consume data. + +[![npm](https://img.shields.io/npm/v/@oceanprotocol/lib.svg)](https://www.npmjs.com/package/@oceanprotocol/lib) +[![Build Status](https://github.com/oceanprotocol/ocean.js/workflows/CI/badge.svg)](https://github.com/oceanprotocol/ocean.js/actions) +[![Maintainability](https://api.codeclimate.com/v1/badges/6381c81b8ac568a53537/maintainability)](https://codeclimate.com/github/oceanprotocol/ocean.js/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/6381c81b8ac568a53537/test_coverage)](https://codeclimate.com/github/oceanprotocol/ocean.js/test_coverage) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier) +[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol) + +With ocean.js, you can: + +- **Publish** data services: downloadable files or compute-to-data. Create an ERC721 **data NFT** for each service, and ERC20 **datatoken** for access (1.0 datatokens to access). +- **Sell** datatokens for a fixed price. Sell data NFTs. +- **Transfer** data NFTs & datatokens to another owner, and **all other ERC721 & ERC20 actions** using [web3.js](https://web3js.readthedocs.io/en/v1.2.9/web3-eth-contract.html) etc. + +ocean.js is part of the [Ocean Protocol](https://oceanprotocol.com) toolset. + +This is in alpha state. If you run into problems, please open up a [new issue](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=). + +- [📚 Prerequisites](#-prerequisites) +- [🏗 Installation & Usage](#-installation--usage) +- [🦑 Development](#-development) +- [✨ Code Style](#-code-style) +- [👩‍🔬 Testing](#-testing) + - [Unit Tests](#unit-tests) + - [Integration Tests](#integration-tests) +- [🛳 Production](#-production) +- [⬆️ Releases](#️-releases) + - [Production](#production) + - [Pre-Releases](#pre-releases) +- [🏛 License](#-license) + +## 📚 Prerequisites + +- node.js ([Install from here](https://nodejs.org/en/download/)) +- Docker ([Managed as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/)) +- A Unix based operating system (Mac or Linux) + +## 🏗 Installation & Usage + +```bash +npm install @oceanprotocol/lib +``` + +- Checkout our [code examples](CodeExamples.md) or [compute to data examples](C2DExamples.md) to see how you can use ocean.js. +- Refer to the [Ocean Protocol documentation](https://docs.oceanprotocol.com/) for more guides and tutorials. +- Visit the [Ocean Protocol website](https://docs.oceanprotocol.com/) for general information about Ocean Protocol. +- If you have any difficulties or if you have further questions about how to use ocean.js please reach out to us on [Discord](https://discord.gg/TnXjkR5). +- If you notice any bugs or issues with ocean.js please [open an issue on github](https://github.com/oceanprotocol/ocean.js/issues/new?assignees=&labels=bug&template=bug_report.md&title=). + +## 🦑 Development + +The project is authored with TypeScript and compiled with `tsc`. + +To start compiler in watch mode: + +```bash +npm install +npm start +``` + +## ✨ Code Style + +For linting and auto-formatting you can use from the root of the project: + +```bash +# lint all js with eslint +npm run lint + +# auto format all js & css with prettier, taking all configs into account +npm run format +``` + +## 👩‍🔬 Testing + +Test suite for unit & integration tests is setup with [Mocha](https://mochajs.org) as test runner, and [nyc](https://github.com/istanbuljs/nyc) for coverage reporting. A combined coverage report is sent to CodeClimate via the `coverage` GitHub Actions job. + +Running all tests requires running Ocean Protocol components beforehand with [Barge](https://github.com/oceanprotocol/barge), which also runs a `ganache-cli` instance: + +```bash +git clone https://github.com/oceanprotocol/barge +cd barge + +./start_ocean.sh --with-provider2 --no-dashboard --with-c2d +``` + +You can then proceed to run in another terminal. + +Let ocean.js know where to pickup the smart contract addresses, which has been written out by Barge in this location: + +``` +export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" +``` + +Build metadata: + +``` +npm run build:metadata +``` + +Executing linting, type checking, unit, and integration tests with coverage reporting all in one go: + +```bash +npm test +``` + +### Unit Tests + +You can execute the unit tests individually with: + +```bash +npm run test:unit +# same thing, but with coverage reporting +npm run test:unit:cover +``` + +### Integration Tests + +You can execute the integration tests individually with: + +```bash +npm run test:integration +# same thing, but with coverage reporting +npm run test:integration:cover +``` + +> Note: On macOS, changes to the `provider`, `metadataCache` and `subgraph` URLs are required, as their default `barge` IPs can not be accessed due to network constraints on macOS. Instead use `http://127.0.0.1` for each direct call to the mentioned services, but keep the internal `provider` URL (`http://172.15.0.4:8030`) hardcoded inside all DDO's `serviceEndpoint`, and when calling `nft.setMetadata()`. + +## 🛳 Production + +To create a production build, run from the root of the project: + +```bash +npm run build +``` + +## ⬆️ Releases + +Releases are managed semi-automatically. They are always manually triggered from a developer's machine with release scripts. + +### Production + +From a clean `main` branch you can run the release task bumping the version accordingly based on semantic versioning: + +```bash +npm run release +``` + +The task does the following: + +- bumps the project version in `package.json`, `package-lock.json` +- auto-generates and updates the CHANGELOG.md file from commit messages +- creates a Git tag +- commits and pushes everything +- creates a GitHub release with commit messages as description +- Git tag push will trigger a GitHub Action workflow to do a npm release + +For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases) + +### Pre-Releases + +For pre-releases, this is required for the first one like `v0.18.0-next.0`: + +```bash +./node_modules/.bin/release-it major|minor|patch --preRelease=next +``` + +Further releases afterwards can be done with `npm run release` again and selecting the appropriate next version, in this case `v0.18.0-next.1` and so on. + +## 🏛 License + +``` +Copyright ((C)) 2023 Ocean Protocol Foundation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` diff --git a/docs/classes/Aquarius.md b/docs/classes/Aquarius.md new file mode 100644 index 00000000..6aaf97db --- /dev/null +++ b/docs/classes/Aquarius.md @@ -0,0 +1,171 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Aquarius + +# Class: Aquarius + +## Table of contents + +### Constructors + +- [constructor](Aquarius.md#constructor) + +### Properties + +- [aquariusURL](Aquarius.md#aquariusurl) + +### Methods + +- [getAssetMetadata](Aquarius.md#getassetmetadata) +- [querySearch](Aquarius.md#querysearch) +- [resolve](Aquarius.md#resolve) +- [validate](Aquarius.md#validate) +- [waitForAqua](Aquarius.md#waitforaqua) + +## Constructors + +### constructor + +• **new Aquarius**(`aquariusURL`) + +Instantiate Aquarius + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `aquariusURL` | `string` | + +#### Defined in + +[services/Aquarius.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L21) + +## Properties + +### aquariusURL + +• **aquariusURL**: `string` + +#### Defined in + +[services/Aquarius.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L15) + +## Methods + +### getAssetMetadata + +▸ **getAssetMetadata**(`did`, `signal?`): `Promise`<`any`\> + +Search over the DDOs using a query. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | DID of the asset | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[services/Aquarius.ts:135](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L135) + +___ + +### querySearch + +▸ **querySearch**(`query`, `signal?`): `Promise`<`any`\> + +Search over the DDOs using a query. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `query` | [`SearchQuery`](../interfaces/SearchQuery.md) | Query to filter the DDOs. | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[services/Aquarius.ts:166](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L166) + +___ + +### resolve + +▸ **resolve**(`did`, `signal?`): `Promise`<[`Asset`](../interfaces/Asset.md)\> + +Resolves a DID + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | DID of the asset. | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<[`Asset`](../interfaces/Asset.md)\> + +Asset + +#### Defined in + +[services/Aquarius.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L30) + +___ + +### validate + +▸ **validate**(`ddo`, `signal?`): `Promise`<[`ValidateMetadata`](../interfaces/ValidateMetadata.md)\> + +Validate DDO content + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `ddo` | [`DDO`](../interfaces/DDO.md) | DID Descriptor Object content. | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<[`ValidateMetadata`](../interfaces/ValidateMetadata.md)\> + +. + +#### Defined in + +[services/Aquarius.ts:94](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L94) + +___ + +### waitForAqua + +▸ **waitForAqua**(`did`, `txid?`, `signal?`): `Promise`<[`Asset`](../interfaces/Asset.md)\> + +Blocks until Aqua will cache the did (or the update for that did) or timeouts + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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`](../interfaces/Asset.md)\> + +DDO of the asset. + +#### Defined in + +[services/Aquarius.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L58) diff --git a/docs/classes/Config.md b/docs/classes/Config.md new file mode 100644 index 00000000..e0664b71 --- /dev/null +++ b/docs/classes/Config.md @@ -0,0 +1,481 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Config + +# Class: Config + +## Table of contents + +### Constructors + +- [constructor](Config.md#constructor) + +### Properties + +- [DFRewards](Config.md#dfrewards) +- [DFStrategyV1](Config.md#dfstrategyv1) +- [authMessage](Config.md#authmessage) +- [authTokenExpiration](Config.md#authtokenexpiration) +- [chainId](Config.md#chainid) +- [datatokensABI](Config.md#datatokensabi) +- [dispenserABI](Config.md#dispenserabi) +- [dispenserAddress](Config.md#dispenseraddress) +- [explorerUri](Config.md#exploreruri) +- [fixedRateExchangeAddress](Config.md#fixedrateexchangeaddress) +- [fixedRateExchangeAddressABI](Config.md#fixedrateexchangeaddressabi) +- [gasFeeMultiplier](Config.md#gasfeemultiplier) +- [metadataCacheUri](Config.md#metadatacacheuri) +- [network](Config.md#network) +- [nftFactoryAddress](Config.md#nftfactoryaddress) +- [nodeUri](Config.md#nodeuri) +- [oceanTokenAddress](Config.md#oceantokenaddress) +- [oceanTokenSymbol](Config.md#oceantokensymbol) +- [opfCommunityFeeCollector](Config.md#opfcommunityfeecollector) +- [parityUri](Config.md#parityuri) +- [providerAddress](Config.md#provideraddress) +- [providerUri](Config.md#provideruri) +- [sideStakingAddress](Config.md#sidestakingaddress) +- [startBlock](Config.md#startblock) +- [subgraphUri](Config.md#subgraphuri) +- [threshold](Config.md#threshold) +- [transactionBlockTimeout](Config.md#transactionblocktimeout) +- [transactionConfirmationBlocks](Config.md#transactionconfirmationblocks) +- [transactionPollingTimeout](Config.md#transactionpollingtimeout) +- [veAllocate](Config.md#veallocate) +- [veDelegation](Config.md#vedelegation) +- [veDelegationProxy](Config.md#vedelegationproxy) +- [veFeeDistributor](Config.md#vefeedistributor) +- [veFeeEstimate](Config.md#vefeeestimate) +- [veOCEAN](Config.md#veocean) +- [verbose](Config.md#verbose) +- [web3Provider](Config.md#web3provider) + +## Constructors + +### constructor + +• **new Config**() + +## Properties + +### DFRewards + +• `Optional` **DFRewards**: `string` + +#### Defined in + +[config/Config.ts:180](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L180) + +___ + +### DFStrategyV1 + +• `Optional` **DFStrategyV1**: `string` + +#### Defined in + +[config/Config.ts:181](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L181) + +___ + +### authMessage + +• `Optional` **authMessage**: `string` + +Message shown when the user creates its own token. + +#### Defined in + +[config/Config.ts:105](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L105) + +___ + +### authTokenExpiration + +• `Optional` **authTokenExpiration**: `number` + +Token expiration time in ms. + +#### Defined in + +[config/Config.ts:111](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L111) + +___ + +### chainId + +• **chainId**: `number` + +Chain ID + +#### Defined in + +[config/Config.ts:125](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L125) + +___ + +### datatokensABI + +• `Optional` **datatokensABI**: [`AbiItem`](../interfaces/AbiItem.md) \| [`AbiItem`](../interfaces/AbiItem.md)[] + +datatokens ABI + +#### Defined in + +[config/Config.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L52) + +___ + +### dispenserABI + +• `Optional` **dispenserABI**: [`AbiItem`](../interfaces/AbiItem.md) \| [`AbiItem`](../interfaces/AbiItem.md)[] + +DispenserABI + +#### Defined in + +[config/Config.ts:76](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L76) + +___ + +### dispenserAddress + +• `Optional` **dispenserAddress**: `string` + +DispenserAddress + +#### Defined in + +[config/Config.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L70) + +___ + +### explorerUri + +• **explorerUri**: `string` + +Url of the blockchain exporer ex: https://etherscan.io + +#### Defined in + +[config/Config.ts:143](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L143) + +___ + +### fixedRateExchangeAddress + +• `Optional` **fixedRateExchangeAddress**: `string` + +FixedRateExchangeAddress + +#### Defined in + +[config/Config.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L58) + +___ + +### fixedRateExchangeAddressABI + +• `Optional` **fixedRateExchangeAddressABI**: [`AbiItem`](../interfaces/AbiItem.md) \| [`AbiItem`](../interfaces/AbiItem.md)[] + +FixedRateExchangeAddressABI + +#### Defined in + +[config/Config.ts:64](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L64) + +___ + +### gasFeeMultiplier + +• **gasFeeMultiplier**: `number` + +Specify the multiplier for the gas fee + +#### Defined in + +[config/Config.ts:173](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L173) + +___ + +### metadataCacheUri + +• `Optional` **metadataCacheUri**: `string` + +Metadata Store URL. + +#### Defined in + +[config/Config.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L21) + +___ + +### network + +• **network**: `string` + +Network name ex: mainnet, goerli, polygon + +#### Defined in + +[config/Config.ts:131](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L131) + +___ + +### nftFactoryAddress + +• `Optional` **nftFactoryAddress**: `string` + +Factory address + +#### Defined in + +[config/Config.ts:46](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L46) + +___ + +### nodeUri + +• `Optional` **nodeUri**: `string` + +Ethereum node URL. + +#### Defined in + +[config/Config.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L9) + +___ + +### oceanTokenAddress + +• `Optional` **oceanTokenAddress**: `string` + +Ocean Token address + +#### Defined in + +[config/Config.ts:40](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L40) + +___ + +### oceanTokenSymbol + +• **oceanTokenSymbol**: `string` + +Ocean toke symbol on the chain, it's used just for convenience to reduce number of calls + +#### Defined in + +[config/Config.ts:149](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L149) + +___ + +### opfCommunityFeeCollector + +• `Optional` **opfCommunityFeeCollector**: `string` + +OPFCommunityFeeCollector + +#### Defined in + +[config/Config.ts:82](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L82) + +___ + +### parityUri + +• `Optional` **parityUri**: `string` + +Parity config + +#### Defined in + +[config/Config.ts:117](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L117) + +___ + +### providerAddress + +• `Optional` **providerAddress**: `string` + +Address of Provider. + +#### Defined in + +[config/Config.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L15) + +___ + +### providerUri + +• `Optional` **providerUri**: `string` + +Provider URL. + +#### Defined in + +[config/Config.ts:27](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L27) + +___ + +### sideStakingAddress + +• `Optional` **sideStakingAddress**: `string` + +SideStaking address + +#### Defined in + +[config/Config.ts:88](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L88) + +___ + +### startBlock + +• `Optional` **startBlock**: `number` + +block number of the deployment + +#### Defined in + +[config/Config.ts:94](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L94) + +___ + +### subgraphUri + +• **subgraphUri**: `string` + +Url of the relevant subgraph instance ex: https://subgraph.mainnet.oceanprotocol.com + +#### Defined in + +[config/Config.ts:137](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L137) + +___ + +### threshold + +• `Optional` **threshold**: `number` + +#### Defined in + +[config/Config.ts:119](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L119) + +___ + +### transactionBlockTimeout + +• **transactionBlockTimeout**: `number` + +Specify the transaction Block Timeout + +#### Defined in + +[config/Config.ts:155](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L155) + +___ + +### transactionConfirmationBlocks + +• **transactionConfirmationBlocks**: `number` + +Specify the transaction Confirmation Blocks + +#### Defined in + +[config/Config.ts:161](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L161) + +___ + +### transactionPollingTimeout + +• **transactionPollingTimeout**: `number` + +Specify the transaction Polling Blocks Timeout + +#### Defined in + +[config/Config.ts:167](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L167) + +___ + +### veAllocate + +• `Optional` **veAllocate**: `string` + +#### Defined in + +[config/Config.ts:175](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L175) + +___ + +### veDelegation + +• `Optional` **veDelegation**: `string` + +#### Defined in + +[config/Config.ts:177](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L177) + +___ + +### veDelegationProxy + +• `Optional` **veDelegationProxy**: `string` + +#### Defined in + +[config/Config.ts:179](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L179) + +___ + +### veFeeDistributor + +• `Optional` **veFeeDistributor**: `string` + +#### Defined in + +[config/Config.ts:178](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L178) + +___ + +### veFeeEstimate + +• `Optional` **veFeeEstimate**: `string` + +#### Defined in + +[config/Config.ts:182](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L182) + +___ + +### veOCEAN + +• `Optional` **veOCEAN**: `string` + +#### Defined in + +[config/Config.ts:176](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L176) + +___ + +### verbose + +• `Optional` **verbose**: `boolean` \| [`LogLevel`](../enums/LogLevel.md) + +Log level. + +#### Defined in + +[config/Config.ts:99](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L99) + +___ + +### web3Provider + +• `Optional` **web3Provider**: `any` + +Web3 Provider. + +#### Defined in + +[config/Config.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/Config.ts#L34) diff --git a/docs/classes/ConfigHelper.md b/docs/classes/ConfigHelper.md new file mode 100644 index 00000000..350dd102 --- /dev/null +++ b/docs/classes/ConfigHelper.md @@ -0,0 +1,66 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ConfigHelper + +# Class: ConfigHelper + +## Table of contents + +### Constructors + +- [constructor](ConfigHelper.md#constructor) + +### Methods + +- [getAddressesFromEnv](ConfigHelper.md#getaddressesfromenv) +- [getConfig](ConfigHelper.md#getconfig) + +## Constructors + +### constructor + +• **new ConfigHelper**() + +## Methods + +### getAddressesFromEnv + +▸ **getAddressesFromEnv**(`network`, `customAddresses?`): `Partial`<[`Config`](Config.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `network` | `string` | +| `customAddresses?` | `any` | + +#### Returns + +`Partial`<[`Config`](Config.md)\> + +#### Defined in + +[config/ConfigHelper.ts:124](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/ConfigHelper.ts#L124) + +___ + +### getConfig + +▸ **getConfig**(`network`, `infuraProjectId?`): [`Config`](Config.md) + +Returns the config object for a specific network supported by the oceanprotocol stack + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `network` | `string` \| `number` | the network's chainId or name | +| `infuraProjectId?` | `string` | optional infura project id that will replace the configs node URI | + +#### Returns + +[`Config`](Config.md) + +Config obhjedct + +#### Defined in + +[config/ConfigHelper.ts:214](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/ConfigHelper.ts#L214) diff --git a/docs/classes/Datatoken.md b/docs/classes/Datatoken.md new file mode 100644 index 00000000..eb87e6a1 --- /dev/null +++ b/docs/classes/Datatoken.md @@ -0,0 +1,1123 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Datatoken + +# Class: Datatoken + +## Hierarchy + +- [`SmartContract`](SmartContract.md) + + ↳ **`Datatoken`** + +## Table of contents + +### Constructors + +- [constructor](Datatoken.md#constructor) + +### Properties + +- [abi](Datatoken.md#abi) +- [abiEnterprise](Datatoken.md#abienterprise) +- [config](Datatoken.md#config) +- [nft](Datatoken.md#nft) +- [signer](Datatoken.md#signer) + +### Methods + +- [addMinter](Datatoken.md#addminter) +- [addPaymentManager](Datatoken.md#addpaymentmanager) +- [amountToUnits](Datatoken.md#amounttounits) +- [approve](Datatoken.md#approve) +- [balance](Datatoken.md#balance) +- [buyFromDispenserAndOrder](Datatoken.md#buyfromdispenserandorder) +- [buyFromFreAndOrder](Datatoken.md#buyfromfreandorder) +- [cleanPermissions](Datatoken.md#cleanpermissions) +- [createDispenser](Datatoken.md#createdispenser) +- [createFixedRate](Datatoken.md#createfixedrate) +- [getCap](Datatoken.md#getcap) +- [getContract](Datatoken.md#getcontract) +- [getDecimals](Datatoken.md#getdecimals) +- [getDefaultAbi](Datatoken.md#getdefaultabi) +- [getFairGasPrice](Datatoken.md#getfairgasprice) +- [getFreOrderParams](Datatoken.md#getfreorderparams) +- [getNFTAddress](Datatoken.md#getnftaddress) +- [getName](Datatoken.md#getname) +- [getPaymentCollector](Datatoken.md#getpaymentcollector) +- [getPermissions](Datatoken.md#getpermissions) +- [getPublishingMarketFee](Datatoken.md#getpublishingmarketfee) +- [getSymbol](Datatoken.md#getsymbol) +- [isDatatokenDeployer](Datatoken.md#isdatatokendeployer) +- [mint](Datatoken.md#mint) +- [removeMinter](Datatoken.md#removeminter) +- [removePaymentManager](Datatoken.md#removepaymentmanager) +- [reuseOrder](Datatoken.md#reuseorder) +- [setData](Datatoken.md#setdata) +- [setPaymentCollector](Datatoken.md#setpaymentcollector) +- [setPublishingMarketFee](Datatoken.md#setpublishingmarketfee) +- [startOrder](Datatoken.md#startorder) +- [transfer](Datatoken.md#transfer) +- [transferWei](Datatoken.md#transferwei) +- [unitsToAmount](Datatoken.md#unitstoamount) + +## Constructors + +### constructor + +• **new Datatoken**(`signer`, `network?`, `config?`, `abi?`, `abiEnterprise?`) + +Instantiate Datatoken class + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | +| `abiEnterprise?` | [`AbiItem`](../interfaces/AbiItem.md)[] | Enterprise ABI array of the smart contract | + +#### Overrides + +[SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor) + +#### Defined in + +[contracts/Datatoken.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L38) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContract](SmartContract.md).[abi](SmartContract.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### abiEnterprise + +• **abiEnterprise**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Defined in + +[contracts/Datatoken.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L23) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContract](SmartContract.md).[config](SmartContract.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### nft + +• **nft**: [`Nft`](Nft.md) + +#### Defined in + +[contracts/Datatoken.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L24) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContract](SmartContract.md).[signer](SmartContract.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### addMinter + +▸ **addMinter**<`G`\>(`dtAddress`, `address`, `minter`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add Minter for an ERC20 Datatoken +only DatatokenDeployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | caller address | +| `minter` | `string` | address which is going to be a Minter | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:252](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L252) + +___ + +### addPaymentManager + +▸ **addPaymentManager**<`G`\>(`dtAddress`, `address`, `paymentManager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Adds a payment manager on a datatoken to a desired address.(can set who's going to collect fee when consuming orders) +only DatatokenDeployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | Caller address | +| `paymentManager` | `string` | The address of the payment manager | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:322](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L322) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### approve + +▸ **approve**<`G`\>(`dtAddress`, `spender`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Approves a spender to spend a certain amount of datatokens. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `spender` | `string` | Spender address | +| `amount` | `string` | Number of datatokens, as number. Will be converted to wei | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L58) + +___ + +### balance + +▸ **balance**(`datatokenAddress`, `address`): `Promise`<`string`\> + +Get Address Balance for datatoken + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `datatokenAddress` | `string` | - | +| `address` | `string` | user adress | + +#### Returns + +`Promise`<`string`\> + +balance Number of datatokens. Will be converted from wei + +#### Defined in + +[contracts/Datatoken.ts:791](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L791) + +___ + +### buyFromDispenserAndOrder + +▸ **buyFromDispenserAndOrder**<`G`\>(`dtAddress`, `orderParams`, `dispenserContract`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Gets 1 DT from dispenser and then startsOrder, while burning that DT + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `orderParams` | [`OrderParams`](../interfaces/OrderParams.md) | The parameters required to place an order. | +| `dispenserContract` | `string` | dispenser address | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:610](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L610) + +___ + +### buyFromFreAndOrder + +▸ **buyFromFreAndOrder**<`G`\>(`dtAddress`, `orderParams`, `freParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Buys 1 DT from the FRE and then startsOrder, while burning that DT + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `orderParams` | [`OrderParams`](../interfaces/OrderParams.md) | The parameters required to place an order. | +| `freParams` | [`FreOrderParams`](../interfaces/FreOrderParams.md) | The parameters required to buy from a fixed-rate exchange. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:575](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L575) + +___ + +### cleanPermissions + +▸ **cleanPermissions**<`G`\>(`dtAddress`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Clean Datatoken level Permissions (minters, paymentManager and reset the paymentCollector) for an ERC20 Datatoken +Only NFT Owner (at 721 level) can call it. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address where we want to clean permissions | +| `address` | `string` | User adress | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:680](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L680) + +___ + +### createDispenser + +▸ **createDispenser**<`G`\>(`dtAddress`, `address`, `dispenserAddress`, `dispenserParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates a new Dispenser + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | Caller address | +| `dispenserAddress` | `string` | Dispenser contract address | +| `dispenserParams` | [`DispenserParams`](../interfaces/DispenserParams.md) | The parameters required to create a dispenser contract. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:157](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L157) + +___ + +### createFixedRate + +▸ **createFixedRate**<`G`\>(`dtAddress`, `address`, `fixedRateParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates a new FixedRateExchange setup. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | Caller address | +| `fixedRateParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:91](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L91) + +___ + +### getCap + +▸ **getCap**(`dtAddress`): `Promise`<`string`\> + +Returns the Datatoken cap + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/Datatoken.ts:723](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L723) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDecimals + +▸ **getDecimals**(`dtAddress`): `Promise`<`number`\> + +It returns the token decimals, how many supported decimal points + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[contracts/Datatoken.ts:734](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L734) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi) + +#### Defined in + +[contracts/Datatoken.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L26) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getFreOrderParams + +▸ `Private` **getFreOrderParams**(`freParams`): `Promise`<`any`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `freParams` | [`FreOrderParams`](../interfaces/FreOrderParams.md) | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[contracts/Datatoken.ts:859](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L859) + +___ + +### getNFTAddress + +▸ **getNFTAddress**(`dtAddress`): `Promise`<`string`\> + +It returns the token decimals, how many supported decimal points + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/Datatoken.ts:767](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L767) + +___ + +### getName + +▸ **getName**(`dtAddress`): `Promise`<`string`\> + +It returns the name of the token + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/Datatoken.ts:756](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L756) + +___ + +### getPaymentCollector + +▸ **getPaymentCollector**(`dtAddress`): `Promise`<`string`\> + +getPaymentCollector - It returns the current paymentCollector + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | datatoken address | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/Datatoken.ts:429](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L429) + +___ + +### getPermissions + +▸ **getPermissions**(`dtAddress`, `address`): `Promise`<[`DatatokenRoles`](../interfaces/DatatokenRoles.md)\> + +Returns ERC20 Datatoken user's permissions for a datatoken + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | +| `address` | `string` | user adress | + +#### Returns + +`Promise`<[`DatatokenRoles`](../interfaces/DatatokenRoles.md)\> + +#### Defined in + +[contracts/Datatoken.ts:709](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L709) + +___ + +### getPublishingMarketFee + +▸ **getPublishingMarketFee**(`datatokenAddress`): `Promise`<[`PublishingMarketFee`](../interfaces/PublishingMarketFee.md)\> + +Returns the current fee set by the publishing market + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `datatokenAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<[`PublishingMarketFee`](../interfaces/PublishingMarketFee.md)\> + +Current fee set by the publishing market + +#### Defined in + +[contracts/Datatoken.ts:845](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L845) + +___ + +### getSymbol + +▸ **getSymbol**(`dtAddress`): `Promise`<`string`\> + +It returns the token symbol + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/Datatoken.ts:745](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L745) + +___ + +### isDatatokenDeployer + +▸ **isDatatokenDeployer**(`dtAddress`, `address`): `Promise`<`boolean`\> + +Returns true if address has deployERC20 role + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken adress | +| `address` | `string` | - | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[contracts/Datatoken.ts:779](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L779) + +___ + +### mint + +▸ **mint**<`G`\>(`dtAddress`, `address`, `amount`, `toAddress?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Mints datatokens + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:208](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L208) + +___ + +### removeMinter + +▸ **removeMinter**<`G`\>(`dtAddress`, `address`, `minter`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Revoke Minter permission for an ERC20 Datatoken +only DatatokenDeployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | caller address | +| `minter` | `string` | address which will have removed the Minter permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:287](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L287) + +___ + +### removePaymentManager + +▸ **removePaymentManager**<`G`\>(`dtAddress`, `address`, `paymentManager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Revoke paymentManager permission for an ERC20 Datatoken +only DatatokenDeployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | User address | +| `paymentManager` | `string` | User which will be removed from paymentManager permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/Datatoken.ts:357](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L357) + +___ + +### reuseOrder + +▸ **reuseOrder**<`G`\>(`dtAddress`, `orderTxId`, `providerFees`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +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. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `orderTxId` | `string` | previous valid order | +| `providerFees` | [`ProviderFees`](../interfaces/ProviderFees.md) | provider fees | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +string + +#### Defined in + +[contracts/Datatoken.ts:545](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L545) + +___ + +### setData + +▸ **setData**<`G`\>(`dtAddress`, `address`, `value`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +setData +This function allows to store data with a preset key (keccak256(dtAddress)) into NFT 725 Store +only DatatokenDeployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | User address | +| `value` | `string` | Data to be stored into 725Y standard | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:644](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L644) + +___ + +### setPaymentCollector + +▸ **setPaymentCollector**<`G`\>(`dtAddress`, `address`, `paymentCollector`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +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 + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `address` | `string` | Caller address | +| `paymentCollector` | `string` | User to be set as new payment collector | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/Datatoken.ts:393](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L393) + +___ + +### setPublishingMarketFee + +▸ **setPublishingMarketFee**<`G`\>(`datatokenAddress`, `publishMarketFeeAddress`, `publishMarketFeeToken`, `publishMarketFeeAmount`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Allows to set the fee required by the publisherMarket +only publishMarketFeeAddress can call it + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `datatokenAddress` | `string` | Datatoken adress | +| `publishMarketFeeAddress` | `string` | new publish Market Fee Address | +| `publishMarketFeeToken` | `string` | new publish Market Fee Token | +| `publishMarketFeeAmount` | `string` | new fee amount | +| `address` | `string` | user adress | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Datatoken.ts:807](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L807) + +___ + +### startOrder + +▸ **startOrder**<`G`\>(`dtAddress`, `consumer`, `serviceIndex`, `providerFees`, `consumeMarketFee?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Start Order: called by payer or consumer prior ordering a service consume on a marketplace. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `consumer` | `string` | Consumer Address | +| `serviceIndex` | `number` | Service index in the metadata | +| `providerFees` | [`ProviderFees`](../interfaces/ProviderFees.md) | provider fees | +| `consumeMarketFee?` | [`ConsumeMarketFee`](../interfaces/ConsumeMarketFee.md) | - | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +string + +#### Defined in + +[contracts/Datatoken.ts:497](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L497) + +___ + +### transfer + +▸ **transfer**<`G`\>(`dtAddress`, `toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Transfer tokens(as number) from address to toAddress + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `toAddress` | `string` | Receiver address | +| `amount` | `string` | Number of datatokens, as number. Will be converted to wei. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:443](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L443) + +___ + +### transferWei + +▸ **transferWei**<`G`\>(`dtAddress`, `toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Transfer in wei from address to toAddress + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address | +| `toAddress` | `string` | Receiver address | +| `amount` | `string` | Number of datatokens (number) expressed as wei | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Datatoken.ts:465](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Datatoken.ts#L465) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/DfRewards.md b/docs/classes/DfRewards.md new file mode 100644 index 00000000..c81d7a9d --- /dev/null +++ b/docs/classes/DfRewards.md @@ -0,0 +1,345 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DfRewards + +# Class: DfRewards + +Provides an interface for DFRewards contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`DfRewards`** + +## Table of contents + +### Constructors + +- [constructor](DfRewards.md#constructor) + +### Properties + +- [abi](DfRewards.md#abi) +- [address](DfRewards.md#address) +- [config](DfRewards.md#config) +- [contract](DfRewards.md#contract) +- [signer](DfRewards.md#signer) + +### Methods + +- [allocateRewards](DfRewards.md#allocaterewards) +- [amountToUnits](DfRewards.md#amounttounits) +- [claimRewards](DfRewards.md#claimrewards) +- [getAvailableRewards](DfRewards.md#getavailablerewards) +- [getContract](DfRewards.md#getcontract) +- [getDefaultAbi](DfRewards.md#getdefaultabi) +- [getFairGasPrice](DfRewards.md#getfairgasprice) +- [unitsToAmount](DfRewards.md#unitstoamount) + +## Constructors + +### constructor + +• **new DfRewards**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### allocateRewards + +▸ **allocateRewards**<`G`\>(`userAddresses`, `amounts`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +allocate rewards to address. An approve must exist before calling this function. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddresses` | `string`[] | array of users that will receive rewards | +| `amounts` | `string`[] | array of amounts | +| `tokenAddress` | `string` | token address | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/df/DfRewards.ts:64](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L64) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### claimRewards + +▸ **claimRewards**<`G`\>(`userAddress`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +claim rewards for any address + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address to claim | +| `tokenAddress` | `string` | token address | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/df/DfRewards.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L36) + +___ + +### getAvailableRewards + +▸ **getAvailableRewards**(`userAddress`, `tokenAddress`): `Promise`<`string`\> + +Get available DF Rewards for a token + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | +| `tokenAddress` | `string` | token address | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/df/DfRewards.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L19) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/df/DfRewards.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfRewards.ts#L10) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/DfStrategyV1.md b/docs/classes/DfStrategyV1.md new file mode 100644 index 00000000..3c015810 --- /dev/null +++ b/docs/classes/DfStrategyV1.md @@ -0,0 +1,313 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DfStrategyV1 + +# Class: DfStrategyV1 + +Provides an interface for dfStrategyV1 contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`DfStrategyV1`** + +## Table of contents + +### Constructors + +- [constructor](DfStrategyV1.md#constructor) + +### Properties + +- [abi](DfStrategyV1.md#abi) +- [address](DfStrategyV1.md#address) +- [config](DfStrategyV1.md#config) +- [contract](DfStrategyV1.md#contract) +- [signer](DfStrategyV1.md#signer) + +### Methods + +- [amountToUnits](DfStrategyV1.md#amounttounits) +- [claimMultipleRewards](DfStrategyV1.md#claimmultiplerewards) +- [getContract](DfStrategyV1.md#getcontract) +- [getDefaultAbi](DfStrategyV1.md#getdefaultabi) +- [getFairGasPrice](DfStrategyV1.md#getfairgasprice) +- [getMultipleAvailableRewards](DfStrategyV1.md#getmultipleavailablerewards) +- [unitsToAmount](DfStrategyV1.md#unitstoamount) + +## Constructors + +### constructor + +• **new DfStrategyV1**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### claimMultipleRewards + +▸ **claimMultipleRewards**<`G`\>(`userAddress`, `tokenAddresses`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +claim multiple token rewards for any address + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address to claim | +| `tokenAddresses` | `string`[] | array of tokens | +| `estimateGas?` | `G` | - | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/df/DfStrategyV1.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L36) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/df/DfStrategyV1.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getMultipleAvailableRewards + +▸ **getMultipleAvailableRewards**(`userAddress`, `tokenAddresses`): `Promise`<`string`[]\> + +Get available DF Rewards for multiple tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | +| `tokenAddresses` | `string`[] | array of tokens | + +#### Returns + +`Promise`<`string`[]\> + +#### Defined in + +[contracts/df/DfStrategyV1.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/df/DfStrategyV1.ts#L18) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/Dispenser.md b/docs/classes/Dispenser.md new file mode 100644 index 00000000..919e653c --- /dev/null +++ b/docs/classes/Dispenser.md @@ -0,0 +1,502 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Dispenser + +# Class: Dispenser + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`Dispenser`** + +## Table of contents + +### Constructors + +- [constructor](Dispenser.md#constructor) + +### Properties + +- [abi](Dispenser.md#abi) +- [address](Dispenser.md#address) +- [config](Dispenser.md#config) +- [contract](Dispenser.md#contract) +- [signer](Dispenser.md#signer) + +### Methods + +- [activate](Dispenser.md#activate) +- [amountToUnits](Dispenser.md#amounttounits) +- [create](Dispenser.md#create) +- [deactivate](Dispenser.md#deactivate) +- [dispense](Dispenser.md#dispense) +- [getContract](Dispenser.md#getcontract) +- [getDefaultAbi](Dispenser.md#getdefaultabi) +- [getFairGasPrice](Dispenser.md#getfairgasprice) +- [isDispensable](Dispenser.md#isdispensable) +- [ownerWithdraw](Dispenser.md#ownerwithdraw) +- [setAllowedSwapper](Dispenser.md#setallowedswapper) +- [status](Dispenser.md#status) +- [unitsToAmount](Dispenser.md#unitstoamount) + +## Constructors + +### constructor + +• **new Dispenser**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### activate + +▸ **activate**<`G`\>(`dtAddress`, `maxTokens`, `maxBalance`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Activates a dispener. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +TransactionReceipt + +#### Defined in + +[contracts/Dispenser.ts:86](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L86) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### create + +▸ **create**<`G`\>(`dtAddress`, `address`, `maxTokens`, `maxBalance`, `allowedSwapper`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates a new Dispenser + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/Dispenser.ts:45](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L45) + +___ + +### deactivate + +▸ **deactivate**<`G`\>(`dtAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deactivate an existing dispenser. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | refers to datatoken address. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +TransactionReceipt + +#### Defined in + +[contracts/Dispenser.ts:118](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L118) + +___ + +### dispense + +▸ **dispense**<`G`\>(`dtAddress`, `amount?`, `destination`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Dispense datatokens to caller. +The dispenser must be active, hold enough datatokens (or be able to mint more) +and respect maxTokens/maxBalance requirements + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `dtAddress` | `string` | `undefined` | Datatoken address. | +| `amount` | `string` | `'1'` | Amount of datatokens required. | +| `destination` | `string` | `undefined` | address of tokens receiver | +| `estimateGas?` | `G` | `undefined` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Dispenser.ts:175](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L175) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/Dispenser.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### isDispensable + +▸ **isDispensable**(`dtAddress`, `datatoken`, `address`, `amount?`): `Promise`<`Boolean`\> + +Check if tokens can be dispensed + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `dtAddress` | `string` | `undefined` | Datatoken address | +| `datatoken` | [`Datatoken`](Datatoken.md) | `undefined` | - | +| `address` | `string` | `undefined` | User address that will receive datatokens | +| `amount` | `string` | `'1'` | amount of datatokens required. | + +#### Returns + +`Promise`<`Boolean`\> + +#### Defined in + +[contracts/Dispenser.ts:231](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L231) + +___ + +### ownerWithdraw + +▸ **ownerWithdraw**<`G`\>(`dtAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Withdraw all tokens from the dispenser + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Dispenser.ts:206](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L206) + +___ + +### setAllowedSwapper + +▸ **setAllowedSwapper**<`G`\>(`dtAddress`, `newAllowedSwapper`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Sets a new allowed swapper. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtAddress` | `string` | Datatoken address. | +| `newAllowedSwapper` | `string` | The address of the new allowed swapper. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Dispenser.ts:143](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L143) + +___ + +### status + +▸ **status**(`dtAdress`): `Promise`<[`DispenserToken`](../interfaces/DispenserToken.md)\> + +Get information about a datatoken dispenser + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `dtAdress` | `string` | + +#### Returns + +`Promise`<[`DispenserToken`](../interfaces/DispenserToken.md)\> + +#### Defined in + +[contracts/Dispenser.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Dispenser.ts#L18) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/FixedRateExchange.md b/docs/classes/FixedRateExchange.md new file mode 100644 index 00000000..b821aad8 --- /dev/null +++ b/docs/classes/FixedRateExchange.md @@ -0,0 +1,1068 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FixedRateExchange + +# Class: FixedRateExchange + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`FixedRateExchange`** + +## Table of contents + +### Constructors + +- [constructor](FixedRateExchange.md#constructor) + +### Properties + +- [abi](FixedRateExchange.md#abi) +- [address](FixedRateExchange.md#address) +- [config](FixedRateExchange.md#config) +- [contract](FixedRateExchange.md#contract) +- [signer](FixedRateExchange.md#signer) + +### Methods + +- [activate](FixedRateExchange.md#activate) +- [activateMint](FixedRateExchange.md#activatemint) +- [amountToUnits](FixedRateExchange.md#amounttounits) +- [buyDatatokens](FixedRateExchange.md#buydatatokens) +- [calcBaseInGivenDatatokensOut](FixedRateExchange.md#calcbaseingivendatatokensout) +- [collectBasetokens](FixedRateExchange.md#collectbasetokens) +- [collectDatatokens](FixedRateExchange.md#collectdatatokens) +- [collectMarketFee](FixedRateExchange.md#collectmarketfee) +- [collectOceanFee](FixedRateExchange.md#collectoceanfee) +- [deactivate](FixedRateExchange.md#deactivate) +- [deactivateMint](FixedRateExchange.md#deactivatemint) +- [generateExchangeId](FixedRateExchange.md#generateexchangeid) +- [getAllowedSwapper](FixedRateExchange.md#getallowedswapper) +- [getAmountBasetokensOut](FixedRateExchange.md#getamountbasetokensout) +- [getBasetokenSupply](FixedRateExchange.md#getbasetokensupply) +- [getContract](FixedRateExchange.md#getcontract) +- [getDatatokenSupply](FixedRateExchange.md#getdatatokensupply) +- [getDefaultAbi](FixedRateExchange.md#getdefaultabi) +- [getExchange](FixedRateExchange.md#getexchange) +- [getExchangeOwner](FixedRateExchange.md#getexchangeowner) +- [getExchanges](FixedRateExchange.md#getexchanges) +- [getFairGasPrice](FixedRateExchange.md#getfairgasprice) +- [getFeesInfo](FixedRateExchange.md#getfeesinfo) +- [getNumberOfExchanges](FixedRateExchange.md#getnumberofexchanges) +- [getOPCCollector](FixedRateExchange.md#getopccollector) +- [getRate](FixedRateExchange.md#getrate) +- [getRouter](FixedRateExchange.md#getrouter) +- [isActive](FixedRateExchange.md#isactive) +- [sellDatatokens](FixedRateExchange.md#selldatatokens) +- [setAllowedSwapper](FixedRateExchange.md#setallowedswapper) +- [setRate](FixedRateExchange.md#setrate) +- [unitsToAmount](FixedRateExchange.md#unitstoamount) +- [updateMarketFee](FixedRateExchange.md#updatemarketfee) +- [updateMarketFeeCollector](FixedRateExchange.md#updatemarketfeecollector) + +## Constructors + +### constructor + +• **new FixedRateExchange**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### activate + +▸ **activate**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Activate an exchange + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | ExchangeId | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:210](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L210) + +___ + +### activateMint + +▸ **activateMint**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Activate minting option for fixed rate contract + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchang eId | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:462](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L462) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### buyDatatokens + +▸ **buyDatatokens**<`G`\>(`exchangeId`, `datatokenAmount`, `maxBaseTokenAmount`, `consumeMarketAddress?`, `consumeMarketFee?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Atomic swap + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `exchangeId` | `string` | `undefined` | ExchangeId | +| `datatokenAmount` | `string` | `undefined` | Amount of datatokens | +| `maxBaseTokenAmount` | `string` | `undefined` | max amount of baseToken we want to pay for datatokenAmount | +| `consumeMarketAddress` | `string` | `ZERO_ADDRESS` | consumeMarketAddress | +| `consumeMarketFee` | `string` | `'0'` | consumeMarketFee in fraction | +| `estimateGas?` | `G` | `undefined` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L38) + +___ + +### calcBaseInGivenDatatokensOut + +▸ **calcBaseInGivenDatatokensOut**(`exchangeId`, `datatokenAmount`, `consumeMarketFee?`): `Promise`<[`PriceAndFees`](../interfaces/PriceAndFees.md)\> + +calcBaseInGivenDatatokensOut - Calculates how many base tokens are needed to get specified amount of datatokens + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `exchangeId` | `string` | `undefined` | Exchange Id | +| `datatokenAmount` | `string` | `undefined` | Amount of datatokens user wants to buy | +| `consumeMarketFee` | `string` | `'0'` | consumeMarketFee in fraction | + +#### Returns + +`Promise`<[`PriceAndFees`](../interfaces/PriceAndFees.md)\> + +how many base tokens are needed and fees + +#### Defined in + +[contracts/FixedRateExchange.ts:305](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L305) + +___ + +### collectBasetokens + +▸ **collectBasetokens**<`G`\>(`exchangeId`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Collect BaseTokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `amount` | `string` | amount to be collected | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:519](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L519) + +___ + +### collectDatatokens + +▸ **collectDatatokens**<`G`\>(`exchangeId`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Collect datatokens in the contract (anyone can call this, funds are sent to Datatoken.paymentCollector) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `amount` | `string` | amount to be collected | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:555](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L555) + +___ + +### collectMarketFee + +▸ **collectMarketFee**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Collect market fee and send it to marketFeeCollector (anyone can call it) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:590](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L590) + +___ + +### collectOceanFee + +▸ **collectOceanFee**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Collect ocean fee and send it to OPF collector (anyone can call it) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:617](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L617) + +___ + +### deactivate + +▸ **deactivate**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deactivate an exchange + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | ExchangeId | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:236](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L236) + +___ + +### deactivateMint + +▸ **deactivateMint**<`G`\>(`exchangeId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deactivate minting for fixed rate + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | ExchangeId | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:490](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L490) + +___ + +### generateExchangeId + +▸ **generateExchangeId**(`baseToken`, `datatoken`): `Promise`<`string`\> + +Creates unique exchange identifier. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `baseToken` | `string` | baseToken contract address | +| `datatoken` | `string` | Datatoken contract address | + +#### Returns + +`Promise`<`string`\> + +exchangeId + +#### Defined in + +[contracts/FixedRateExchange.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L23) + +___ + +### getAllowedSwapper + +▸ **getAllowedSwapper**(`exchangeId`): `Promise`<`string`\> + +Get Allower Swapper (if set this is the only account which can use this exchange, else is set at address(0)) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<`string`\> + +address of allowed swapper + +#### Defined in + +[contracts/FixedRateExchange.ts:294](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L294) + +___ + +### getAmountBasetokensOut + +▸ **getAmountBasetokensOut**(`exchangeId`, `datatokenAmount`, `consumeMarketFee?`): `Promise`<`string`\> + +Returns amount in baseToken that user will receive for datatokenAmount sold + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `exchangeId` | `string` | `undefined` | Exchange Id | +| `datatokenAmount` | `string` | `undefined` | Amount of datatokens | +| `consumeMarketFee` | `string` | `'0'` | consumeMarketFee in fraction | + +#### Returns + +`Promise`<`string`\> + +Amount of baseTokens user will receive + +#### Defined in + +[contracts/FixedRateExchange.ts:352](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L352) + +___ + +### getBasetokenSupply + +▸ **getBasetokenSupply**(`exchangeId`): `Promise`<`string`\> + +Returns basetoken supply in the exchange + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<`string`\> + +dt supply formatted + +#### Defined in + +[contracts/FixedRateExchange.ts:283](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L283) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDatatokenSupply + +▸ **getDatatokenSupply**(`exchangeId`): `Promise`<`string`\> + +Get Datatoken Supply in the exchange + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<`string`\> + +dt supply formatted + +#### Defined in + +[contracts/FixedRateExchange.ts:272](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L272) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/FixedRateExchange.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L13) + +___ + +### getExchange + +▸ **getExchange**(`exchangeId`): `Promise`<[`FixedPriceExchange`](../interfaces/FixedPriceExchange.md)\> + +Get exchange details + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<[`FixedPriceExchange`](../interfaces/FixedPriceExchange.md)\> + +Exchange details + +#### Defined in + +[contracts/FixedRateExchange.ts:372](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L372) + +___ + +### getExchangeOwner + +▸ **getExchangeOwner**(`exchangeId`): `Promise`<`string`\> + +Get Exchange Owner given an exchangeId + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<`string`\> + +return exchange owner + +#### Defined in + +[contracts/FixedRateExchange.ts:661](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L661) + +___ + +### getExchanges + +▸ **getExchanges**(): `Promise`<`string`[]\> + +Returns all exchanges + +#### Returns + +`Promise`<`string`[]\> + +Exchanges list + +#### Defined in + +[contracts/FixedRateExchange.ts:442](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L442) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getFeesInfo + +▸ **getFeesInfo**(`exchangeId`): `Promise`<[`FeesInfo`](../interfaces/FeesInfo.md)\> + +Get fee details for an exchange + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | + +#### Returns + +`Promise`<[`FeesInfo`](../interfaces/FeesInfo.md)\> + +Exchange details + +#### Defined in + +[contracts/FixedRateExchange.ts:414](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L414) + +___ + +### getNumberOfExchanges + +▸ **getNumberOfExchanges**(): `Promise`<`number`\> + +Gets total number of exchanges + +#### Returns + +`Promise`<`number`\> + +no of available exchanges + +#### Defined in + +[contracts/FixedRateExchange.ts:140](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L140) + +___ + +### getOPCCollector + +▸ **getOPCCollector**(): `Promise`<`string`\> + +Get OPF Collector of fixed rate contract + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/FixedRateExchange.ts:642](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L642) + +___ + +### getRate + +▸ **getRate**(`exchangeId`): `Promise`<`string`\> + +Get Exchange Rate + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange ID | + +#### Returns + +`Promise`<`string`\> + +Rate (converted from wei) + +#### Defined in + +[contracts/FixedRateExchange.ts:262](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L262) + +___ + +### getRouter + +▸ **getRouter**(): `Promise`<`string`\> + +Get Router address set in fixed rate contract + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/FixedRateExchange.ts:651](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L651) + +___ + +### isActive + +▸ **isActive**(`exchangeId`): `Promise`<`boolean`\> + +Check if an exchange is active + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | ExchangeId | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[contracts/FixedRateExchange.ts:451](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L451) + +___ + +### sellDatatokens + +▸ **sellDatatokens**<`G`\>(`exchangeId`, `datatokenAmount`, `minBaseTokenAmount`, `consumeMarketAddress?`, `consumeMarketFee?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Sell datatokenAmount while expecting at least minBaseTokenAmount + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `exchangeId` | `string` | `undefined` | ExchangeId | +| `datatokenAmount` | `string` | `undefined` | Amount of datatokens | +| `minBaseTokenAmount` | `string` | `undefined` | min amount of baseToken we want to receive back | +| `consumeMarketAddress` | `string` | `ZERO_ADDRESS` | consumeMarketAddress | +| `consumeMarketFee` | `string` | `'0'` | consumeMarketFee in fraction | +| `estimateGas?` | `G` | `undefined` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:93](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L93) + +___ + +### setAllowedSwapper + +▸ **setAllowedSwapper**<`G`\>(`exchangeId`, `newAllowedSwapper`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Sets a new allowedSwapper + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange ID | +| `newAllowedSwapper` | `string` | The address of the new allowed swapper (set address zero if we want to remove allowed swapper) | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:182](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L182) + +___ + +### setRate + +▸ **setRate**<`G`\>(`exchangeId`, `newRate`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Set new rate + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange ID | +| `newRate` | `string` | New rate | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:152](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L152) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) + +___ + +### updateMarketFee + +▸ **updateMarketFee**<`G`\>(`exchangeId`, `newMarketFee`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Set new market fee, only market fee collector can update it + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `newMarketFee` | `string` | New market fee | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:673](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L673) + +___ + +### updateMarketFeeCollector + +▸ **updateMarketFeeCollector**<`G`\>(`exchangeId`, `newMarketFeeCollector`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Set new market fee collector, only market fee collector can update it + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeId` | `string` | Exchange Id | +| `newMarketFeeCollector` | `string` | New market fee collector | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/FixedRateExchange.ts:703](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/FixedRateExchange.ts#L703) diff --git a/docs/classes/Logger.md b/docs/classes/Logger.md new file mode 100644 index 00000000..ba6efe23 --- /dev/null +++ b/docs/classes/Logger.md @@ -0,0 +1,191 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Logger + +# Class: Logger + +## Table of contents + +### Constructors + +- [constructor](Logger.md#constructor) + +### Properties + +- [logLevel](Logger.md#loglevel) + +### Methods + +- [bypass](Logger.md#bypass) +- [debug](Logger.md#debug) +- [dispatch](Logger.md#dispatch) +- [error](Logger.md#error) +- [log](Logger.md#log) +- [setLevel](Logger.md#setlevel) +- [warn](Logger.md#warn) + +## Constructors + +### constructor + +• **new Logger**(`logLevel?`) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `logLevel` | [`LogLevel`](../enums/LogLevel.md) | `LogLevel.Error` | + +#### Defined in + +[utils/Logger.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L12) + +## Properties + +### logLevel + +• `Private` **logLevel**: [`LogLevel`](../enums/LogLevel.md) = `LogLevel.Error` + +#### Defined in + +[utils/Logger.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L12) + +## Methods + +### bypass + +▸ **bypass**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L18) + +___ + +### debug + +▸ **debug**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L22) + +___ + +### dispatch + +▸ `Private` **dispatch**(`verb`, `level`, `...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `verb` | `string` | +| `level` | [`LogLevel`](../enums/LogLevel.md) | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L38) + +___ + +### error + +▸ **error**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L34) + +___ + +### log + +▸ **log**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L26) + +___ + +### setLevel + +▸ **setLevel**(`logLevel`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `logLevel` | [`LogLevel`](../enums/LogLevel.md) | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L14) + +___ + +### warn + +▸ **warn**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[utils/Logger.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L30) diff --git a/docs/classes/Nft.md b/docs/classes/Nft.md new file mode 100644 index 00000000..8314ecf6 --- /dev/null +++ b/docs/classes/Nft.md @@ -0,0 +1,970 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Nft + +# Class: Nft + +## Hierarchy + +- [`SmartContract`](SmartContract.md) + + ↳ **`Nft`** + +## Table of contents + +### Constructors + +- [constructor](Nft.md#constructor) + +### Properties + +- [abi](Nft.md#abi) +- [config](Nft.md#config) +- [signer](Nft.md#signer) + +### Methods + +- [addDatatokenDeployer](Nft.md#adddatatokendeployer) +- [addManager](Nft.md#addmanager) +- [addMetadataUpdater](Nft.md#addmetadataupdater) +- [addStoreUpdater](Nft.md#addstoreupdater) +- [amountToUnits](Nft.md#amounttounits) +- [cleanPermissions](Nft.md#cleanpermissions) +- [createDatatoken](Nft.md#createdatatoken) +- [getContract](Nft.md#getcontract) +- [getData](Nft.md#getdata) +- [getDefaultAbi](Nft.md#getdefaultabi) +- [getFairGasPrice](Nft.md#getfairgasprice) +- [getMetadata](Nft.md#getmetadata) +- [getNftOwner](Nft.md#getnftowner) +- [getNftPermissions](Nft.md#getnftpermissions) +- [getTokenURI](Nft.md#gettokenuri) +- [isDatatokenDeployer](Nft.md#isdatatokendeployer) +- [removeDatatokenDeployer](Nft.md#removedatatokendeployer) +- [removeManager](Nft.md#removemanager) +- [removeMetadataUpdater](Nft.md#removemetadataupdater) +- [removeStoreUpdater](Nft.md#removestoreupdater) +- [safeTransferNft](Nft.md#safetransfernft) +- [setData](Nft.md#setdata) +- [setMetadata](Nft.md#setmetadata) +- [setMetadataAndTokenURI](Nft.md#setmetadataandtokenuri) +- [setMetadataState](Nft.md#setmetadatastate) +- [setTokenURI](Nft.md#settokenuri) +- [transferNft](Nft.md#transfernft) +- [unitsToAmount](Nft.md#unitstoamount) + +## Constructors + +### constructor + +• **new Nft**(`signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor) + +#### Defined in + +[contracts/SmartContract.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L25) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContract](SmartContract.md).[abi](SmartContract.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContract](SmartContract.md).[config](SmartContract.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContract](SmartContract.md).[signer](SmartContract.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### addDatatokenDeployer + +▸ **addDatatokenDeployer**<`G`\>(`nftAddress`, `address`, `datatokenDeployer`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add DatatokenDeployer permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `datatokenDeployer` | `string` | User adress which is going to have DatatokenDeployer permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:169](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L169) + +___ + +### addManager + +▸ **addManager**<`G`\>(`nftAddress`, `address`, `manager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add Manager for NFT Contract (only NFT Owner can succeed) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Owner adress | +| `manager` | `string` | User adress which is going to be assing manager | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:101](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L101) + +___ + +### addMetadataUpdater + +▸ **addMetadataUpdater**<`G`\>(`nftAddress`, `address`, `metadataUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add Metadata Updater permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `metadataUpdater` | `string` | User adress which is going to have Metadata Updater permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:243](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L243) + +___ + +### addStoreUpdater + +▸ **addStoreUpdater**<`G`\>(`nftAddress`, `address`, `storeUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add Store Updater permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `storeUpdater` | `string` | User adress which is going to have Store Updater permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:313](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L313) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### cleanPermissions + +▸ **cleanPermissions**<`G`\>(`nftAddress`, `address`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +This function allows to remove all ROLES at NFT level: Managers, DatatokenDeployer, MetadataUpdater, StoreUpdater +Even NFT Owner has to readd himself as Manager +Permissions at Datatoken level stay. +Only NFT Owner can call it. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Owner adress | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:387](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L387) + +___ + +### createDatatoken + +▸ **createDatatoken**<`G`\>(`nftAddress`, `address`, `minter`, `paymentCollector`, `mpFeeAddress`, `feeToken`, `feeAmount`, `cap`, `name?`, `symbol?`, `templateIndex?`, `estimateGas?`): `Promise`<`G` extends ``false`` ? `string` : `BigNumber`\> + +Create new ERC20 Datatoken - only user with DatatokenDeployer permission can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT address | +| `address` | `string` | User address | +| `minter` | `string` | User set as initial minter for the Datatoken | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<`G` extends ``false`` ? `string` : `BigNumber`\> + +ERC20 Datatoken address + +#### Defined in + +[contracts/NFT.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L34) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getData + +▸ **getData**(`nftAddress`, `key`): `Promise`<`string`\> + +Gets stored data at a given `key` in an NFT + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | The address of the NFT. | +| `key` | `string` | The key of the data to get. | + +#### Returns + +`Promise`<`string`\> + +The data stored at the key + +#### Defined in + +[contracts/NFT.ts:753](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L753) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi) + +#### Defined in + +[contracts/NFT.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L14) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getMetadata + +▸ **getMetadata**(`nftAddress`): `Promise`<`Object`\> + +Returns Metadata details for an NFT + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | + +#### Returns + +`Promise`<`Object`\> + +#### Defined in + +[contracts/NFT.ts:687](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L687) + +___ + +### getNftOwner + +▸ **getNftOwner**(`nftAddress`): `Promise`<`string`\> + +Get NFT Owner + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | + +#### Returns + +`Promise`<`string`\> + +string + +#### Defined in + +[contracts/NFT.ts:664](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L664) + +___ + +### getNftPermissions + +▸ **getNftPermissions**(`nftAddress`, `address`): `Promise`<[`NftRoles`](../interfaces/NftRoles.md)\> + +Gets NFT Permissions for a specified user + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | user adress | + +#### Returns + +`Promise`<[`NftRoles`](../interfaces/NftRoles.md)\> + +#### Defined in + +[contracts/NFT.ts:676](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L676) + +___ + +### getTokenURI + +▸ **getTokenURI**(`nftAddress`, `id`): `Promise`<`string`\> + +Gets the token URI of an NFT. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | The address of the NFT. | +| `id` | `number` | The ID of the token. | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/NFT.ts:766](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L766) + +___ + +### isDatatokenDeployer + +▸ **isDatatokenDeployer**(`nftAddress`, `address`): `Promise`<`boolean`\> + +Checks if user has DatatokenDeployer role + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | user adress | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[contracts/NFT.ts:698](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L698) + +___ + +### removeDatatokenDeployer + +▸ **removeDatatokenDeployer**<`G`\>(`nftAddress`, `address`, `datatokenDeployer`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Remove DatatokenDeployer permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `datatokenDeployer` | `string` | Address of the user to be revoked DatatokenDeployer Permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:204](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L204) + +___ + +### removeManager + +▸ **removeManager**<`G`\>(`nftAddress`, `address`, `manager`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Removes a specific manager for NFT Contract (only NFT Owner can succeed) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Owner adress | +| `manager` | `string` | User adress which is going to be removed as manager | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:135](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L135) + +___ + +### removeMetadataUpdater + +▸ **removeMetadataUpdater**<`G`\>(`nftAddress`, `address`, `metadataUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Remove Metadata Updater permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `metadataUpdater` | `string` | Address of the user to be revoked Metadata updater Permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:276](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L276) + +___ + +### removeStoreUpdater + +▸ **removeStoreUpdater**<`G`\>(`nftAddress`, `address`, `storeUpdater`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Remove Store Updater permission - only Manager can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | NFT Manager adress | +| `storeUpdater` | `string` | Address of the user to be revoked Store Updater Permission | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:347](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L347) + +___ + +### safeTransferNft + +▸ **safeTransferNft**<`G`\>(`nftAddress`, `nftOwner`, `nftReceiver`, `tokenId?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +safeTransferNFT Used for transferring the NFT, can be used by an approved relayer +will clean all permissions both on NFT and Datatoken level. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:466](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L466) + +___ + +### setData + +▸ **setData**<`G`\>(`nftAddress`, `address`, `key`, `value`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Allows users to store data with a preset key (keccak256(ERC20Address)) into NFT 725 Store +only ERC20Deployer can succeed + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | Nft datatoken adress | +| `address` | `string` | User adress | +| `key` | `string` | Key of the data to be stored into 725Y standard | +| `value` | `string` | Data to be stored into 725Y standard | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transactionId + +#### Defined in + +[contracts/NFT.ts:717](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L717) + +___ + +### setMetadata + +▸ **setMetadata**<`G`\>(`nftAddress`, `address`, `metadataState`, `metadataDecryptorUrl`, `metadataDecryptorAddress`, `flags`, `data`, `metadataHash`, `metadataProofs?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates or update Metadata cached by Aquarius. Also, updates the METADATA_DECRYPTOR key + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | Caller address NFT Owner adress | +| `metadataState` | `number` | | +| `metadataDecryptorUrl` | `string` | | +| `metadataDecryptorAddress` | `string` | | +| `flags` | `string` | | +| `data` | `string` | | +| `metadataHash` | `string` | | +| `metadataProofs?` | [`MetadataProof`](../interfaces/MetadataProof.md)[] | | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:515](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L515) + +___ + +### setMetadataAndTokenURI + +▸ **setMetadataAndTokenURI**<`G`\>(`nftAddress`, `metadataUpdater`, `metadataAndTokenURI`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Helper function to improve UX sets both MetaData & TokenURI in one tx + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `metadataUpdater` | `string` | - | +| `metadataAndTokenURI` | [`MetadataAndTokenURI`](../interfaces/MetadataAndTokenURI.md) | metaDataAndTokenURI object | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:568](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L568) + +___ + +### setMetadataState + +▸ **setMetadataState**<`G`\>(`nftAddress`, `address`, `metadataState`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +setMetadataState Used for updating the metadata State + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `address` | `string` | Caller address => metadata updater | +| `metadataState` | `number` | new metadata state | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:606](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L606) + +___ + +### setTokenURI + +▸ **setTokenURI**<`G`\>(`nftAddress`, `data`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +set TokenURI on an nft + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `data` | `string` | input data for TokenURI | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/NFT.ts:638](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L638) + +___ + +### transferNft + +▸ **transferNft**<`G`\>(`nftAddress`, `nftOwner`, `nftReceiver`, `tokenId?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Transfers the NFT +will clean all permissions both on NFT and Datatoken level. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | NFT contract address | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +trxReceipt + +#### Defined in + +[contracts/NFT.ts:421](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFT.ts#L421) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/NftFactory.md b/docs/classes/NftFactory.md new file mode 100644 index 00000000..e69f028c --- /dev/null +++ b/docs/classes/NftFactory.md @@ -0,0 +1,861 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / NftFactory + +# Class: NftFactory + +Provides an interface for NFT Factory contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`NftFactory`** + +## Table of contents + +### Constructors + +- [constructor](NftFactory.md#constructor) + +### Properties + +- [abi](NftFactory.md#abi) +- [address](NftFactory.md#address) +- [config](NftFactory.md#config) +- [contract](NftFactory.md#contract) +- [signer](NftFactory.md#signer) + +### Methods + +- [addNFTTemplate](NftFactory.md#addnfttemplate) +- [addTokenTemplate](NftFactory.md#addtokentemplate) +- [amountToUnits](NftFactory.md#amounttounits) +- [checkDatatoken](NftFactory.md#checkdatatoken) +- [checkNFT](NftFactory.md#checknft) +- [createNFT](NftFactory.md#createnft) +- [createNftWithDatatoken](NftFactory.md#createnftwithdatatoken) +- [createNftWithDatatokenWithDispenser](NftFactory.md#createnftwithdatatokenwithdispenser) +- [createNftWithDatatokenWithFixedRate](NftFactory.md#createnftwithdatatokenwithfixedrate) +- [disableNFTTemplate](NftFactory.md#disablenfttemplate) +- [disableTokenTemplate](NftFactory.md#disabletokentemplate) +- [getContract](NftFactory.md#getcontract) +- [getCurrentNFTCount](NftFactory.md#getcurrentnftcount) +- [getCurrentNFTTemplateCount](NftFactory.md#getcurrentnfttemplatecount) +- [getCurrentTokenCount](NftFactory.md#getcurrenttokencount) +- [getCurrentTokenTemplateCount](NftFactory.md#getcurrenttokentemplatecount) +- [getDefaultAbi](NftFactory.md#getdefaultabi) +- [getErcCreationParams](NftFactory.md#geterccreationparams) +- [getFairGasPrice](NftFactory.md#getfairgasprice) +- [getFreCreationParams](NftFactory.md#getfrecreationparams) +- [getNFTTemplate](NftFactory.md#getnfttemplate) +- [getOwner](NftFactory.md#getowner) +- [getTokenTemplate](NftFactory.md#gettokentemplate) +- [reactivateNFTTemplate](NftFactory.md#reactivatenfttemplate) +- [reactivateTokenTemplate](NftFactory.md#reactivatetokentemplate) +- [startMultipleTokenOrder](NftFactory.md#startmultipletokenorder) +- [unitsToAmount](NftFactory.md#unitstoamount) + +## Constructors + +### constructor + +• **new NftFactory**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### addNFTTemplate + +▸ **addNFTTemplate**<`G`\>(`address`, `templateAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add a new NFT token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `templateAddress` | `string` | template address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/NFTFactory.ts:181](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L181) + +___ + +### addTokenTemplate + +▸ **addTokenTemplate**<`G`\>(`address`, `templateAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Add a new NFT token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `templateAddress` | `string` | template address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/NFTFactory.ts:288](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L288) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### checkDatatoken + +▸ **checkDatatoken**(`datatoken`): `Promise`<`Boolean`\> + +Check if Datatoken is deployed from the factory + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `datatoken` | `string` | Datatoken address to check | + +#### Returns + +`Promise`<`Boolean`\> + +return true if deployed from this factory + +#### Defined in + +[contracts/NFTFactory.ts:159](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L159) + +___ + +### checkNFT + +▸ **checkNFT**(`nftAddress`): `Promise`<`String`\> + +Check if NFT is deployed from the factory + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | nftAddress address to check | + +#### Returns + +`Promise`<`String`\> + +return address(0) if it's not, or the nftAddress if true + +#### Defined in + +[contracts/NFTFactory.ts:169](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L169) + +___ + +### createNFT + +▸ **createNFT**<`G`\>(`nftData`, `estimateGas?`): `Promise`<`G` extends ``false`` ? `string` : `BigNumber`\> + +Create new data NFT + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data needed to create an NFT. | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<`G` extends ``false`` ? `string` : `BigNumber`\> + +The transaction hash or the gas estimate. + +#### Defined in + +[contracts/NFTFactory.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L30) + +___ + +### createNftWithDatatoken + +▸ **createNftWithDatatoken**<`G`\>(`nftCreateData`, `dtParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates a new NFT, then a datatoken,all in one call + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. | +| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. | +| `estimateGas?` | `G` | Whether to return only estimate gas or not. | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/NFTFactory.ts:434](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L434) + +___ + +### createNftWithDatatokenWithDispenser + +▸ **createNftWithDatatokenWithDispenser**<`G`\>(`nftCreateData`, `dtParams`, `dispenserParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates an NFT with a datatoken with a dispenser in one call. +Be aware if Fixed Rate creation fails, you are still going to pay a lot of gas + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. | +| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. | +| `dispenserParams` | [`DispenserCreationParams`](../interfaces/DispenserCreationParams.md) | The parameters required to create a dispenser contract. | +| `estimateGas?` | `G` | Whether to estimate gas or not. | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/NFTFactory.ts:505](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L505) + +___ + +### createNftWithDatatokenWithFixedRate + +▸ **createNftWithDatatokenWithFixedRate**<`G`\>(`nftCreateData`, `dtParams`, `freParams`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Creates an NFT with a datatoken with a fixed rate all in one call. +be aware if Fixed Rate creation fails, you are still going to pay a lot of gas + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftCreateData` | [`NftCreateData`](../interfaces/NftCreateData.md) | The data required to create an NFT. | +| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. | +| `freParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. | +| `estimateGas?` | `G` | Whether to return only estimate gas or not. | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/NFTFactory.ts:467](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L467) + +___ + +### disableNFTTemplate + +▸ **disableNFTTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Disable token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | | +| `templateIndex` | `number` | index of the template we want to disable | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +current token template count + +#### Defined in + +[contracts/NFTFactory.ts:213](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L213) + +___ + +### disableTokenTemplate + +▸ **disableTokenTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Disable token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `templateIndex` | `number` | index of the template we want to disable | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +current token template count + +#### Defined in + +[contracts/NFTFactory.ts:321](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L321) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getCurrentNFTCount + +▸ **getCurrentNFTCount**(): `Promise`<`number`\> + +Get Current NFT Count (NFT created) + +#### Returns + +`Promise`<`number`\> + +Number of NFT created from this factory + +#### Defined in + +[contracts/NFTFactory.ts:86](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L86) + +___ + +### getCurrentNFTTemplateCount + +▸ **getCurrentNFTTemplateCount**(): `Promise`<`number`\> + +Get Current NFT Template Count + +#### Returns + +`Promise`<`number`\> + +Number of NFT Template added to this factory + +#### Defined in + +[contracts/NFTFactory.ts:113](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L113) + +___ + +### getCurrentTokenCount + +▸ **getCurrentTokenCount**(): `Promise`<`number`\> + +Get Current Datatoken Count + +#### Returns + +`Promise`<`number`\> + +Number of DTs created from this factory + +#### Defined in + +[contracts/NFTFactory.ts:95](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L95) + +___ + +### getCurrentTokenTemplateCount + +▸ **getCurrentTokenTemplateCount**(): `Promise`<`number`\> + +Get Current Template Datatoken (ERC20) Count + +#### Returns + +`Promise`<`number`\> + +Number of Datatoken Template added to this factory + +#### Defined in + +[contracts/NFTFactory.ts:122](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L122) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/NFTFactory.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L20) + +___ + +### getErcCreationParams + +▸ `Private` **getErcCreationParams**(`dtParams`): `Promise`<`any`\> + +Gets the parameters required to create an ERC20 token. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dtParams` | [`DatatokenCreateParams`](../interfaces/DatatokenCreateParams.md) | The parameters required to create a datatoken. | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[contracts/NFTFactory.ts:550](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L550) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getFreCreationParams + +▸ `Private` **getFreCreationParams**(`freParams`): `Promise`<`any`\> + +Gets the parameters required to create a fixed-rate exchange contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `freParams` | [`FreCreationParams`](../interfaces/FreCreationParams.md) | The parameters required to create a fixed-rate exchange contract. | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[contracts/NFTFactory.ts:578](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L578) + +___ + +### getNFTTemplate + +▸ **getNFTTemplate**(`index`): `Promise`<[`Template`](../interfaces/Template.md)\> + +Get NFT Template + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `index` | `number` | Template index | + +#### Returns + +`Promise`<[`Template`](../interfaces/Template.md)\> + +Number of Template added to this factory + +#### Defined in + +[contracts/NFTFactory.ts:132](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L132) + +___ + +### getOwner + +▸ **getOwner**(): `Promise`<`string`\> + +Get Factory Owner + +#### Returns + +`Promise`<`string`\> + +Factory Owner address + +#### Defined in + +[contracts/NFTFactory.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L104) + +___ + +### getTokenTemplate + +▸ **getTokenTemplate**(`index`): `Promise`<[`Template`](../interfaces/Template.md)\> + +Get Datatoken (ERC20) Template + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `index` | `number` | Template index | + +#### Returns + +`Promise`<[`Template`](../interfaces/Template.md)\> + +DT Template info + +#### Defined in + +[contracts/NFTFactory.ts:149](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L149) + +___ + +### reactivateNFTTemplate + +▸ **reactivateNFTTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Reactivate a previously disabled token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | | +| `templateIndex` | `number` | index of the template we want to reactivate | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +current token template count + +#### Defined in + +[contracts/NFTFactory.ts:249](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L249) + +___ + +### reactivateTokenTemplate + +▸ **reactivateTokenTemplate**<`G`\>(`address`, `templateIndex`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Reactivate a previously disabled token template - only factory Owner + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `templateIndex` | `number` | index of the template we want to reactivate | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +current token template count + +#### Defined in + +[contracts/NFTFactory.ts:360](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L360) + +___ + +### startMultipleTokenOrder + +▸ **startMultipleTokenOrder**<`G`\>(`orders`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Used as a proxy to order multiple services + Users can have inifinite approvals for fees for factory instead of having one approval/ Datatoken contract + Requires previous approval of all : + - consumeFeeTokens + - publishMarketFeeTokens + - ERC20 Datatokens + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `orders` | [`TokenOrder`](../interfaces/TokenOrder.md)[] | array of of orders | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +transaction receipt + +#### Defined in + +[contracts/NFTFactory.ts:404](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/NFTFactory.ts#L404) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/Provider.md b/docs/classes/Provider.md new file mode 100644 index 00000000..e3e92d81 --- /dev/null +++ b/docs/classes/Provider.md @@ -0,0 +1,628 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Provider + +# Class: Provider + +## Table of contents + +### Constructors + +- [constructor](Provider.md#constructor) + +### Methods + +- [checkDidFiles](Provider.md#checkdidfiles) +- [computeDelete](Provider.md#computedelete) +- [computeStart](Provider.md#computestart) +- [computeStatus](Provider.md#computestatus) +- [computeStop](Provider.md#computestop) +- [encrypt](Provider.md#encrypt) +- [getComputeEnvironments](Provider.md#getcomputeenvironments) +- [getComputeResultUrl](Provider.md#getcomputeresulturl) +- [getData](Provider.md#getdata) +- [getDownloadUrl](Provider.md#getdownloadurl) +- [getEndpointURL](Provider.md#getendpointurl) +- [getEndpoints](Provider.md#getendpoints) +- [getFileInfo](Provider.md#getfileinfo) +- [getNonce](Provider.md#getnonce) +- [getServiceEndpoints](Provider.md#getserviceendpoints) +- [initialize](Provider.md#initialize) +- [initializeCompute](Provider.md#initializecompute) +- [inputMatch](Provider.md#inputmatch) +- [isValidProvider](Provider.md#isvalidprovider) +- [noZeroX](Provider.md#nozerox) +- [signProviderRequest](Provider.md#signproviderrequest) +- [zeroXTransformer](Provider.md#zeroxtransformer) + +## Constructors + +### constructor + +• **new Provider**() + +## Methods + +### checkDidFiles + +▸ **checkDidFiles**(`did`, `serviceId`, `providerUri`, `withChecksum?`, `signal?`): `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\> + +Get file details for a given DID and service ID. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `did` | `string` | `undefined` | The DID to check. | +| `serviceId` | `string` | `undefined` | The service ID to check. | +| `providerUri` | `string` | `undefined` | The URI of the provider. | +| `withChecksum?` | `boolean` | `false` | Whether or not to include a checksum. | +| `signal?` | `AbortSignal` | `undefined` | An optional abort signal. | + +#### Returns + +`Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\> + +A promise that resolves with an array of file info objects. + +#### Defined in + +[services/Provider.ts:181](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L181) + +___ + +### computeDelete + +▸ **computeDelete**(`did`, `consumer`, `jobId`, `providerUri`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +Deletes a compute job. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | asset did | +| `consumer` | `Signer` | consumer Signer wallet object | +| `jobId` | `string` | the compute job ID | +| `providerUri` | `string` | The URI of the provider we want to query | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +#### Defined in + +[services/Provider.ts:764](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L764) + +___ + +### computeStart + +▸ **computeStart**(`providerUri`, `consumer`, `computeEnv`, `dataset`, `algorithm`, `signal?`, `additionalDatasets?`, `output?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +Instruct the provider to start a compute job + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `providerUri` | `string` | The provider URI. | +| `consumer` | `Signer` | - | +| `computeEnv` | `string` | The compute environment. | +| `dataset` | [`ComputeAsset`](../interfaces/ComputeAsset.md) | The dataset to start compute on | +| `algorithm` | [`ComputeAlgorithm`](../interfaces/ComputeAlgorithm.md) | The algorithm to start compute with. | +| `signal?` | `AbortSignal` | abort signal | +| `additionalDatasets?` | [`ComputeAsset`](../interfaces/ComputeAsset.md)[] | The additional datasets if that is the case. | +| `output?` | [`ComputeOutput`](../interfaces/ComputeOutput.md) | The compute job output settings. | + +#### Returns + +`Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +The compute job or jobs. + +#### Defined in + +[services/Provider.ts:516](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L516) + +___ + +### computeStatus + +▸ **computeStatus**(`providerUri`, `consumerAddress`, `jobId?`, `did?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +Get compute status for a specific jobId/documentId/owner. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +#### Defined in + +[services/Provider.ts:662](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L662) + +___ + +### computeStop + +▸ **computeStop**(`did`, `consumerAddress`, `jobId`, `providerUri`, `signer`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +Instruct the provider to Stop the execution of a to stop a compute job. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | the asset did | +| `consumerAddress` | `string` | The consumer address. | +| `jobId` | `string` | the compute job id | +| `providerUri` | `string` | The provider URI. | +| `signer` | `Signer` | The consumer signer object. | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> + +#### Defined in + +[services/Provider.ts:587](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L587) + +___ + +### encrypt + +▸ **encrypt**(`data`, `chainId`, `providerUri`, `signal?`): `Promise`<`string`\> + +Encrypt data using the Provider's own symmetric key + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `any` | data in json format that needs to be sent , it can either be a DDO or a File array | +| `chainId` | `number` | network's id so provider can choose the corresponding Signer object | +| `providerUri` | `string` | provider uri address | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<`string`\> + +urlDetails + +#### Defined in + +[services/Provider.ts:142](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L142) + +___ + +### getComputeEnvironments + +▸ **getComputeEnvironments**(`providerUri`, `signal?`): `Promise`<{ `[chainId: number]`: [`ComputeEnvironment`](../interfaces/ComputeEnvironment.md)[]; }\> + +Returns compute environments from a provider. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `providerUri` | `string` | The URI of the provider. | +| `signal?` | `AbortSignal` | An optional abort signal. | + +#### Returns + +`Promise`<{ `[chainId: number]`: [`ComputeEnvironment`](../interfaces/ComputeEnvironment.md)[]; }\> + +A promise that resolves with an object containing compute environments for each chain ID. + +#### Defined in + +[services/Provider.ts:290](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L290) + +___ + +### getComputeResultUrl + +▸ **getComputeResultUrl**(`providerUri`, `consumer`, `jobId`, `index`): `Promise`<`string`\> + +Get compute result url + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `providerUri` | `string` | The URI of the provider we want to query | +| `consumer` | `Signer` | consumer Signer wallet object | +| `jobId` | `string` | The ID of a compute job. | +| `index` | `number` | Result index | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[services/Provider.ts:725](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L725) + +___ + +### getData + +▸ `Private` **getData**(`url`): `Promise`<`Response`\> + +Private method that fetches data from a URL using the GET method. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `url` | `string` | The URL to fetch data from. | + +#### Returns + +`Promise`<`Response`\> + +A Promise that resolves to a Response object. + +#### Defined in + +[services/Provider.ts:906](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L906) + +___ + +### getDownloadUrl + +▸ **getDownloadUrl**(`did`, `serviceId`, `fileIndex`, `transferTxId`, `providerUri`, `signer`, `userCustomParameters?`): `Promise`<`any`\> + +Gets the download URL. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | The DID. | +| `serviceId` | `string` | The service ID. | +| `fileIndex` | `number` | The file index. | +| `transferTxId` | `string` | The transfer transaction ID. | +| `providerUri` | `string` | The provider URI. | +| `signer` | `Signer` | The signer. | +| `userCustomParameters?` | [`UserCustomParameters`](../interfaces/UserCustomParameters.md) | The user custom parameters. | + +#### Returns + +`Promise`<`any`\> + +The download URL. + +#### Defined in + +[services/Provider.ts:472](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L472) + +___ + +### getEndpointURL + +▸ **getEndpointURL**(`servicesEndpoints`, `serviceName`): [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md) + +This function returns the endpoint URL for a given service name. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `servicesEndpoints` | [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[] | The array of service endpoints | +| `serviceName` | `string` | The name of the service | + +#### Returns + +[`ServiceEndpoint`](../interfaces/ServiceEndpoint.md) + +The endpoint URL for the given service name + +#### Defined in + +[services/Provider.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L44) + +___ + +### getEndpoints + +▸ **getEndpoints**(`providerUri`): `Promise`<`any`\> + +Returns the provider endpoints + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `providerUri` | `string` | the provider url | + +#### Returns + +`Promise`<`any`\> + +#### Defined in + +[services/Provider.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L28) + +___ + +### getFileInfo + +▸ **getFileInfo**(`file`, `providerUri`, `withChecksum?`, `signal?`): `Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\> + +Get File details (if possible) + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `file` | [`UrlFile`](../interfaces/UrlFile.md) \| [`GraphqlQuery`](../interfaces/GraphqlQuery.md) \| [`Arweave`](../interfaces/Arweave.md) \| [`Ipfs`](../interfaces/Ipfs.md) \| [`Smartcontract`](../interfaces/Smartcontract-1.md) | `undefined` | one of the supported file structures | +| `providerUri` | `string` | `undefined` | uri of the provider that will be used to check the file | +| `withChecksum?` | `boolean` | `false` | Whether or not to include a checksum. | +| `signal?` | `AbortSignal` | `undefined` | An optional abort signal. | + +#### Returns + +`Promise`<[`FileInfo`](../interfaces/FileInfo.md)[]\> + +A promise that resolves with an array of file info objects. + +#### Defined in + +[services/Provider.ts:237](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L237) + +___ + +### getNonce + +▸ **getNonce**(`providerUri`, `consumerAddress`, `signal?`, `providerEndpoints?`, `serviceEndpoints?`): `Promise`<`string`\> + +Get current nonce from the provider. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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?` | [`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[] | document description object (DDO)= | + +#### Returns + +`Promise`<`string`\> + +urlDetails + +#### Defined in + +[services/Provider.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L80) + +___ + +### getServiceEndpoints + +▸ **getServiceEndpoints**(`providerEndpoint`, `endpoints`): `Promise`<[`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[]\> + +This function returns an array of service endpoints for a given provider endpoint. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `providerEndpoint` | `string` | The provider endpoint | +| `endpoints` | `any` | The endpoints object | + +#### Returns + +`Promise`<[`ServiceEndpoint`](../interfaces/ServiceEndpoint.md)[]\> + +An array of service endpoints + +#### Defined in + +[services/Provider.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L58) + +___ + +### initialize + +▸ **initialize**(`did`, `serviceId`, `fileIndex`, `consumerAddress`, `providerUri`, `signal?`, `userCustomParameters?`, `computeEnv?`, `validUntil?`): `Promise`<[`ProviderInitialize`](../interfaces/ProviderInitialize.md)\> + +Initializes the provider for a service request. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `did` | `string` | The asset DID . | +| `serviceId` | `string` | The asset service ID. | +| `fileIndex` | `number` | The file index. | +| `consumerAddress` | `string` | The consumer address. | +| `providerUri` | `string` | The URI of the provider. | +| `signal?` | `AbortSignal` | The abort signal if any. | +| `userCustomParameters?` | [`UserCustomParameters`](../interfaces/UserCustomParameters.md) | The custom parameters if any. | +| `computeEnv?` | `string` | The compute environment if any. | +| `validUntil?` | `number` | The validity time if any. | + +#### Returns + +`Promise`<[`ProviderInitialize`](../interfaces/ProviderInitialize.md)\> + +A promise that resolves with ProviderInitialize response. + +#### Defined in + +[services/Provider.ts:344](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L344) + +___ + +### initializeCompute + +▸ **initializeCompute**(`assets`, `algorithm`, `computeEnv`, `validUntil`, `providerUri`, `accountId`, `signal?`): `Promise`<[`ProviderComputeInitializeResults`](../interfaces/ProviderComputeInitializeResults.md)\> + +Initializes the provider for a compute request. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `assets` | [`ComputeAsset`](../interfaces/ComputeAsset.md)[] | The datasets array to initialize compute request. | +| `algorithm` | [`ComputeAlgorithm`](../interfaces/ComputeAlgorithm.md) | The algorithm to use. | +| `computeEnv` | `string` | The compute environment. | +| `validUntil` | `number` | The job expiration date. | +| `providerUri` | `string` | The provider URI. | +| `accountId` | `string` | caller address | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<[`ProviderComputeInitializeResults`](../interfaces/ProviderComputeInitializeResults.md)\> + +ProviderComputeInitialize data + +#### Defined in + +[services/Provider.ts:409](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L409) + +___ + +### inputMatch + +▸ `Private` **inputMatch**(`input`, `regexp`, `conversorName`): `Object` + +Private method that matches an input string against a regular expression and returns the first capture group. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `string` | The input string to match. | +| `regexp` | `RegExp` | The regular expression to match against. | +| `conversorName` | `string` | The name of the method calling this function. | + +#### Returns + +`Object` + +An object with two properties: `valid` (a boolean indicating whether the input matched the regular expression) and `output` (the first capture group of the match, or the original input if there was no match). + +| Name | Type | +| :------ | :------ | +| `output` | `string` | +| `valid` | `boolean` | + +#### Defined in + +[services/Provider.ts:883](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L883) + +___ + +### isValidProvider + +▸ **isValidProvider**(`url`, `signal?`): `Promise`<`boolean`\> + +Check for a valid provider at URL + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `url` | `string` | provider uri address | +| `signal?` | `AbortSignal` | abort signal | + +#### Returns + +`Promise`<`boolean`\> + +valid or not + +#### Defined in + +[services/Provider.ts:834](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L834) + +___ + +### noZeroX + +▸ `Private` **noZeroX**(`input`): `string` + +Private method that removes the leading 0x from a string. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | `string` | The input string. | + +#### Returns + +`string` + +The transformed string. + +#### Defined in + +[services/Provider.ts:857](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L857) + +___ + +### signProviderRequest + +▸ **signProviderRequest**(`signer`, `message`): `Promise`<`string`\> + +Sign a provider request with a signer. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer to use. | +| `message` | `string` | The message to sign. | + +#### Returns + +`Promise`<`string`\> + +A promise that resolves with the signature. + +#### Defined in + +[services/Provider.ts:116](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L116) + +___ + +### zeroXTransformer + +▸ `Private` **zeroXTransformer**(`input?`, `zeroOutput`): `string` + +Private method that removes the leading 0x from a string. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `input` | `string` | `''` | The input string. | +| `zeroOutput` | `boolean` | `undefined` | Whether to include 0x in the output if the input is valid and zeroOutput is true. | + +#### Returns + +`string` + +The transformed string. + +#### Defined in + +[services/Provider.ts:867](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L867) diff --git a/docs/classes/Router.md b/docs/classes/Router.md new file mode 100644 index 00000000..53c8be8c --- /dev/null +++ b/docs/classes/Router.md @@ -0,0 +1,645 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Router + +# Class: Router + +Provides an interface for FactoryRouter contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`Router`** + +## Table of contents + +### Constructors + +- [constructor](Router.md#constructor) + +### Properties + +- [abi](Router.md#abi) +- [address](Router.md#address) +- [config](Router.md#config) +- [contract](Router.md#contract) +- [signer](Router.md#signer) + +### Methods + +- [addApprovedToken](Router.md#addapprovedtoken) +- [addDispenserContract](Router.md#adddispensercontract) +- [addFixedRateContract](Router.md#addfixedratecontract) +- [amountToUnits](Router.md#amounttounits) +- [buyDatatokenBatch](Router.md#buydatatokenbatch) +- [getContract](Router.md#getcontract) +- [getCurrentOPCFee](Router.md#getcurrentopcfee) +- [getDefaultAbi](Router.md#getdefaultabi) +- [getFairGasPrice](Router.md#getfairgasprice) +- [getNFTFactory](Router.md#getnftfactory) +- [getOPCFee](Router.md#getopcfee) +- [getOwner](Router.md#getowner) +- [isApprovedToken](Router.md#isapprovedtoken) +- [isFixedPrice](Router.md#isfixedprice) +- [removeApprovedToken](Router.md#removeapprovedtoken) +- [removeDispenserContract](Router.md#removedispensercontract) +- [removeFixedRateContract](Router.md#removefixedratecontract) +- [unitsToAmount](Router.md#unitstoamount) +- [updateOPCFee](Router.md#updateopcfee) + +## Constructors + +### constructor + +• **new Router**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### addApprovedToken + +▸ **addApprovedToken**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Adds a token to the list of tokens with reduced fees + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | token address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:82](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L82) + +___ + +### addDispenserContract + +▸ **addDispenserContract**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Adds an address to the list of dispensers + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | contract address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:201](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L201) + +___ + +### addFixedRateContract + +▸ **addFixedRateContract**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Adds an address to the list of fixed rate contracts + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | contract address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:141](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L141) + +___ + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### buyDatatokenBatch + +▸ **buyDatatokenBatch**<`G`\>(`operations`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +* Buys a batch of datatokens. +one single call to buy multiple DT for multiple assets. +require tokenIn approvals for router from user. (except for dispenser operations) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `operations` | [`Operation`](../interfaces/Operation.md)[] | The operations to execute. | +| `estimateGas?` | `G` | Whether to return only the estimate gas or not. | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Transaction receipt + +#### Defined in + +[contracts/Router.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L22) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getCurrentOPCFee + +▸ **getCurrentOPCFee**(): `Promise`<`number`\> + +Get Current OPF Fee + +#### Returns + +`Promise`<`number`\> + +OPF fee + +#### Defined in + +[contracts/Router.ts:262](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L262) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/Router.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L10) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getNFTFactory + +▸ **getNFTFactory**(): `Promise`<`string`\> + +Get NFT Factory address + +#### Returns + +`Promise`<`string`\> + +NFT Factory address + +#### Defined in + +[contracts/Router.ts:71](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L71) + +___ + +### getOPCFee + +▸ **getOPCFee**(`baseToken`): `Promise`<`number`\> + +Get OPF Fee per token + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `baseToken` | `string` | + +#### Returns + +`Promise`<`number`\> + +OPC fee for a specific baseToken + +#### Defined in + +[contracts/Router.ts:255](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L255) + +___ + +### getOwner + +▸ **getOwner**(): `Promise`<`string`\> + +Get Router Owner + +#### Returns + +`Promise`<`string`\> + +Router Owner address + +#### Defined in + +[contracts/Router.ts:63](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L63) + +___ + +### isApprovedToken + +▸ **isApprovedToken**(`address`): `Promise`<`boolean`\> + +Checks if a token is on approved tokens list, +if true opfFee is lower in pools with that token/DT + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the token to check. | + +#### Returns + +`Promise`<`boolean`\> + +true if is on the list. + +#### Defined in + +[contracts/Router.ts:46](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L46) + +___ + +### isFixedPrice + +▸ **isFixedPrice**(`address`): `Promise`<`boolean`\> + +Check if an address is a Fixed Rate contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the fixed rate exchange to check. | + +#### Returns + +`Promise`<`boolean`\> + +true if is a Fixed Rate contract + +#### Defined in + +[contracts/Router.ts:55](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L55) + +___ + +### removeApprovedToken + +▸ **removeApprovedToken**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Removes a token if exists from the list of tokens with reduced fees + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | token address to remove | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:112](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L112) + +___ + +### removeDispenserContract + +▸ **removeDispenserContract**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Removes an address from the list of dispensers + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | address Contract to be removed | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:230](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L230) + +___ + +### removeFixedRateContract + +▸ **removeFixedRateContract**<`G`\>(`address`, `tokenAddress`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Removes an address from the list of fixed rate contracts + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `tokenAddress` | `string` | contract address to add | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:171](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L171) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) + +___ + +### updateOPCFee + +▸ **updateOPCFee**<`G`\>(`address`, `newSwapOceanFee`, `newSwapNonOceanFee`, `newConsumeFee`, `newProviderFee`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Updates OP Community Fees + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | caller address | +| `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 | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/Router.ts:276](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/Router.ts#L276) diff --git a/docs/classes/SmartContract.md b/docs/classes/SmartContract.md new file mode 100644 index 00000000..b72b8131 --- /dev/null +++ b/docs/classes/SmartContract.md @@ -0,0 +1,193 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / SmartContract + +# Class: SmartContract + +## Hierarchy + +- **`SmartContract`** + + ↳ [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ [`Datatoken`](Datatoken.md) + + ↳ [`Nft`](Nft.md) + +## Table of contents + +### Constructors + +- [constructor](SmartContract.md#constructor) + +### Properties + +- [abi](SmartContract.md#abi) +- [config](SmartContract.md#config) +- [signer](SmartContract.md#signer) + +### Methods + +- [amountToUnits](SmartContract.md#amounttounits) +- [getContract](SmartContract.md#getcontract) +- [getDefaultAbi](SmartContract.md#getdefaultabi) +- [getFairGasPrice](SmartContract.md#getfairgasprice) +- [unitsToAmount](SmartContract.md#unitstoamount) + +## Constructors + +### constructor + +• **new SmartContract**(`signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Defined in + +[contracts/SmartContract.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L25) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### signer + +• **signer**: `Signer` + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ `Abstract` **getDefaultAbi**(): `any` + +#### Returns + +`any` + +#### Defined in + +[contracts/SmartContract.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L16) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/SmartContractWithAddress.md b/docs/classes/SmartContractWithAddress.md new file mode 100644 index 00000000..a26310bf --- /dev/null +++ b/docs/classes/SmartContractWithAddress.md @@ -0,0 +1,268 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / SmartContractWithAddress + +# Class: SmartContractWithAddress + +## Hierarchy + +- [`SmartContract`](SmartContract.md) + + ↳ **`SmartContractWithAddress`** + + ↳↳ [`Dispenser`](Dispenser.md) + + ↳↳ [`FixedRateExchange`](FixedRateExchange.md) + + ↳↳ [`Router`](Router.md) + + ↳↳ [`NftFactory`](NftFactory.md) + + ↳↳ [`VeOcean`](VeOcean.md) + + ↳↳ [`VeFeeDistributor`](VeFeeDistributor.md) + + ↳↳ [`VeFeeEstimate`](VeFeeEstimate.md) + + ↳↳ [`VeAllocate`](VeAllocate.md) + + ↳↳ [`DfRewards`](DfRewards.md) + + ↳↳ [`DfStrategyV1`](DfStrategyV1.md) + +## Table of contents + +### Constructors + +- [constructor](SmartContractWithAddress.md#constructor) + +### Properties + +- [abi](SmartContractWithAddress.md#abi) +- [address](SmartContractWithAddress.md#address) +- [config](SmartContractWithAddress.md#config) +- [contract](SmartContractWithAddress.md#contract) +- [signer](SmartContractWithAddress.md#signer) + +### Methods + +- [amountToUnits](SmartContractWithAddress.md#amounttounits) +- [getContract](SmartContractWithAddress.md#getcontract) +- [getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) +- [getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) +- [unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +## Constructors + +### constructor + +• **new SmartContractWithAddress**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Overrides + +[SmartContract](SmartContract.md).[constructor](SmartContract.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContract](SmartContract.md).[abi](SmartContract.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContract](SmartContract.md).[config](SmartContract.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContract](SmartContract.md).[signer](SmartContract.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContract](SmartContract.md).[amountToUnits](SmartContract.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContract](SmartContract.md).[getContract](SmartContract.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ `Abstract` **getDefaultAbi**(): `any` + +#### Returns + +`any` + +#### Inherited from + +[SmartContract](SmartContract.md).[getDefaultAbi](SmartContract.md#getdefaultabi) + +#### Defined in + +[contracts/SmartContract.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L16) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContract](SmartContract.md).[getFairGasPrice](SmartContract.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContract](SmartContract.md).[unitsToAmount](SmartContract.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/VeAllocate.md b/docs/classes/VeAllocate.md new file mode 100644 index 00000000..ea94bf45 --- /dev/null +++ b/docs/classes/VeAllocate.md @@ -0,0 +1,372 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / VeAllocate + +# Class: VeAllocate + +Provides an interface for veOcean contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`VeAllocate`** + +## Table of contents + +### Constructors + +- [constructor](VeAllocate.md#constructor) + +### Properties + +- [abi](VeAllocate.md#abi) +- [address](VeAllocate.md#address) +- [config](VeAllocate.md#config) +- [contract](VeAllocate.md#contract) +- [signer](VeAllocate.md#signer) + +### Methods + +- [amountToUnits](VeAllocate.md#amounttounits) +- [getContract](VeAllocate.md#getcontract) +- [getDefaultAbi](VeAllocate.md#getdefaultabi) +- [getFairGasPrice](VeAllocate.md#getfairgasprice) +- [getTotalAllocation](VeAllocate.md#gettotalallocation) +- [getVeAllocation](VeAllocate.md#getveallocation) +- [setAllocation](VeAllocate.md#setallocation) +- [setBatchAllocation](VeAllocate.md#setbatchallocation) +- [unitsToAmount](VeAllocate.md#unitstoamount) + +## Constructors + +### constructor + +• **new VeAllocate**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/ve/VeAllocate.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeAllocate.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getTotalAllocation + +▸ **getTotalAllocation**(`userAddress`): `Promise`<`number`\> + +Get totalAllocation for address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[contracts/ve/VeAllocate.ts:81](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeAllocate.ts#L81) + +___ + +### getVeAllocation + +▸ **getVeAllocation**(`userAddress`, `nft`, `chainId`): `Promise`<`number`\> + +Get getveAllocation for address, nft, chainId + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | +| `nft` | `string` | NFT address to allocate to | +| `chainId` | `string` | chainId of NFT | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[contracts/ve/VeAllocate.ts:92](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeAllocate.ts#L92) + +___ + +### setAllocation + +▸ **setAllocation**<`G`\>(`amount`, `nft`, `chainId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +set a specific percentage of veOcean to a specific nft +Maximum allocated percentage is 10000, so 1% is specified as 100 + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `string` | Percentage used | +| `nft` | `string` | NFT address to allocate to | +| `chainId` | `number` | chainId of NFT | +| `estimateGas?` | `G` | - | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeAllocate.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeAllocate.ts#L21) + +___ + +### setBatchAllocation + +▸ **setBatchAllocation**<`G`\>(`amount`, `nft`, `chainId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +set specific percetage of veOcean to multiple nfts +Maximum allocated percentage is 10000, so 1% is specified as 100 + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `string`[] | Array of percentages used | +| `nft` | `string`[] | Array of NFT addresses | +| `chainId` | `number`[] | Array of chainIds | +| `estimateGas?` | `G` | - | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeAllocate.ts:51](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeAllocate.ts#L51) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/VeFeeDistributor.md b/docs/classes/VeFeeDistributor.md new file mode 100644 index 00000000..9fdcd460 --- /dev/null +++ b/docs/classes/VeFeeDistributor.md @@ -0,0 +1,325 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / VeFeeDistributor + +# Class: VeFeeDistributor + +Provides an interface for veOcean contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`VeFeeDistributor`** + +## Table of contents + +### Constructors + +- [constructor](VeFeeDistributor.md#constructor) + +### Properties + +- [abi](VeFeeDistributor.md#abi) +- [address](VeFeeDistributor.md#address) +- [config](VeFeeDistributor.md#config) +- [contract](VeFeeDistributor.md#contract) +- [signer](VeFeeDistributor.md#signer) + +### Methods + +- [amountToUnits](VeFeeDistributor.md#amounttounits) +- [claim](VeFeeDistributor.md#claim) +- [claimMany](VeFeeDistributor.md#claimmany) +- [getContract](VeFeeDistributor.md#getcontract) +- [getDefaultAbi](VeFeeDistributor.md#getdefaultabi) +- [getFairGasPrice](VeFeeDistributor.md#getfairgasprice) +- [unitsToAmount](VeFeeDistributor.md#unitstoamount) + +## Constructors + +### constructor + +• **new VeFeeDistributor**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### claim + +▸ **claim**<`G`\>(`estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Claim fees for `userAddress` +Each call to claim look at a maximum of 50 user veOCEAN points. + For accounts with many veOCEAN related actions, this function + may need to be called more than once to claim all available + fees. In the `Claimed` event that fires, if `claim_epoch` is + less than `max_epoch`, the account may claim again + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeFeeDistributor.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeFeeDistributor.ts#L23) + +___ + +### claimMany + +▸ **claimMany**<`G`\>(`addresses`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Make multiple fee claims in a single call + Used to claim for many accounts at once, or to make + multiple claims for the same address when that address + has significant veOCEAN history + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `addresses` | `string`[] | array of addresses to claim | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeFeeDistributor.ts:48](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeFeeDistributor.ts#L48) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/ve/VeFeeDistributor.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeFeeDistributor.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/VeFeeEstimate.md b/docs/classes/VeFeeEstimate.md new file mode 100644 index 00000000..24dd690c --- /dev/null +++ b/docs/classes/VeFeeEstimate.md @@ -0,0 +1,281 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / VeFeeEstimate + +# Class: VeFeeEstimate + +Provides an interface for veOcean contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`VeFeeEstimate`** + +## Table of contents + +### Constructors + +- [constructor](VeFeeEstimate.md#constructor) + +### Properties + +- [abi](VeFeeEstimate.md#abi) +- [address](VeFeeEstimate.md#address) +- [config](VeFeeEstimate.md#config) +- [contract](VeFeeEstimate.md#contract) +- [signer](VeFeeEstimate.md#signer) + +### Methods + +- [amountToUnits](VeFeeEstimate.md#amounttounits) +- [estimateClaim](VeFeeEstimate.md#estimateclaim) +- [getContract](VeFeeEstimate.md#getcontract) +- [getDefaultAbi](VeFeeEstimate.md#getdefaultabi) +- [getFairGasPrice](VeFeeEstimate.md#getfairgasprice) +- [unitsToAmount](VeFeeEstimate.md#unitstoamount) + +## Constructors + +### constructor + +• **new VeFeeEstimate**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### estimateClaim + +▸ **estimateClaim**(`userAddress`): `Promise`<`string`\> + +estimateClaim + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/ve/VeFeeEstimate.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeFeeEstimate.ts#L18) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/ve/VeFeeEstimate.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeFeeEstimate.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) diff --git a/docs/classes/VeOcean.md b/docs/classes/VeOcean.md new file mode 100644 index 00000000..6bc82652 --- /dev/null +++ b/docs/classes/VeOcean.md @@ -0,0 +1,513 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / VeOcean + +# Class: VeOcean + +Provides an interface for veOcean contract + +## Hierarchy + +- [`SmartContractWithAddress`](SmartContractWithAddress.md) + + ↳ **`VeOcean`** + +## Table of contents + +### Constructors + +- [constructor](VeOcean.md#constructor) + +### Properties + +- [abi](VeOcean.md#abi) +- [address](VeOcean.md#address) +- [config](VeOcean.md#config) +- [contract](VeOcean.md#contract) +- [signer](VeOcean.md#signer) + +### Methods + +- [amountToUnits](VeOcean.md#amounttounits) +- [depositFor](VeOcean.md#depositfor) +- [getContract](VeOcean.md#getcontract) +- [getDefaultAbi](VeOcean.md#getdefaultabi) +- [getFairGasPrice](VeOcean.md#getfairgasprice) +- [getLockedAmount](VeOcean.md#getlockedamount) +- [getToken](VeOcean.md#gettoken) +- [getVotingPower](VeOcean.md#getvotingpower) +- [increaseAmount](VeOcean.md#increaseamount) +- [increaseUnlockTime](VeOcean.md#increaseunlocktime) +- [lockEnd](VeOcean.md#lockend) +- [lockTokens](VeOcean.md#locktokens) +- [totalSupply](VeOcean.md#totalsupply) +- [unitsToAmount](VeOcean.md#unitstoamount) +- [withdraw](VeOcean.md#withdraw) + +## Constructors + +### constructor + +• **new VeOcean**(`address`, `signer`, `network?`, `config?`, `abi?`) + +Instantiate the smart contract. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract. | +| `signer` | `Signer` | The signer object. | +| `network?` | `string` \| `number` | Network id or name | +| `config?` | [`Config`](Config.md) | The configuration object. | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | ABI array of the smart contract | + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L17) + +## Properties + +### abi + +• **abi**: [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[abi](SmartContractWithAddress.md#abi) + +#### Defined in + +[contracts/SmartContract.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L14) + +___ + +### address + +• **address**: `string` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[address](SmartContractWithAddress.md#address) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L6) + +___ + +### config + +• **config**: [`Config`](Config.md) + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[config](SmartContractWithAddress.md#config) + +#### Defined in + +[contracts/SmartContract.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L13) + +___ + +### contract + +• **contract**: `Contract` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[contract](SmartContractWithAddress.md#contract) + +#### Defined in + +[contracts/SmartContractWithAddress.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContractWithAddress.ts#L7) + +___ + +### signer + +• **signer**: `Signer` + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[signer](SmartContractWithAddress.md#signer) + +#### Defined in + +[contracts/SmartContract.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L12) + +## Methods + +### amountToUnits + +▸ `Protected` **amountToUnits**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[amountToUnits](SmartContractWithAddress.md#amounttounits) + +#### Defined in + +[contracts/SmartContract.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L43) + +___ + +### depositFor + +▸ **depositFor**<`G`\>(`toAddress`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deposit `amount` tokens for `toAddress` and add to the existing lock +Anyone (even a smart contract) can deposit for someone else, but cannot extend their locktime and deposit for a brand new user + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `toAddress` | `string` | user address to deposit for | +| `amount` | `string` | Amount of tokens to be locked | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeOcean.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L52) + +___ + +### getContract + +▸ `Protected` **getContract**(`address`, `abi?`): `Contract` + +Returns a contract instance for the given address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the contract | +| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] | The ABI of the contract | + +#### Returns + +`Contract` + +- The contract instance + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getContract](SmartContractWithAddress.md#getcontract) + +#### Defined in + +[contracts/SmartContract.ts:80](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L80) + +___ + +### getDefaultAbi + +▸ **getDefaultAbi**(): [`AbiItem`](../interfaces/AbiItem.md)[] + +#### Returns + +[`AbiItem`](../interfaces/AbiItem.md)[] + +#### Overrides + +[SmartContractWithAddress](SmartContractWithAddress.md).[getDefaultAbi](SmartContractWithAddress.md#getdefaultabi) + +#### Defined in + +[contracts/ve/VeOcean.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L9) + +___ + +### getFairGasPrice + +▸ `Protected` **getFairGasPrice**(): `Promise`<`string`\> + +Retruns the gas price + +#### Returns + +`Promise`<`string`\> + +- The fair gas price + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[getFairGasPrice](SmartContractWithAddress.md#getfairgasprice) + +#### Defined in + +[contracts/SmartContract.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L70) + +___ + +### getLockedAmount + +▸ **getLockedAmount**(`userAddress`): `Promise`<`string`\> + +Get locked balance + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/ve/VeOcean.ts:156](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L156) + +___ + +### getToken + +▸ **getToken**(): `Promise`<`string`\> + +Get token + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/ve/VeOcean.ts:189](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L189) + +___ + +### getVotingPower + +▸ **getVotingPower**(`userAddress`): `Promise`<`number`\> + +Get voting power for address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[contracts/ve/VeOcean.ts:147](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L147) + +___ + +### increaseAmount + +▸ **increaseAmount**<`G`\>(`amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deposit `amount` additional tokens for `userAddress` without modifying the unlock time + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `string` | Amount of tokens to be locked | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeOcean.ts:79](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L79) + +___ + +### increaseUnlockTime + +▸ **increaseUnlockTime**<`G`\>(`unlockTime`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Extend the unlock time for `userAddress` to `unlockTime` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `unlockTime` | `number` | Timestamp for new unlock time | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeOcean.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L104) + +___ + +### lockEnd + +▸ **lockEnd**(`userAddress`): `Promise`<`number`\> + +Get untilLock for address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userAddress` | `string` | user address | + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[contracts/ve/VeOcean.ts:170](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L170) + +___ + +### lockTokens + +▸ **lockTokens**<`G`\>(`amount`, `unlockTime`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Deposit `amount` tokens for `userAddress` and lock until `unlockTime` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `string` | Amount of tokens to be locked | +| `unlockTime` | `number` | Timestamp for unlock | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeOcean.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L20) + +___ + +### totalSupply + +▸ **totalSupply**(): `Promise`<`string`\> + +Get total supply + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[contracts/ve/VeOcean.ts:178](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L178) + +___ + +### unitsToAmount + +▸ `Protected` **unitsToAmount**(`token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Inherited from + +[SmartContractWithAddress](SmartContractWithAddress.md).[unitsToAmount](SmartContractWithAddress.md#unitstoamount) + +#### Defined in + +[contracts/SmartContract.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/SmartContract.ts#L58) + +___ + +### withdraw + +▸ **withdraw**<`G`\>(`estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +Withdraw all tokens for `userAddress` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `estimateGas?` | `G` | if True, return gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[contracts/ve/VeOcean.ts:127](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/contracts/ve/VeOcean.ts#L127) diff --git a/docs/enums/LogLevel.md b/docs/enums/LogLevel.md new file mode 100644 index 00000000..122322a5 --- /dev/null +++ b/docs/enums/LogLevel.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / LogLevel + +# Enumeration: LogLevel + +## Table of contents + +### Enumeration Members + +- [Error](LogLevel.md#error) +- [Log](LogLevel.md#log) +- [None](LogLevel.md#none) +- [Verbose](LogLevel.md#verbose) +- [Warn](LogLevel.md#warn) + +## Enumeration Members + +### Error + +• **Error** = ``0`` + +#### Defined in + +[utils/Logger.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L4) + +___ + +### Log + +• **Log** = ``2`` + +#### Defined in + +[utils/Logger.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L6) + +___ + +### None + +• **None** = ``-1`` + +#### Defined in + +[utils/Logger.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L3) + +___ + +### Verbose + +• **Verbose** = ``3`` + +#### Defined in + +[utils/Logger.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L7) + +___ + +### Warn + +• **Warn** = ``1`` + +#### Defined in + +[utils/Logger.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L5) diff --git a/docs/interfaces/AbiInput.md b/docs/interfaces/AbiInput.md new file mode 100644 index 00000000..a2adddaa --- /dev/null +++ b/docs/interfaces/AbiInput.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AbiInput + +# Interface: AbiInput + +## Table of contents + +### Properties + +- [components](AbiInput.md#components) +- [indexed](AbiInput.md#indexed) +- [internalType](AbiInput.md#internaltype) +- [name](AbiInput.md#name) +- [type](AbiInput.md#type) + +## Properties + +### components + +• `Optional` **components**: [`AbiInput`](AbiInput.md)[] + +#### Defined in + +[@types/Contracts.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L8) + +___ + +### indexed + +• `Optional` **indexed**: `boolean` + +#### Defined in + +[@types/Contracts.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L7) + +___ + +### internalType + +• `Optional` **internalType**: `string` + +#### Defined in + +[@types/Contracts.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L9) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[@types/Contracts.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L5) + +___ + +### type + +• **type**: `string` + +#### Defined in + +[@types/Contracts.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L6) diff --git a/docs/interfaces/AbiItem.md b/docs/interfaces/AbiItem.md new file mode 100644 index 00000000..ccbf3113 --- /dev/null +++ b/docs/interfaces/AbiItem.md @@ -0,0 +1,107 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AbiItem + +# Interface: AbiItem + +## Table of contents + +### Properties + +- [anonymous](AbiItem.md#anonymous) +- [constant](AbiItem.md#constant) +- [gas](AbiItem.md#gas) +- [inputs](AbiItem.md#inputs) +- [name](AbiItem.md#name) +- [outputs](AbiItem.md#outputs) +- [payable](AbiItem.md#payable) +- [stateMutability](AbiItem.md#statemutability) +- [type](AbiItem.md#type) + +## Properties + +### anonymous + +• `Optional` **anonymous**: `boolean` + +#### Defined in + +[@types/Contracts.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L20) + +___ + +### constant + +• `Optional` **constant**: `boolean` + +#### Defined in + +[@types/Contracts.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L21) + +___ + +### gas + +• `Optional` **gas**: `number` + +#### Defined in + +[@types/Contracts.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L28) + +___ + +### inputs + +• `Optional` **inputs**: [`AbiInput`](AbiInput.md)[] + +#### Defined in + +[@types/Contracts.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L22) + +___ + +### name + +• `Optional` **name**: `string` + +#### Defined in + +[@types/Contracts.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L23) + +___ + +### outputs + +• `Optional` **outputs**: [`AbiOutput`](AbiOutput.md)[] + +#### Defined in + +[@types/Contracts.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L24) + +___ + +### payable + +• `Optional` **payable**: `boolean` + +#### Defined in + +[@types/Contracts.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L25) + +___ + +### stateMutability + +• `Optional` **stateMutability**: [`StateMutabilityType`](../modules.md#statemutabilitytype) + +#### Defined in + +[@types/Contracts.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L26) + +___ + +### type + +• **type**: [`AbiType`](../modules.md#abitype) + +#### Defined in + +[@types/Contracts.ts:27](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L27) diff --git a/docs/interfaces/AbiOutput.md b/docs/interfaces/AbiOutput.md new file mode 100644 index 00000000..f84d6607 --- /dev/null +++ b/docs/interfaces/AbiOutput.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AbiOutput + +# Interface: AbiOutput + +## Table of contents + +### Properties + +- [components](AbiOutput.md#components) +- [internalType](AbiOutput.md#internaltype) +- [name](AbiOutput.md#name) +- [type](AbiOutput.md#type) + +## Properties + +### components + +• `Optional` **components**: [`AbiOutput`](AbiOutput.md)[] + +#### Defined in + +[@types/Contracts.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L15) + +___ + +### internalType + +• `Optional` **internalType**: `string` + +#### Defined in + +[@types/Contracts.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L16) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[@types/Contracts.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L13) + +___ + +### type + +• **type**: `string` + +#### Defined in + +[@types/Contracts.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L14) diff --git a/docs/interfaces/Arweave.md b/docs/interfaces/Arweave.md new file mode 100644 index 00000000..dfc2ee65 --- /dev/null +++ b/docs/interfaces/Arweave.md @@ -0,0 +1,32 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Arweave + +# Interface: Arweave + +## Table of contents + +### Properties + +- [transactionId](Arweave.md#transactionid) +- [type](Arweave.md#type) + +## Properties + +### transactionId + +• **transactionId**: `string` + +transactionId + +#### Defined in + +[@types/File.ts:68](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L68) + +___ + +### type + +• **type**: ``"arweave"`` + +#### Defined in + +[@types/File.ts:62](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L62) diff --git a/docs/interfaces/Asset.md b/docs/interfaces/Asset.md new file mode 100644 index 00000000..e3433217 --- /dev/null +++ b/docs/interfaces/Asset.md @@ -0,0 +1,227 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Asset + +# Interface: Asset + +DID Descriptor Object. +Contains metadata about the asset, and define access in at least one service. + +## Hierarchy + +- [`DDO`](DDO.md) + + ↳ **`Asset`** + +## Table of contents + +### Properties + +- [@context](Asset.md#@context) +- [chainId](Asset.md#chainid) +- [credentials](Asset.md#credentials) +- [datatokens](Asset.md#datatokens) +- [event](Asset.md#event) +- [id](Asset.md#id) +- [metadata](Asset.md#metadata) +- [nft](Asset.md#nft) +- [nftAddress](Asset.md#nftaddress) +- [purgatory](Asset.md#purgatory) +- [services](Asset.md#services) +- [stats](Asset.md#stats) +- [version](Asset.md#version) + +## Properties + +### @context + +• **@context**: `string`[] + +Contexts used for validation. + +#### Inherited from + +[DDO](DDO.md).[@context](DDO.md#@context) + +#### Defined in + +[@types/DDO/DDO.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L12) + +___ + +### chainId + +• **chainId**: `number` + +ChainId of the network the DDO was published to. + +#### Inherited from + +[DDO](DDO.md).[chainId](DDO.md#chainid) + +#### Defined in + +[@types/DDO/DDO.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L38) + +___ + +### credentials + +• `Optional` **credentials**: [`Credentials`](Credentials.md) + +Describes the credentials needed to access a dataset +in addition to the services definition. + +#### Inherited from + +[DDO](DDO.md).[credentials](DDO.md#credentials) + +#### Defined in + +[@types/DDO/DDO.ts:57](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L57) + +___ + +### datatokens + +• **datatokens**: [`AssetDatatoken`](AssetDatatoken.md)[] + +Contains information about the ERC20 Datatokens attached to asset services. + +#### Defined in + +[@types/Asset.ts:151](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L151) + +___ + +### event + +• **event**: [`AssetLastEvent`](AssetLastEvent.md) + +Contains information about the last transaction that created or updated the DDO. + +#### Overrides + +[DDO](DDO.md).[event](DDO.md#event) + +#### Defined in + +[@types/Asset.ts:157](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L157) + +___ + +### id + +• **id**: `string` + +DID, descentralized ID. +Computed as sha256(address of NFT contract + chainId) + +#### Inherited from + +[DDO](DDO.md).[id](DDO.md#id) + +#### Defined in + +[@types/DDO/DDO.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L19) + +___ + +### metadata + +• **metadata**: [`Metadata`](Metadata.md) + +Stores an object describing the asset. + +#### Inherited from + +[DDO](DDO.md).[metadata](DDO.md#metadata) + +#### Defined in + +[@types/DDO/DDO.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L44) + +___ + +### nft + +• **nft**: [`AssetNft`](AssetNft.md) + +Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher. + +#### Defined in + +[@types/Asset.ts:145](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L145) + +___ + +### nftAddress + +• **nftAddress**: `string` + +NFT contract address + +#### Inherited from + +[DDO](DDO.md).[nftAddress](DDO.md#nftaddress) + +#### Defined in + +[@types/DDO/DDO.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L32) + +___ + +### purgatory + +• **purgatory**: [`Purgatory`](Purgatory.md) + +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 downloading on assets in purgatory. + +#### Defined in + +[@types/Asset.ts:171](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L171) + +___ + +### services + +• **services**: [`Service`](Service.md)[] + +Stores an array of services defining access to the asset. + +#### Inherited from + +[DDO](DDO.md).[services](DDO.md#services) + +#### Defined in + +[@types/DDO/DDO.ts:50](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L50) + +___ + +### stats + +• **stats**: [`Stats`](Stats.md) + +The stats section contains different statistics fields. This section is added by Aquarius + +#### Defined in + +[@types/Asset.ts:163](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L163) + +___ + +### version + +• **version**: `string` + +Version information in SemVer notation +referring to the DDO spec version + +#### Inherited from + +[DDO](DDO.md).[version](DDO.md#version) + +#### Defined in + +[@types/DDO/DDO.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L26) diff --git a/docs/interfaces/AssetDatatoken.md b/docs/interfaces/AssetDatatoken.md new file mode 100644 index 00000000..e4508b01 --- /dev/null +++ b/docs/interfaces/AssetDatatoken.md @@ -0,0 +1,60 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AssetDatatoken + +# Interface: AssetDatatoken + +## Table of contents + +### Properties + +- [address](AssetDatatoken.md#address) +- [name](AssetDatatoken.md#name) +- [serviceId](AssetDatatoken.md#serviceid) +- [symbol](AssetDatatoken.md#symbol) + +## Properties + +### address + +• **address**: `string` + +Contract address of the deployed Datatoken contract. + +#### Defined in + +[@types/Asset.ts:72](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L72) + +___ + +### name + +• **name**: `string` + +Name of NFT set in contract. + +#### Defined in + +[@types/Asset.ts:78](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L78) + +___ + +### serviceId + +• **serviceId**: `string` + +ID of the service the datatoken is attached to. + +#### Defined in + +[@types/Asset.ts:90](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L90) + +___ + +### symbol + +• **symbol**: `string` + +Symbol of NFT set in contract. + +#### Defined in + +[@types/Asset.ts:84](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L84) diff --git a/docs/interfaces/AssetLastEvent.md b/docs/interfaces/AssetLastEvent.md new file mode 100644 index 00000000..b2058363 --- /dev/null +++ b/docs/interfaces/AssetLastEvent.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AssetLastEvent + +# Interface: AssetLastEvent + +## Table of contents + +### Properties + +- [block](AssetLastEvent.md#block) +- [contract](AssetLastEvent.md#contract) +- [datetime](AssetLastEvent.md#datetime) +- [from](AssetLastEvent.md#from) +- [tx](AssetLastEvent.md#tx) + +## Properties + +### block + +• **block**: `number` + +#### Defined in + +[@types/Asset.ts:134](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L134) + +___ + +### contract + +• **contract**: `string` + +#### Defined in + +[@types/Asset.ts:136](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L136) + +___ + +### datetime + +• **datetime**: `string` + +#### Defined in + +[@types/Asset.ts:137](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L137) + +___ + +### from + +• **from**: `string` + +#### Defined in + +[@types/Asset.ts:135](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L135) + +___ + +### tx + +• **tx**: `string` + +#### Defined in + +[@types/Asset.ts:133](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L133) diff --git a/docs/interfaces/AssetNft.md b/docs/interfaces/AssetNft.md new file mode 100644 index 00000000..53578ad2 --- /dev/null +++ b/docs/interfaces/AssetNft.md @@ -0,0 +1,105 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AssetNft + +# Interface: AssetNft + +## Table of contents + +### Properties + +- [address](AssetNft.md#address) +- [created](AssetNft.md#created) +- [name](AssetNft.md#name) +- [owner](AssetNft.md#owner) +- [state](AssetNft.md#state) +- [symbol](AssetNft.md#symbol) +- [tokenURI](AssetNft.md#tokenuri) + +## Properties + +### address + +• **address**: `string` + +Contract address of the deployed ERC721 NFT contract. + +#### Defined in + +[@types/Asset.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L8) + +___ + +### created + +• **created**: `string` + +Contains the date of NFT creation. + +#### Defined in + +[@types/Asset.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L44) + +___ + +### name + +• **name**: `string` + +Name of NFT set in contract. + +#### Defined in + +[@types/Asset.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L14) + +___ + +### owner + +• **owner**: `string` + +ETH account address of the NFT owner. + +#### Defined in + +[@types/Asset.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L26) + +___ + +### state + +• **state**: ``0`` \| ``2`` \| ``1`` \| ``3`` \| ``4`` \| ``5`` + +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. +5 Unlisted in markets. + +#### Defined in + +[@types/Asset.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L38) + +___ + +### symbol + +• **symbol**: `string` + +Symbol of NFT set in contract. + +#### Defined in + +[@types/Asset.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L20) + +___ + +### tokenURI + +• **tokenURI**: `string` + +NFT token URI. + +#### Defined in + +[@types/Asset.ts:50](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L50) diff --git a/docs/interfaces/AssetPrice.md b/docs/interfaces/AssetPrice.md new file mode 100644 index 00000000..1f34e35b --- /dev/null +++ b/docs/interfaces/AssetPrice.md @@ -0,0 +1,47 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / AssetPrice + +# Interface: AssetPrice + +## Table of contents + +### Properties + +- [tokenAddress](AssetPrice.md#tokenaddress) +- [tokenSymbol](AssetPrice.md#tokensymbol) +- [value](AssetPrice.md#value) + +## Properties + +### tokenAddress + +• `Optional` **tokenAddress**: `string` + +The address of the token that the price needs to be paid in. + +#### Defined in + +[@types/Asset.ts:110](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L110) + +___ + +### tokenSymbol + +• `Optional` **tokenSymbol**: `string` + +The symbol that the price of the asset is expressed in. + +#### Defined in + +[@types/Asset.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L104) + +___ + +### value + +• **value**: `number` + +The price of the asset expressed as a number. If 0 then the price is FREE. + +#### Defined in + +[@types/Asset.ts:98](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L98) diff --git a/docs/interfaces/ComputeAlgorithm.md b/docs/interfaces/ComputeAlgorithm.md new file mode 100644 index 00000000..5a77505d --- /dev/null +++ b/docs/interfaces/ComputeAlgorithm.md @@ -0,0 +1,82 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeAlgorithm + +# Interface: ComputeAlgorithm + +## Table of contents + +### Properties + +- [algocustomdata](ComputeAlgorithm.md#algocustomdata) +- [documentId](ComputeAlgorithm.md#documentid) +- [meta](ComputeAlgorithm.md#meta) +- [serviceId](ComputeAlgorithm.md#serviceid) +- [transferTxId](ComputeAlgorithm.md#transfertxid) +- [userdata](ComputeAlgorithm.md#userdata) + +## Properties + +### algocustomdata + +• `Optional` **algocustomdata**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Defined in + +[@types/Compute.ts:74](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L74) + +___ + +### documentId + +• `Optional` **documentId**: `string` + +#### Defined in + +[@types/Compute.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L70) + +___ + +### meta + +• `Optional` **meta**: [`MetadataAlgorithm`](MetadataAlgorithm.md) + +#### Defined in + +[@types/Compute.ts:72](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L72) + +___ + +### serviceId + +• `Optional` **serviceId**: `string` + +#### Defined in + +[@types/Compute.ts:71](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L71) + +___ + +### transferTxId + +• `Optional` **transferTxId**: `string` + +#### Defined in + +[@types/Compute.ts:73](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L73) + +___ + +### userdata + +• `Optional` **userdata**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Defined in + +[@types/Compute.ts:75](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L75) diff --git a/docs/interfaces/ComputeAsset.md b/docs/interfaces/ComputeAsset.md new file mode 100644 index 00000000..a231e2e2 --- /dev/null +++ b/docs/interfaces/ComputeAsset.md @@ -0,0 +1,56 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeAsset + +# Interface: ComputeAsset + +## Table of contents + +### Properties + +- [documentId](ComputeAsset.md#documentid) +- [serviceId](ComputeAsset.md#serviceid) +- [transferTxId](ComputeAsset.md#transfertxid) +- [userdata](ComputeAsset.md#userdata) + +## Properties + +### documentId + +• **documentId**: `string` + +#### Defined in + +[@types/Compute.ts:63](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L63) + +___ + +### serviceId + +• **serviceId**: `string` + +#### Defined in + +[@types/Compute.ts:64](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L64) + +___ + +### transferTxId + +• `Optional` **transferTxId**: `string` + +#### Defined in + +[@types/Compute.ts:65](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L65) + +___ + +### userdata + +• `Optional` **userdata**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Defined in + +[@types/Compute.ts:66](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L66) diff --git a/docs/interfaces/ComputeEnvironment.md b/docs/interfaces/ComputeEnvironment.md new file mode 100644 index 00000000..52997d03 --- /dev/null +++ b/docs/interfaces/ComputeEnvironment.md @@ -0,0 +1,173 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeEnvironment + +# Interface: ComputeEnvironment + +## Table of contents + +### Properties + +- [consumerAddress](ComputeEnvironment.md#consumeraddress) +- [cpuNumber](ComputeEnvironment.md#cpunumber) +- [cpuType](ComputeEnvironment.md#cputype) +- [currentJobs](ComputeEnvironment.md#currentjobs) +- [desc](ComputeEnvironment.md#desc) +- [diskGB](ComputeEnvironment.md#diskgb) +- [gpuNumber](ComputeEnvironment.md#gpunumber) +- [gpuType](ComputeEnvironment.md#gputype) +- [id](ComputeEnvironment.md#id) +- [lastSeen](ComputeEnvironment.md#lastseen) +- [maxJobDuration](ComputeEnvironment.md#maxjobduration) +- [maxJobs](ComputeEnvironment.md#maxjobs) +- [priceMin](ComputeEnvironment.md#pricemin) +- [ramGB](ComputeEnvironment.md#ramgb) +- [storageExpiry](ComputeEnvironment.md#storageexpiry) + +## Properties + +### consumerAddress + +• **consumerAddress**: `string` + +#### Defined in + +[@types/Compute.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L21) + +___ + +### cpuNumber + +• **cpuNumber**: `number` + +#### Defined in + +[@types/Compute.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L11) + +___ + +### cpuType + +• **cpuType**: `string` + +#### Defined in + +[@types/Compute.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L12) + +___ + +### currentJobs + +• **currentJobs**: `number` + +#### Defined in + +[@types/Compute.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L19) + +___ + +### desc + +• **desc**: `string` + +#### Defined in + +[@types/Compute.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L18) + +___ + +### diskGB + +• **diskGB**: `number` + +#### Defined in + +[@types/Compute.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L16) + +___ + +### gpuNumber + +• **gpuNumber**: `number` + +#### Defined in + +[@types/Compute.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L13) + +___ + +### gpuType + +• **gpuType**: `string` + +#### Defined in + +[@types/Compute.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L14) + +___ + +### id + +• **id**: `string` + +#### Defined in + +[@types/Compute.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L10) + +___ + +### lastSeen + +• **lastSeen**: `number` + +#### Defined in + +[@types/Compute.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L24) + +___ + +### maxJobDuration + +• **maxJobDuration**: `number` + +#### Defined in + +[@types/Compute.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L23) + +___ + +### maxJobs + +• **maxJobs**: `number` + +#### Defined in + +[@types/Compute.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L20) + +___ + +### priceMin + +• **priceMin**: `number` + +#### Defined in + +[@types/Compute.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L17) + +___ + +### ramGB + +• **ramGB**: `number` + +#### Defined in + +[@types/Compute.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L15) + +___ + +### storageExpiry + +• **storageExpiry**: `number` + +#### Defined in + +[@types/Compute.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L22) diff --git a/docs/interfaces/ComputeJob.md b/docs/interfaces/ComputeJob.md new file mode 100644 index 00000000..b2112e51 --- /dev/null +++ b/docs/interfaces/ComputeJob.md @@ -0,0 +1,140 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeJob + +# Interface: ComputeJob + +## Table of contents + +### Properties + +- [agreementId](ComputeJob.md#agreementid) +- [algoDID](ComputeJob.md#algodid) +- [dateCreated](ComputeJob.md#datecreated) +- [dateFinished](ComputeJob.md#datefinished) +- [did](ComputeJob.md#did) +- [expireTimestamp](ComputeJob.md#expiretimestamp) +- [inputDID](ComputeJob.md#inputdid) +- [jobId](ComputeJob.md#jobid) +- [owner](ComputeJob.md#owner) +- [results](ComputeJob.md#results) +- [status](ComputeJob.md#status) +- [statusText](ComputeJob.md#statustext) + +## Properties + +### agreementId + +• `Optional` **agreementId**: `string` + +#### Defined in + +[@types/Compute.ts:45](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L45) + +___ + +### algoDID + +• `Optional` **algoDID**: `string` + +#### Defined in + +[@types/Compute.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L44) + +___ + +### dateCreated + +• **dateCreated**: `string` + +#### Defined in + +[@types/Compute.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L38) + +___ + +### dateFinished + +• **dateFinished**: `string` + +#### Defined in + +[@types/Compute.ts:39](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L39) + +___ + +### did + +• `Optional` **did**: `string` + +#### Defined in + +[@types/Compute.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L36) + +___ + +### expireTimestamp + +• **expireTimestamp**: `number` + +#### Defined in + +[@types/Compute.ts:46](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L46) + +___ + +### inputDID + +• `Optional` **inputDID**: `string`[] + +#### Defined in + +[@types/Compute.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L43) + +___ + +### jobId + +• **jobId**: `string` + +#### Defined in + +[@types/Compute.ts:37](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L37) + +___ + +### owner + +• **owner**: `string` + +#### Defined in + +[@types/Compute.ts:35](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L35) + +___ + +### results + +• **results**: [`ComputeResult`](ComputeResult.md)[] + +#### Defined in + +[@types/Compute.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L42) + +___ + +### status + +• **status**: `number` + +#### Defined in + +[@types/Compute.ts:40](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L40) + +___ + +### statusText + +• **statusText**: `string` + +#### Defined in + +[@types/Compute.ts:41](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L41) diff --git a/docs/interfaces/ComputeOutput.md b/docs/interfaces/ComputeOutput.md new file mode 100644 index 00000000..eea06235 --- /dev/null +++ b/docs/interfaces/ComputeOutput.md @@ -0,0 +1,118 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeOutput + +# Interface: ComputeOutput + +## Table of contents + +### Properties + +- [metadata](ComputeOutput.md#metadata) +- [metadataUri](ComputeOutput.md#metadatauri) +- [nodeUri](ComputeOutput.md#nodeuri) +- [owner](ComputeOutput.md#owner) +- [providerAddress](ComputeOutput.md#provideraddress) +- [providerUri](ComputeOutput.md#provideruri) +- [publishAlgorithmLog](ComputeOutput.md#publishalgorithmlog) +- [publishOutput](ComputeOutput.md#publishoutput) +- [secretStoreUri](ComputeOutput.md#secretstoreuri) +- [whitelist](ComputeOutput.md#whitelist) + +## Properties + +### metadata + +• `Optional` **metadata**: [`Metadata`](Metadata.md) + +#### Defined in + +[@types/Compute.ts:54](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L54) + +___ + +### metadataUri + +• `Optional` **metadataUri**: `string` + +#### Defined in + +[@types/Compute.ts:55](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L55) + +___ + +### nodeUri + +• `Optional` **nodeUri**: `string` + +#### Defined in + +[@types/Compute.ts:56](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L56) + +___ + +### owner + +• `Optional` **owner**: `string` + +#### Defined in + +[@types/Compute.ts:57](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L57) + +___ + +### providerAddress + +• `Optional` **providerAddress**: `string` + +#### Defined in + +[@types/Compute.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L52) + +___ + +### providerUri + +• `Optional` **providerUri**: `string` + +#### Defined in + +[@types/Compute.ts:53](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L53) + +___ + +### publishAlgorithmLog + +• `Optional` **publishAlgorithmLog**: `boolean` + +#### Defined in + +[@types/Compute.ts:50](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L50) + +___ + +### publishOutput + +• `Optional` **publishOutput**: `boolean` + +#### Defined in + +[@types/Compute.ts:51](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L51) + +___ + +### secretStoreUri + +• `Optional` **secretStoreUri**: `string` + +#### Defined in + +[@types/Compute.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L58) + +___ + +### whitelist + +• `Optional` **whitelist**: `string`[] + +#### Defined in + +[@types/Compute.ts:59](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L59) diff --git a/docs/interfaces/ComputeResult.md b/docs/interfaces/ComputeResult.md new file mode 100644 index 00000000..a765bfaa --- /dev/null +++ b/docs/interfaces/ComputeResult.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeResult + +# Interface: ComputeResult + +## Table of contents + +### Properties + +- [filename](ComputeResult.md#filename) +- [filesize](ComputeResult.md#filesize) +- [index](ComputeResult.md#index) +- [type](ComputeResult.md#type) + +## Properties + +### filename + +• **filename**: `string` + +#### Defined in + +[@types/Compute.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L28) + +___ + +### filesize + +• **filesize**: `number` + +#### Defined in + +[@types/Compute.ts:29](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L29) + +___ + +### index + +• `Optional` **index**: `number` + +#### Defined in + +[@types/Compute.ts:31](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L31) + +___ + +### type + +• **type**: [`ComputeResultType`](../modules.md#computeresulttype) + +#### Defined in + +[@types/Compute.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L30) diff --git a/docs/interfaces/ConsumeMarketFee.md b/docs/interfaces/ConsumeMarketFee.md new file mode 100644 index 00000000..26e4d4ef --- /dev/null +++ b/docs/interfaces/ConsumeMarketFee.md @@ -0,0 +1,41 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ConsumeMarketFee + +# Interface: ConsumeMarketFee + +## Table of contents + +### Properties + +- [consumeMarketFeeAddress](ConsumeMarketFee.md#consumemarketfeeaddress) +- [consumeMarketFeeAmount](ConsumeMarketFee.md#consumemarketfeeamount) +- [consumeMarketFeeToken](ConsumeMarketFee.md#consumemarketfeetoken) + +## Properties + +### consumeMarketFeeAddress + +• **consumeMarketFeeAddress**: `string` + +#### Defined in + +[@types/Datatoken.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L16) + +___ + +### consumeMarketFeeAmount + +• **consumeMarketFeeAmount**: `string` + +#### Defined in + +[@types/Datatoken.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L18) + +___ + +### consumeMarketFeeToken + +• **consumeMarketFeeToken**: `string` + +#### Defined in + +[@types/Datatoken.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L17) diff --git a/docs/interfaces/Credential.md b/docs/interfaces/Credential.md new file mode 100644 index 00000000..339f7ee6 --- /dev/null +++ b/docs/interfaces/Credential.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Credential + +# Interface: Credential + +## Table of contents + +### Properties + +- [type](Credential.md#type) +- [values](Credential.md#values) + +## Properties + +### type + +• **type**: `string` + +#### Defined in + +[@types/DDO/Credentials.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Credentials.ts#L2) + +___ + +### values + +• **values**: `string`[] + +#### Defined in + +[@types/DDO/Credentials.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Credentials.ts#L3) diff --git a/docs/interfaces/Credentials.md b/docs/interfaces/Credentials.md new file mode 100644 index 00000000..b0dfe746 --- /dev/null +++ b/docs/interfaces/Credentials.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Credentials + +# Interface: Credentials + +## Table of contents + +### Properties + +- [allow](Credentials.md#allow) +- [deny](Credentials.md#deny) + +## Properties + +### allow + +• **allow**: [`Credential`](Credential.md)[] + +#### Defined in + +[@types/DDO/Credentials.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Credentials.ts#L7) + +___ + +### deny + +• **deny**: [`Credential`](Credential.md)[] + +#### Defined in + +[@types/DDO/Credentials.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Credentials.ts#L8) diff --git a/docs/interfaces/DDO.md b/docs/interfaces/DDO.md new file mode 100644 index 00000000..6785c206 --- /dev/null +++ b/docs/interfaces/DDO.md @@ -0,0 +1,137 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DDO + +# Interface: DDO + +DID Descriptor Object. +Contains metadata about the asset, and define access in at least one service. + +## Hierarchy + +- **`DDO`** + + ↳ [`Asset`](Asset.md) + +## Table of contents + +### Properties + +- [@context](DDO.md#@context) +- [chainId](DDO.md#chainid) +- [credentials](DDO.md#credentials) +- [event](DDO.md#event) +- [id](DDO.md#id) +- [metadata](DDO.md#metadata) +- [nftAddress](DDO.md#nftaddress) +- [services](DDO.md#services) +- [version](DDO.md#version) + +## Properties + +### @context + +• **@context**: `string`[] + +Contexts used for validation. + +#### Defined in + +[@types/DDO/DDO.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L12) + +___ + +### chainId + +• **chainId**: `number` + +ChainId of the network the DDO was published to. + +#### Defined in + +[@types/DDO/DDO.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L38) + +___ + +### credentials + +• `Optional` **credentials**: [`Credentials`](Credentials.md) + +Describes the credentials needed to access a dataset +in addition to the services definition. + +#### Defined in + +[@types/DDO/DDO.ts:57](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L57) + +___ + +### event + +• `Optional` **event**: [`Event`](Event.md) + +Describes the event of last metadata event + +#### Defined in + +[@types/DDO/DDO.ts:63](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L63) + +___ + +### id + +• **id**: `string` + +DID, descentralized ID. +Computed as sha256(address of NFT contract + chainId) + +#### Defined in + +[@types/DDO/DDO.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L19) + +___ + +### metadata + +• **metadata**: [`Metadata`](Metadata.md) + +Stores an object describing the asset. + +#### Defined in + +[@types/DDO/DDO.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L44) + +___ + +### nftAddress + +• **nftAddress**: `string` + +NFT contract address + +#### Defined in + +[@types/DDO/DDO.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L32) + +___ + +### services + +• **services**: [`Service`](Service.md)[] + +Stores an array of services defining access to the asset. + +#### Defined in + +[@types/DDO/DDO.ts:50](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L50) + +___ + +### version + +• **version**: `string` + +Version information in SemVer notation +referring to the DDO spec version + +#### Defined in + +[@types/DDO/DDO.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/DDO.ts#L26) diff --git a/docs/interfaces/DatatokenCreateParams.md b/docs/interfaces/DatatokenCreateParams.md new file mode 100644 index 00000000..0717b35d --- /dev/null +++ b/docs/interfaces/DatatokenCreateParams.md @@ -0,0 +1,107 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DatatokenCreateParams + +# Interface: DatatokenCreateParams + +## Table of contents + +### Properties + +- [cap](DatatokenCreateParams.md#cap) +- [feeAmount](DatatokenCreateParams.md#feeamount) +- [feeToken](DatatokenCreateParams.md#feetoken) +- [minter](DatatokenCreateParams.md#minter) +- [mpFeeAddress](DatatokenCreateParams.md#mpfeeaddress) +- [name](DatatokenCreateParams.md#name) +- [paymentCollector](DatatokenCreateParams.md#paymentcollector) +- [symbol](DatatokenCreateParams.md#symbol) +- [templateIndex](DatatokenCreateParams.md#templateindex) + +## Properties + +### cap + +• **cap**: `string` + +#### Defined in + +[@types/Datatoken.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L10) + +___ + +### feeAmount + +• **feeAmount**: `string` + +#### Defined in + +[@types/Datatoken.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L9) + +___ + +### feeToken + +• **feeToken**: `string` + +#### Defined in + +[@types/Datatoken.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L8) + +___ + +### minter + +• **minter**: `string` + +#### Defined in + +[@types/Datatoken.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L5) + +___ + +### mpFeeAddress + +• **mpFeeAddress**: `string` + +#### Defined in + +[@types/Datatoken.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L7) + +___ + +### name + +• `Optional` **name**: `string` + +#### Defined in + +[@types/Datatoken.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L11) + +___ + +### paymentCollector + +• **paymentCollector**: `string` + +#### Defined in + +[@types/Datatoken.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L6) + +___ + +### symbol + +• `Optional` **symbol**: `string` + +#### Defined in + +[@types/Datatoken.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L12) + +___ + +### templateIndex + +• **templateIndex**: `number` + +#### Defined in + +[@types/Datatoken.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L4) diff --git a/docs/interfaces/DatatokenRoles.md b/docs/interfaces/DatatokenRoles.md new file mode 100644 index 00000000..3845be29 --- /dev/null +++ b/docs/interfaces/DatatokenRoles.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DatatokenRoles + +# Interface: DatatokenRoles + +## Table of contents + +### Properties + +- [minter](DatatokenRoles.md#minter) +- [paymentManager](DatatokenRoles.md#paymentmanager) + +## Properties + +### minter + +• **minter**: `boolean` + +#### Defined in + +[@types/Datatoken.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L28) + +___ + +### paymentManager + +• **paymentManager**: `boolean` + +#### Defined in + +[@types/Datatoken.ts:29](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L29) diff --git a/docs/interfaces/DispenserCreationParams.md b/docs/interfaces/DispenserCreationParams.md new file mode 100644 index 00000000..a98fedfc --- /dev/null +++ b/docs/interfaces/DispenserCreationParams.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DispenserCreationParams + +# Interface: DispenserCreationParams + +## Table of contents + +### Properties + +- [allowedSwapper](DispenserCreationParams.md#allowedswapper) +- [dispenserAddress](DispenserCreationParams.md#dispenseraddress) +- [maxBalance](DispenserCreationParams.md#maxbalance) +- [maxTokens](DispenserCreationParams.md#maxtokens) +- [withMint](DispenserCreationParams.md#withmint) + +## Properties + +### allowedSwapper + +• `Optional` **allowedSwapper**: `string` + +#### Defined in + +[@types/Dispenser.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L6) + +___ + +### dispenserAddress + +• **dispenserAddress**: `string` + +#### Defined in + +[@types/Dispenser.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L2) + +___ + +### maxBalance + +• **maxBalance**: `string` + +#### Defined in + +[@types/Dispenser.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L4) + +___ + +### maxTokens + +• **maxTokens**: `string` + +#### Defined in + +[@types/Dispenser.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L3) + +___ + +### withMint + +• `Optional` **withMint**: `boolean` + +#### Defined in + +[@types/Dispenser.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L5) diff --git a/docs/interfaces/DispenserParams.md b/docs/interfaces/DispenserParams.md new file mode 100644 index 00000000..1e9ba0af --- /dev/null +++ b/docs/interfaces/DispenserParams.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DispenserParams + +# Interface: DispenserParams + +## Table of contents + +### Properties + +- [allowedSwapper](DispenserParams.md#allowedswapper) +- [maxBalance](DispenserParams.md#maxbalance) +- [maxTokens](DispenserParams.md#maxtokens) +- [withMint](DispenserParams.md#withmint) + +## Properties + +### allowedSwapper + +• `Optional` **allowedSwapper**: `string` + +#### Defined in + +[@types/Datatoken.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L43) + +___ + +### maxBalance + +• **maxBalance**: `string` + +#### Defined in + +[@types/Datatoken.ts:41](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L41) + +___ + +### maxTokens + +• **maxTokens**: `string` + +#### Defined in + +[@types/Datatoken.ts:40](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L40) + +___ + +### withMint + +• `Optional` **withMint**: `boolean` + +#### Defined in + +[@types/Datatoken.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L42) diff --git a/docs/interfaces/DispenserToken.md b/docs/interfaces/DispenserToken.md new file mode 100644 index 00000000..19500c9f --- /dev/null +++ b/docs/interfaces/DispenserToken.md @@ -0,0 +1,85 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DispenserToken + +# Interface: DispenserToken + +## Table of contents + +### Properties + +- [active](DispenserToken.md#active) +- [allowedSwapper](DispenserToken.md#allowedswapper) +- [balance](DispenserToken.md#balance) +- [isMinter](DispenserToken.md#isminter) +- [maxBalance](DispenserToken.md#maxbalance) +- [maxTokens](DispenserToken.md#maxtokens) +- [owner](DispenserToken.md#owner) + +## Properties + +### active + +• **active**: `boolean` + +#### Defined in + +[@types/Dispenser.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L10) + +___ + +### allowedSwapper + +• **allowedSwapper**: `string` + +#### Defined in + +[@types/Dispenser.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L16) + +___ + +### balance + +• **balance**: `string` + +#### Defined in + +[@types/Dispenser.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L14) + +___ + +### isMinter + +• **isMinter**: `boolean` + +#### Defined in + +[@types/Dispenser.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L15) + +___ + +### maxBalance + +• **maxBalance**: `string` + +#### Defined in + +[@types/Dispenser.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L13) + +___ + +### maxTokens + +• **maxTokens**: `string` + +#### Defined in + +[@types/Dispenser.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L12) + +___ + +### owner + +• **owner**: `string` + +#### Defined in + +[@types/Dispenser.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Dispenser.ts#L11) diff --git a/docs/interfaces/DownloadResponse.md b/docs/interfaces/DownloadResponse.md new file mode 100644 index 00000000..61afc6e2 --- /dev/null +++ b/docs/interfaces/DownloadResponse.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / DownloadResponse + +# Interface: DownloadResponse + +## Table of contents + +### Properties + +- [data](DownloadResponse.md#data) +- [filename](DownloadResponse.md#filename) + +## Properties + +### data + +• **data**: `ArrayBuffer` + +#### Defined in + +[@types/DownloadResponse.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DownloadResponse.ts#L2) + +___ + +### filename + +• **filename**: `string` + +#### Defined in + +[@types/DownloadResponse.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DownloadResponse.ts#L3) diff --git a/docs/interfaces/Event.md b/docs/interfaces/Event.md new file mode 100644 index 00000000..01e7116b --- /dev/null +++ b/docs/interfaces/Event.md @@ -0,0 +1,73 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Event + +# Interface: Event + +## Table of contents + +### Properties + +- [block](Event.md#block) +- [contract](Event.md#contract) +- [datetime](Event.md#datetime) +- [from](Event.md#from) +- [txid](Event.md#txid) + +## Properties + +### block + +• `Optional` **block**: `number` + +Block of txid + +#### Defined in + +[@types/DDO/Event.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Event.ts#L12) + +___ + +### contract + +• `Optional` **contract**: `string` + +Contract + +#### Defined in + +[@types/DDO/Event.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Event.ts#L24) + +___ + +### datetime + +• `Optional` **datetime**: `string` + +datetime of tx + +#### Defined in + +[@types/DDO/Event.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Event.ts#L30) + +___ + +### from + +• `Optional` **from**: `string` + +Sender of tx + +#### Defined in + +[@types/DDO/Event.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Event.ts#L18) + +___ + +### txid + +• `Optional` **txid**: `string` + +TX id of the last create/update + +#### Defined in + +[@types/DDO/Event.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Event.ts#L6) diff --git a/docs/interfaces/FeesInfo.md b/docs/interfaces/FeesInfo.md new file mode 100644 index 00000000..b14fc5d8 --- /dev/null +++ b/docs/interfaces/FeesInfo.md @@ -0,0 +1,74 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FeesInfo + +# Interface: FeesInfo + +## Table of contents + +### Properties + +- [exchangeId](FeesInfo.md#exchangeid) +- [marketFee](FeesInfo.md#marketfee) +- [marketFeeAvailable](FeesInfo.md#marketfeeavailable) +- [marketFeeCollector](FeesInfo.md#marketfeecollector) +- [oceanFeeAvailable](FeesInfo.md#oceanfeeavailable) +- [opcFee](FeesInfo.md#opcfee) + +## Properties + +### exchangeId + +• **exchangeId**: `string` + +#### Defined in + +[@types/FixedPrice.ts:54](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L54) + +___ + +### marketFee + +• **marketFee**: `string` + +#### Defined in + +[@types/FixedPrice.ts:50](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L50) + +___ + +### marketFeeAvailable + +• **marketFeeAvailable**: `string` + +#### Defined in + +[@types/FixedPrice.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L52) + +___ + +### marketFeeCollector + +• **marketFeeCollector**: `string` + +#### Defined in + +[@types/FixedPrice.ts:51](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L51) + +___ + +### oceanFeeAvailable + +• **oceanFeeAvailable**: `string` + +#### Defined in + +[@types/FixedPrice.ts:53](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L53) + +___ + +### opcFee + +• **opcFee**: `string` + +#### Defined in + +[@types/FixedPrice.ts:49](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L49) diff --git a/docs/interfaces/FileInfo.md b/docs/interfaces/FileInfo.md new file mode 100644 index 00000000..e7f8a3a7 --- /dev/null +++ b/docs/interfaces/FileInfo.md @@ -0,0 +1,118 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FileInfo + +# Interface: FileInfo + +## Table of contents + +### Properties + +- [checksum](FileInfo.md#checksum) +- [contentLength](FileInfo.md#contentlength) +- [contentType](FileInfo.md#contenttype) +- [index](FileInfo.md#index) +- [method](FileInfo.md#method) +- [type](FileInfo.md#type) +- [url](FileInfo.md#url) +- [valid](FileInfo.md#valid) + +## Properties + +### checksum + +• `Optional` **checksum**: `string` + +Computed file checksum + +#### Defined in + +[@types/FileInfo.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L43) + +___ + +### contentLength + +• `Optional` **contentLength**: `string` + +File content length. + +#### Defined in + +[@types/FileInfo.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L19) + +___ + +### contentType + +• `Optional` **contentType**: `string` + +File format, if applicable. + +**`Example`** + +```ts +"text/csv" +``` + +#### Defined in + +[@types/FileInfo.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L13) + +___ + +### index + +• `Optional` **index**: `number` + +File index. + +#### Defined in + +[@types/FileInfo.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L25) + +___ + +### method + +• `Optional` **method**: `string` + +HTTP method used + +#### Defined in + +[@types/FileInfo.ts:37](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L37) + +___ + +### type + +• **type**: `string` + +File URL. + +#### Defined in + +[@types/FileInfo.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L6) + +___ + +### url + +• `Optional` **url**: `string` + +File URL. + +#### Defined in + +[@types/FileInfo.ts:31](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L31) + +___ + +### valid + +• `Optional` **valid**: `boolean` + +check if file exists + +#### Defined in + +[@types/FileInfo.ts:49](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FileInfo.ts#L49) diff --git a/docs/interfaces/Files.md b/docs/interfaces/Files.md new file mode 100644 index 00000000..202b1a32 --- /dev/null +++ b/docs/interfaces/Files.md @@ -0,0 +1,41 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Files + +# Interface: Files + +## Table of contents + +### Properties + +- [datatokenAddress](Files.md#datatokenaddress) +- [files](Files.md#files) +- [nftAddress](Files.md#nftaddress) + +## Properties + +### datatokenAddress + +• **datatokenAddress**: `string` + +#### Defined in + +[@types/File.ts:105](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L105) + +___ + +### files + +• **files**: [`UrlFile`](UrlFile.md)[] \| [`GraphqlQuery`](GraphqlQuery.md)[] \| [`Arweave`](Arweave.md)[] \| [`Smartcontract`](Smartcontract-1.md)[] \| [`Ipfs`](Ipfs.md)[] + +#### Defined in + +[@types/File.ts:106](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L106) + +___ + +### nftAddress + +• **nftAddress**: `string` + +#### Defined in + +[@types/File.ts:104](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L104) diff --git a/docs/interfaces/FixedPriceExchange.md b/docs/interfaces/FixedPriceExchange.md new file mode 100644 index 00000000..514d17ed --- /dev/null +++ b/docs/interfaces/FixedPriceExchange.md @@ -0,0 +1,162 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FixedPriceExchange + +# Interface: FixedPriceExchange + +## Table of contents + +### Properties + +- [active](FixedPriceExchange.md#active) +- [allowedSwapper](FixedPriceExchange.md#allowedswapper) +- [baseToken](FixedPriceExchange.md#basetoken) +- [btBalance](FixedPriceExchange.md#btbalance) +- [btDecimals](FixedPriceExchange.md#btdecimals) +- [btSupply](FixedPriceExchange.md#btsupply) +- [datatoken](FixedPriceExchange.md#datatoken) +- [dtBalance](FixedPriceExchange.md#dtbalance) +- [dtDecimals](FixedPriceExchange.md#dtdecimals) +- [dtSupply](FixedPriceExchange.md#dtsupply) +- [exchangeId](FixedPriceExchange.md#exchangeid) +- [exchangeOwner](FixedPriceExchange.md#exchangeowner) +- [fixedRate](FixedPriceExchange.md#fixedrate) +- [withMint](FixedPriceExchange.md#withmint) + +## Properties + +### active + +• **active**: `boolean` + +#### Defined in + +[@types/FixedPrice.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L32) + +___ + +### allowedSwapper + +• **allowedSwapper**: `string` + +#### Defined in + +[@types/FixedPrice.ts:44](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L44) + +___ + +### baseToken + +• **baseToken**: `string` + +#### Defined in + +[@types/FixedPrice.ts:35](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L35) + +___ + +### btBalance + +• **btBalance**: `string` + +#### Defined in + +[@types/FixedPrice.ts:40](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L40) + +___ + +### btDecimals + +• **btDecimals**: `string` + +#### Defined in + +[@types/FixedPrice.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L38) + +___ + +### btSupply + +• **btSupply**: `string` + +#### Defined in + +[@types/FixedPrice.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L42) + +___ + +### datatoken + +• **datatoken**: `string` + +#### Defined in + +[@types/FixedPrice.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L34) + +___ + +### dtBalance + +• **dtBalance**: `string` + +#### Defined in + +[@types/FixedPrice.ts:39](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L39) + +___ + +### dtDecimals + +• **dtDecimals**: `string` + +#### Defined in + +[@types/FixedPrice.ts:37](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L37) + +___ + +### dtSupply + +• **dtSupply**: `string` + +#### Defined in + +[@types/FixedPrice.ts:41](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L41) + +___ + +### exchangeId + +• `Optional` **exchangeId**: `string` + +#### Defined in + +[@types/FixedPrice.ts:45](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L45) + +___ + +### exchangeOwner + +• **exchangeOwner**: `string` + +#### Defined in + +[@types/FixedPrice.ts:33](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L33) + +___ + +### fixedRate + +• **fixedRate**: `string` + +#### Defined in + +[@types/FixedPrice.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L36) + +___ + +### withMint + +• **withMint**: `boolean` + +#### Defined in + +[@types/FixedPrice.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L43) diff --git a/docs/interfaces/FreCreationParams.md b/docs/interfaces/FreCreationParams.md new file mode 100644 index 00000000..f31e6db9 --- /dev/null +++ b/docs/interfaces/FreCreationParams.md @@ -0,0 +1,118 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FreCreationParams + +# Interface: FreCreationParams + +## Table of contents + +### Properties + +- [allowedConsumer](FreCreationParams.md#allowedconsumer) +- [baseTokenAddress](FreCreationParams.md#basetokenaddress) +- [baseTokenDecimals](FreCreationParams.md#basetokendecimals) +- [datatokenDecimals](FreCreationParams.md#datatokendecimals) +- [fixedRate](FreCreationParams.md#fixedrate) +- [fixedRateAddress](FreCreationParams.md#fixedrateaddress) +- [marketFee](FreCreationParams.md#marketfee) +- [marketFeeCollector](FreCreationParams.md#marketfeecollector) +- [owner](FreCreationParams.md#owner) +- [withMint](FreCreationParams.md#withmint) + +## Properties + +### allowedConsumer + +• `Optional` **allowedConsumer**: `string` + +#### Defined in + +[@types/FixedPrice.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L11) + +___ + +### baseTokenAddress + +• **baseTokenAddress**: `string` + +#### Defined in + +[@types/FixedPrice.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L3) + +___ + +### baseTokenDecimals + +• **baseTokenDecimals**: `number` + +#### Defined in + +[@types/FixedPrice.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L6) + +___ + +### datatokenDecimals + +• **datatokenDecimals**: `number` + +#### Defined in + +[@types/FixedPrice.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L7) + +___ + +### fixedRate + +• **fixedRate**: `string` + +#### Defined in + +[@types/FixedPrice.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L8) + +___ + +### fixedRateAddress + +• **fixedRateAddress**: `string` + +#### Defined in + +[@types/FixedPrice.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L2) + +___ + +### marketFee + +• **marketFee**: `string` + +#### Defined in + +[@types/FixedPrice.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L9) + +___ + +### marketFeeCollector + +• **marketFeeCollector**: `string` + +#### Defined in + +[@types/FixedPrice.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L5) + +___ + +### owner + +• **owner**: `string` + +#### Defined in + +[@types/FixedPrice.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L4) + +___ + +### withMint + +• `Optional` **withMint**: `boolean` + +#### Defined in + +[@types/FixedPrice.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L10) diff --git a/docs/interfaces/FreOrderParams.md b/docs/interfaces/FreOrderParams.md new file mode 100644 index 00000000..cbc76d94 --- /dev/null +++ b/docs/interfaces/FreOrderParams.md @@ -0,0 +1,85 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / FreOrderParams + +# Interface: FreOrderParams + +## Table of contents + +### Properties + +- [baseTokenAddress](FreOrderParams.md#basetokenaddress) +- [baseTokenDecimals](FreOrderParams.md#basetokendecimals) +- [exchangeContract](FreOrderParams.md#exchangecontract) +- [exchangeId](FreOrderParams.md#exchangeid) +- [marketFeeAddress](FreOrderParams.md#marketfeeaddress) +- [maxBaseTokenAmount](FreOrderParams.md#maxbasetokenamount) +- [swapMarketFee](FreOrderParams.md#swapmarketfee) + +## Properties + +### baseTokenAddress + +• **baseTokenAddress**: `string` + +#### Defined in + +[@types/FixedPrice.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L18) + +___ + +### baseTokenDecimals + +• `Optional` **baseTokenDecimals**: `number` + +#### Defined in + +[@types/FixedPrice.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L19) + +___ + +### exchangeContract + +• **exchangeContract**: `string` + +#### Defined in + +[@types/FixedPrice.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L15) + +___ + +### exchangeId + +• **exchangeId**: `string` + +#### Defined in + +[@types/FixedPrice.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L16) + +___ + +### marketFeeAddress + +• **marketFeeAddress**: `string` + +#### Defined in + +[@types/FixedPrice.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L21) + +___ + +### maxBaseTokenAmount + +• **maxBaseTokenAmount**: `string` + +#### Defined in + +[@types/FixedPrice.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L17) + +___ + +### swapMarketFee + +• **swapMarketFee**: `string` + +#### Defined in + +[@types/FixedPrice.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L20) diff --git a/docs/interfaces/GraphqlQuery.md b/docs/interfaces/GraphqlQuery.md new file mode 100644 index 00000000..da2555bc --- /dev/null +++ b/docs/interfaces/GraphqlQuery.md @@ -0,0 +1,69 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / GraphqlQuery + +# Interface: GraphqlQuery + +## Table of contents + +### Properties + +- [headers](GraphqlQuery.md#headers) +- [index](GraphqlQuery.md#index) +- [query](GraphqlQuery.md#query) +- [type](GraphqlQuery.md#type) +- [url](GraphqlQuery.md#url) + +## Properties + +### headers + +• `Optional` **headers**: `FileTypeHeaders` + +Headers key value pairs associated with the asset GET request + +#### Defined in + +[@types/File.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L58) + +___ + +### index + +• `Optional` **index**: `number` + +#### Defined in + +[@types/File.ts:40](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L40) + +___ + +### query + +• **query**: `string` + +query + +#### Defined in + +[@types/File.ts:52](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L52) + +___ + +### type + +• **type**: ``"graphql"`` + +#### Defined in + +[@types/File.ts:35](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L35) + +___ + +### url + +• **url**: `string` + +Endpoint URL + +#### Defined in + +[@types/File.ts:46](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L46) diff --git a/docs/interfaces/Ipfs.md b/docs/interfaces/Ipfs.md new file mode 100644 index 00000000..9fd6950a --- /dev/null +++ b/docs/interfaces/Ipfs.md @@ -0,0 +1,32 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Ipfs + +# Interface: Ipfs + +## Table of contents + +### Properties + +- [hash](Ipfs.md#hash) +- [type](Ipfs.md#type) + +## Properties + +### hash + +• **hash**: `string` + +hash + +#### Defined in + +[@types/File.ts:78](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L78) + +___ + +### type + +• **type**: ``"ipfs"`` + +#### Defined in + +[@types/File.ts:72](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L72) diff --git a/docs/interfaces/Metadata.md b/docs/interfaces/Metadata.md new file mode 100644 index 00000000..231ada35 --- /dev/null +++ b/docs/interfaces/Metadata.md @@ -0,0 +1,193 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Metadata + +# Interface: Metadata + +## Table of contents + +### Properties + +- [additionalInformation](Metadata.md#additionalinformation) +- [algorithm](Metadata.md#algorithm) +- [author](Metadata.md#author) +- [categories](Metadata.md#categories) +- [contentLanguage](Metadata.md#contentlanguage) +- [copyrightHolder](Metadata.md#copyrightholder) +- [created](Metadata.md#created) +- [description](Metadata.md#description) +- [license](Metadata.md#license) +- [links](Metadata.md#links) +- [name](Metadata.md#name) +- [tags](Metadata.md#tags) +- [type](Metadata.md#type) +- [updated](Metadata.md#updated) + +## Properties + +### additionalInformation + +• `Optional` **additionalInformation**: `any` + +Stores additional information, this is customizable by publisher + +#### Defined in + +[@types/DDO/Metadata.ts:137](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L137) + +___ + +### algorithm + +• `Optional` **algorithm**: [`MetadataAlgorithm`](MetadataAlgorithm.md) + +Information about asset of type algorithm. Required for algorithm assets. + +#### Defined in + +[@types/DDO/Metadata.ts:131](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L131) + +___ + +### author + +• **author**: `string` + +Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.). + +#### Defined in + +[@types/DDO/Metadata.ts:87](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L87) + +___ + +### categories + +• `Optional` **categories**: `string`[] + +Array of categories associated to the asset. Note: recommended to use tags instead of this. + +#### Defined in + +[@types/DDO/Metadata.ts:113](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L113) + +___ + +### contentLanguage + +• `Optional` **contentLanguage**: `string` + +The language of the content. Use one of the language codes from the IETF BCP 47 standard + +#### Defined in + +[@types/DDO/Metadata.ts:125](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L125) + +___ + +### copyrightHolder + +• `Optional` **copyrightHolder**: `string` + +The party holding the legal copyright. Empty by default. + +#### Defined in + +[@types/DDO/Metadata.ts:119](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L119) + +___ + +### created + +• **created**: `string` + +Contains the date of publishing in ISO Date Time + +#### Defined in + +[@types/DDO/Metadata.ts:56](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L56) + +___ + +### description + +• **description**: `string` + +Details of what the resource is. + +#### Defined in + +[@types/DDO/Metadata.ts:74](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L74) + +___ + +### license + +• **license**: `string` + +Short name referencing the license of the asset. +If it’s not specified, the following value will be added: “No License Specified”. + +#### Defined in + +[@types/DDO/Metadata.ts:94](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L94) + +___ + +### links + +• `Optional` **links**: `string`[] + +Mapping of URL strings for data samples, or links to find out more information. +Links may be to either a URL or another asset. + +#### Defined in + +[@types/DDO/Metadata.ts:101](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L101) + +___ + +### name + +• **name**: `string` + +Descriptive name or title of the asset. + +#### Defined in + +[@types/DDO/Metadata.ts:68](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L68) + +___ + +### tags + +• `Optional` **tags**: `string`[] + +Array of keywords or tags used to describe this content. Empty by default. + +#### Defined in + +[@types/DDO/Metadata.ts:107](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L107) + +___ + +### type + +• **type**: ``"dataset"`` \| ``"algorithm"`` + +Asset type. Includes "dataset" (e.g. csv file), "algorithm" (e.g. Python script). +Each type needs a different subset of metadata attributes. + +#### Defined in + +[@types/DDO/Metadata.ts:81](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L81) + +___ + +### updated + +• **updated**: `string` + +Contains the the date of last update in ISO Date Time + +#### Defined in + +[@types/DDO/Metadata.ts:62](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L62) diff --git a/docs/interfaces/MetadataAlgorithm.md b/docs/interfaces/MetadataAlgorithm.md new file mode 100644 index 00000000..6c1b32cb --- /dev/null +++ b/docs/interfaces/MetadataAlgorithm.md @@ -0,0 +1,69 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / MetadataAlgorithm + +# Interface: MetadataAlgorithm + +## Table of contents + +### Properties + +- [container](MetadataAlgorithm.md#container) +- [language](MetadataAlgorithm.md#language) +- [rawcode](MetadataAlgorithm.md#rawcode) +- [version](MetadataAlgorithm.md#version) + +## Properties + +### container + +• **container**: `Object` + +Object describing the Docker container image. + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `checksum` | `string` | Checksum of the Docker image. | +| `entrypoint` | `string` | The command to execute, or script to run inside the Docker image. | +| `image` | `string` | Name of the Docker image. | +| `tag` | `string` | Tag of the Docker image. | + +#### Defined in + +[@types/DDO/Metadata.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L24) + +___ + +### language + +• `Optional` **language**: `string` + +Programming language used to implement the software. + +#### Defined in + +[@types/DDO/Metadata.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L6) + +___ + +### rawcode + +• `Optional` **rawcode**: `string` + +Rawcode + +#### Defined in + +[@types/DDO/Metadata.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L18) + +___ + +### version + +• `Optional` **version**: `string` + +Version of the software preferably in SemVer notation. + +#### Defined in + +[@types/DDO/Metadata.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L12) diff --git a/docs/interfaces/MetadataAndTokenURI.md b/docs/interfaces/MetadataAndTokenURI.md new file mode 100644 index 00000000..21d80403 --- /dev/null +++ b/docs/interfaces/MetadataAndTokenURI.md @@ -0,0 +1,107 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / MetadataAndTokenURI + +# Interface: MetadataAndTokenURI + +## Table of contents + +### Properties + +- [data](MetadataAndTokenURI.md#data) +- [flags](MetadataAndTokenURI.md#flags) +- [metaDataDecryptorAddress](MetadataAndTokenURI.md#metadatadecryptoraddress) +- [metaDataDecryptorUrl](MetadataAndTokenURI.md#metadatadecryptorurl) +- [metaDataHash](MetadataAndTokenURI.md#metadatahash) +- [metaDataState](MetadataAndTokenURI.md#metadatastate) +- [metadataProofs](MetadataAndTokenURI.md#metadataproofs) +- [tokenId](MetadataAndTokenURI.md#tokenid) +- [tokenURI](MetadataAndTokenURI.md#tokenuri) + +## Properties + +### data + +• **data**: `string` + +#### Defined in + +[@types/NFT.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L8) + +___ + +### flags + +• **flags**: `string` + +#### Defined in + +[@types/NFT.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L7) + +___ + +### metaDataDecryptorAddress + +• **metaDataDecryptorAddress**: `string` + +#### Defined in + +[@types/NFT.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L6) + +___ + +### metaDataDecryptorUrl + +• **metaDataDecryptorUrl**: `string` + +#### Defined in + +[@types/NFT.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L5) + +___ + +### metaDataHash + +• **metaDataHash**: `string` + +#### Defined in + +[@types/NFT.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L9) + +___ + +### metaDataState + +• **metaDataState**: `number` + +#### Defined in + +[@types/NFT.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L4) + +___ + +### metadataProofs + +• `Optional` **metadataProofs**: [`MetadataProof`](MetadataProof.md)[] + +#### Defined in + +[@types/NFT.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L12) + +___ + +### tokenId + +• **tokenId**: `number` + +#### Defined in + +[@types/NFT.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L10) + +___ + +### tokenURI + +• **tokenURI**: `string` + +#### Defined in + +[@types/NFT.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L11) diff --git a/docs/interfaces/MetadataProof.md b/docs/interfaces/MetadataProof.md new file mode 100644 index 00000000..3f186790 --- /dev/null +++ b/docs/interfaces/MetadataProof.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / MetadataProof + +# Interface: MetadataProof + +## Table of contents + +### Properties + +- [r](MetadataProof.md#r) +- [s](MetadataProof.md#s) +- [v](MetadataProof.md#v) +- [validatorAddress](MetadataProof.md#validatoraddress) + +## Properties + +### r + +• `Optional` **r**: `string` + +#### Defined in + +[@types/DDO/Metadata.ts:142](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L142) + +___ + +### s + +• `Optional` **s**: `string` + +#### Defined in + +[@types/DDO/Metadata.ts:143](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L143) + +___ + +### v + +• `Optional` **v**: `number` + +#### Defined in + +[@types/DDO/Metadata.ts:144](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L144) + +___ + +### validatorAddress + +• `Optional` **validatorAddress**: `string` + +#### Defined in + +[@types/DDO/Metadata.ts:141](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L141) diff --git a/docs/interfaces/NftCreateData.md b/docs/interfaces/NftCreateData.md new file mode 100644 index 00000000..4cd0bfdc --- /dev/null +++ b/docs/interfaces/NftCreateData.md @@ -0,0 +1,74 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / NftCreateData + +# Interface: NftCreateData + +## Table of contents + +### Properties + +- [name](NftCreateData.md#name) +- [owner](NftCreateData.md#owner) +- [symbol](NftCreateData.md#symbol) +- [templateIndex](NftCreateData.md#templateindex) +- [tokenURI](NftCreateData.md#tokenuri) +- [transferable](NftCreateData.md#transferable) + +## Properties + +### name + +• **name**: `string` + +#### Defined in + +[@types/NFTFactory.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L17) + +___ + +### owner + +• **owner**: `string` + +#### Defined in + +[@types/NFTFactory.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L22) + +___ + +### symbol + +• **symbol**: `string` + +#### Defined in + +[@types/NFTFactory.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L18) + +___ + +### templateIndex + +• **templateIndex**: `number` + +#### Defined in + +[@types/NFTFactory.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L19) + +___ + +### tokenURI + +• **tokenURI**: `string` + +#### Defined in + +[@types/NFTFactory.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L20) + +___ + +### transferable + +• **transferable**: `boolean` + +#### Defined in + +[@types/NFTFactory.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L21) diff --git a/docs/interfaces/NftRoles.md b/docs/interfaces/NftRoles.md new file mode 100644 index 00000000..83f194a8 --- /dev/null +++ b/docs/interfaces/NftRoles.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / NftRoles + +# Interface: NftRoles + +## Table of contents + +### Properties + +- [deployERC20](NftRoles.md#deployerc20) +- [manager](NftRoles.md#manager) +- [store](NftRoles.md#store) +- [updateMetadata](NftRoles.md#updatemetadata) + +## Properties + +### deployERC20 + +• **deployERC20**: `boolean` + +#### Defined in + +[@types/NFT.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L17) + +___ + +### manager + +• **manager**: `boolean` + +#### Defined in + +[@types/NFT.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L16) + +___ + +### store + +• **store**: `boolean` + +#### Defined in + +[@types/NFT.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L19) + +___ + +### updateMetadata + +• **updateMetadata**: `boolean` + +#### Defined in + +[@types/NFT.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFT.ts#L18) diff --git a/docs/interfaces/Operation.md b/docs/interfaces/Operation.md new file mode 100644 index 00000000..b5f1788c --- /dev/null +++ b/docs/interfaces/Operation.md @@ -0,0 +1,145 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Operation + +# Interface: Operation + +## Table of contents + +### Properties + +- [amountsIn](Operation.md#amountsin) +- [amountsOut](Operation.md#amountsout) +- [exchangeIds](Operation.md#exchangeids) +- [marketFeeAddress](Operation.md#marketfeeaddress) +- [maxPrice](Operation.md#maxprice) +- [operation](Operation.md#operation) +- [source](Operation.md#source) +- [swapMarketFee](Operation.md#swapmarketfee) +- [tokenIn](Operation.md#tokenin) +- [tokenOut](Operation.md#tokenout) + +## Properties + +### amountsIn + +• **amountsIn**: `string` \| `number` + +when swapExactAmountIn is EXACT amount IN +expressed in Wei + +#### Defined in + +[@types/Router.ts:31](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L31) + +___ + +### amountsOut + +• **amountsOut**: `string` \| `number` + +when swapExactAmountIn is MIN amount OUT +expressed in Wei + +#### Defined in + +[@types/Router.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L42) + +___ + +### exchangeIds + +• **exchangeIds**: `string` + +used for FixedRate or Dispenser + +#### Defined in + +[@types/Router.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L6) + +___ + +### marketFeeAddress + +• **marketFeeAddress**: `string` + +market fee address to receive fees + +#### Defined in + +[@types/Router.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L58) + +___ + +### maxPrice + +• **maxPrice**: `string` \| `number` + +max price (only for pools) +expressed in Wei + +#### Defined in + +[@types/Router.ts:48](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L48) + +___ + +### operation + +• **operation**: `number` + +operation: +0 - swapExactAmountIn +1 - swapExactAmountOut +2 - FixedRateExchange +3 - Dispenser + +#### Defined in + +[@types/Router.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L20) + +___ + +### source + +• **source**: `string` + +pool Address + +#### Defined in + +[@types/Router.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L11) + +___ + +### swapMarketFee + +• **swapMarketFee**: `string` + +swap fee amount + +#### Defined in + +[@types/Router.ts:53](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L53) + +___ + +### tokenIn + +• **tokenIn**: `string` + +token in address + +#### Defined in + +[@types/Router.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L25) + +___ + +### tokenOut + +• **tokenOut**: `string` + +token out address + +#### Defined in + +[@types/Router.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Router.ts#L36) diff --git a/docs/interfaces/OrderParams.md b/docs/interfaces/OrderParams.md new file mode 100644 index 00000000..cd49cfcf --- /dev/null +++ b/docs/interfaces/OrderParams.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / OrderParams + +# Interface: OrderParams + +## Table of contents + +### Properties + +- [\_consumeMarketFee](OrderParams.md#_consumemarketfee) +- [\_providerFee](OrderParams.md#_providerfee) +- [consumer](OrderParams.md#consumer) +- [serviceIndex](OrderParams.md#serviceindex) + +## Properties + +### \_consumeMarketFee + +• **\_consumeMarketFee**: [`ConsumeMarketFee`](ConsumeMarketFee.md) + +#### Defined in + +[@types/Datatoken.ts:36](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L36) + +___ + +### \_providerFee + +• **\_providerFee**: [`ProviderFees`](ProviderFees.md) + +#### Defined in + +[@types/Datatoken.ts:35](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L35) + +___ + +### consumer + +• **consumer**: `string` + +#### Defined in + +[@types/Datatoken.ts:33](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L33) + +___ + +### serviceIndex + +• **serviceIndex**: `number` + +#### Defined in + +[@types/Datatoken.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L34) diff --git a/docs/interfaces/PriceAndFees.md b/docs/interfaces/PriceAndFees.md new file mode 100644 index 00000000..f6171edb --- /dev/null +++ b/docs/interfaces/PriceAndFees.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / PriceAndFees + +# Interface: PriceAndFees + +## Table of contents + +### Properties + +- [baseTokenAmount](PriceAndFees.md#basetokenamount) +- [consumeMarketFeeAmount](PriceAndFees.md#consumemarketfeeamount) +- [marketFeeAmount](PriceAndFees.md#marketfeeamount) +- [oceanFeeAmount](PriceAndFees.md#oceanfeeamount) + +## Properties + +### baseTokenAmount + +• **baseTokenAmount**: `string` + +#### Defined in + +[@types/FixedPrice.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L25) + +___ + +### consumeMarketFeeAmount + +• **consumeMarketFeeAmount**: `string` + +#### Defined in + +[@types/FixedPrice.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L28) + +___ + +### marketFeeAmount + +• **marketFeeAmount**: `string` + +#### Defined in + +[@types/FixedPrice.ts:27](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L27) + +___ + +### oceanFeeAmount + +• **oceanFeeAmount**: `string` + +#### Defined in + +[@types/FixedPrice.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/FixedPrice.ts#L26) diff --git a/docs/interfaces/ProviderComputeInitialize.md b/docs/interfaces/ProviderComputeInitialize.md new file mode 100644 index 00000000..17568ad4 --- /dev/null +++ b/docs/interfaces/ProviderComputeInitialize.md @@ -0,0 +1,41 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ProviderComputeInitialize + +# Interface: ProviderComputeInitialize + +## Table of contents + +### Properties + +- [datatoken](ProviderComputeInitialize.md#datatoken) +- [providerFee](ProviderComputeInitialize.md#providerfee) +- [validOrder](ProviderComputeInitialize.md#validorder) + +## Properties + +### datatoken + +• `Optional` **datatoken**: `string` + +#### Defined in + +[@types/Provider.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L20) + +___ + +### providerFee + +• `Optional` **providerFee**: [`ProviderFees`](ProviderFees.md) + +#### Defined in + +[@types/Provider.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L22) + +___ + +### validOrder + +• `Optional` **validOrder**: `string` + +#### Defined in + +[@types/Provider.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L21) diff --git a/docs/interfaces/ProviderComputeInitializeResults.md b/docs/interfaces/ProviderComputeInitializeResults.md new file mode 100644 index 00000000..33419d26 --- /dev/null +++ b/docs/interfaces/ProviderComputeInitializeResults.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ProviderComputeInitializeResults + +# Interface: ProviderComputeInitializeResults + +## Table of contents + +### Properties + +- [algorithm](ProviderComputeInitializeResults.md#algorithm) +- [datasets](ProviderComputeInitializeResults.md#datasets) + +## Properties + +### algorithm + +• `Optional` **algorithm**: [`ProviderComputeInitialize`](ProviderComputeInitialize.md) + +#### Defined in + +[@types/Provider.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L26) + +___ + +### datasets + +• `Optional` **datasets**: [`ProviderComputeInitialize`](ProviderComputeInitialize.md)[] + +#### Defined in + +[@types/Provider.ts:27](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L27) diff --git a/docs/interfaces/ProviderFees.md b/docs/interfaces/ProviderFees.md new file mode 100644 index 00000000..05782705 --- /dev/null +++ b/docs/interfaces/ProviderFees.md @@ -0,0 +1,96 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ProviderFees + +# Interface: ProviderFees + +## Table of contents + +### Properties + +- [providerData](ProviderFees.md#providerdata) +- [providerFeeAddress](ProviderFees.md#providerfeeaddress) +- [providerFeeAmount](ProviderFees.md#providerfeeamount) +- [providerFeeToken](ProviderFees.md#providerfeetoken) +- [r](ProviderFees.md#r) +- [s](ProviderFees.md#s) +- [v](ProviderFees.md#v) +- [validUntil](ProviderFees.md#validuntil) + +## Properties + +### providerData + +• **providerData**: `string` + +#### Defined in + +[@types/Provider.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L8) + +___ + +### providerFeeAddress + +• **providerFeeAddress**: `string` + +#### Defined in + +[@types/Provider.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L2) + +___ + +### providerFeeAmount + +• **providerFeeAmount**: `string` + +#### Defined in + +[@types/Provider.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L4) + +___ + +### providerFeeToken + +• **providerFeeToken**: `string` + +#### Defined in + +[@types/Provider.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L3) + +___ + +### r + +• **r**: `string` + +#### Defined in + +[@types/Provider.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L6) + +___ + +### s + +• **s**: `string` + +#### Defined in + +[@types/Provider.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L7) + +___ + +### v + +• **v**: `string` + +#### Defined in + +[@types/Provider.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L5) + +___ + +### validUntil + +• **validUntil**: `string` + +#### Defined in + +[@types/Provider.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L9) diff --git a/docs/interfaces/ProviderInitialize.md b/docs/interfaces/ProviderInitialize.md new file mode 100644 index 00000000..7ebb8565 --- /dev/null +++ b/docs/interfaces/ProviderInitialize.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ProviderInitialize + +# Interface: ProviderInitialize + +## Table of contents + +### Properties + +- [computeAddress](ProviderInitialize.md#computeaddress) +- [datatoken](ProviderInitialize.md#datatoken) +- [nonce](ProviderInitialize.md#nonce) +- [providerFee](ProviderInitialize.md#providerfee) + +## Properties + +### computeAddress + +• **computeAddress**: `string` + +#### Defined in + +[@types/Provider.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L15) + +___ + +### datatoken + +• **datatoken**: `string` + +#### Defined in + +[@types/Provider.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L13) + +___ + +### nonce + +• **nonce**: `string` + +#### Defined in + +[@types/Provider.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L14) + +___ + +### providerFee + +• **providerFee**: [`ProviderFees`](ProviderFees.md) + +#### Defined in + +[@types/Provider.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L16) diff --git a/docs/interfaces/PublisherTrustedAlgorithm.md b/docs/interfaces/PublisherTrustedAlgorithm.md new file mode 100644 index 00000000..bff5782b --- /dev/null +++ b/docs/interfaces/PublisherTrustedAlgorithm.md @@ -0,0 +1,47 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / PublisherTrustedAlgorithm + +# Interface: PublisherTrustedAlgorithm + +## Table of contents + +### Properties + +- [containerSectionChecksum](PublisherTrustedAlgorithm.md#containersectionchecksum) +- [did](PublisherTrustedAlgorithm.md#did) +- [filesChecksum](PublisherTrustedAlgorithm.md#fileschecksum) + +## Properties + +### containerSectionChecksum + +• **containerSectionChecksum**: `string` + +Hash of algorithm’s metadata.algorithm.container section. + +#### Defined in + +[@types/DDO/Service.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L18) + +___ + +### did + +• **did**: `string` + +The DID of the algorithm which is trusted by the publisher. + +#### Defined in + +[@types/DDO/Service.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L6) + +___ + +### filesChecksum + +• **filesChecksum**: `string` + +Hash of algorithm’s files section. + +#### Defined in + +[@types/DDO/Service.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L12) diff --git a/docs/interfaces/PublishingMarketFee.md b/docs/interfaces/PublishingMarketFee.md new file mode 100644 index 00000000..d3933a7a --- /dev/null +++ b/docs/interfaces/PublishingMarketFee.md @@ -0,0 +1,41 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / PublishingMarketFee + +# Interface: PublishingMarketFee + +## Table of contents + +### Properties + +- [publishMarketFeeAddress](PublishingMarketFee.md#publishmarketfeeaddress) +- [publishMarketFeeAmount](PublishingMarketFee.md#publishmarketfeeamount) +- [publishMarketFeeToken](PublishingMarketFee.md#publishmarketfeetoken) + +## Properties + +### publishMarketFeeAddress + +• **publishMarketFeeAddress**: `string` + +#### Defined in + +[@types/Datatoken.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L22) + +___ + +### publishMarketFeeAmount + +• **publishMarketFeeAmount**: `string` + +#### Defined in + +[@types/Datatoken.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L24) + +___ + +### publishMarketFeeToken + +• **publishMarketFeeToken**: `string` + +#### Defined in + +[@types/Datatoken.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Datatoken.ts#L23) diff --git a/docs/interfaces/Purgatory.md b/docs/interfaces/Purgatory.md new file mode 100644 index 00000000..17be9fbc --- /dev/null +++ b/docs/interfaces/Purgatory.md @@ -0,0 +1,34 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Purgatory + +# Interface: Purgatory + +## Table of contents + +### Properties + +- [reason](Purgatory.md#reason) +- [state](Purgatory.md#state) + +## Properties + +### reason + +• **reason**: `string` + +If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`. + +#### Defined in + +[@types/Asset.ts:64](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L64) + +___ + +### state + +• **state**: `boolean` + +If `true`, asset is in purgatory. + +#### Defined in + +[@types/Asset.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L58) diff --git a/docs/interfaces/SearchQuery.md b/docs/interfaces/SearchQuery.md new file mode 100644 index 00000000..ca539eb5 --- /dev/null +++ b/docs/interfaces/SearchQuery.md @@ -0,0 +1,67 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / SearchQuery + +# Interface: SearchQuery + +## Table of contents + +### Properties + +- [aggs](SearchQuery.md#aggs) +- [from](SearchQuery.md#from) +- [query](SearchQuery.md#query) +- [size](SearchQuery.md#size) +- [sort](SearchQuery.md#sort) + +## Properties + +### aggs + +• `Optional` **aggs**: `any` + +#### Defined in + +[services/Aquarius.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L11) + +___ + +### from + +• `Optional` **from**: `number` + +#### Defined in + +[services/Aquarius.ts:6](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L6) + +___ + +### query + +• **query**: `any` + +#### Defined in + +[services/Aquarius.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L9) + +___ + +### size + +• `Optional` **size**: `number` + +#### Defined in + +[services/Aquarius.ts:7](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L7) + +___ + +### sort + +• `Optional` **sort**: `Object` + +#### Index signature + +▪ [jsonPath: `string`]: `string` + +#### Defined in + +[services/Aquarius.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Aquarius.ts#L10) diff --git a/docs/interfaces/Service.md b/docs/interfaces/Service.md new file mode 100644 index 00000000..f716e210 --- /dev/null +++ b/docs/interfaces/Service.md @@ -0,0 +1,138 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Service + +# Interface: Service + +## Table of contents + +### Properties + +- [additionalInformation](Service.md#additionalinformation) +- [compute](Service.md#compute) +- [datatokenAddress](Service.md#datatokenaddress) +- [description](Service.md#description) +- [files](Service.md#files) +- [id](Service.md#id) +- [name](Service.md#name) +- [serviceEndpoint](Service.md#serviceendpoint) +- [timeout](Service.md#timeout) +- [type](Service.md#type) + +## Properties + +### additionalInformation + +• `Optional` **additionalInformation**: `any` + +Stores service specific additional information, this is customizable by publisher + +#### Defined in + +[@types/DDO/Service.ts:109](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L109) + +___ + +### compute + +• `Optional` **compute**: [`ServiceComputeOptions`](ServiceComputeOptions.md) + +If service is of type compute, holds information about the compute-related privacy settings & resources. + +#### Defined in + +[@types/DDO/Service.ts:103](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L103) + +___ + +### datatokenAddress + +• **datatokenAddress**: `string` + +Datatoken address + +#### Defined in + +[@types/DDO/Service.ts:73](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L73) + +___ + +### description + +• `Optional` **description**: `string` + +Service description + +#### Defined in + +[@types/DDO/Service.ts:97](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L97) + +___ + +### files + +• **files**: `string` + +Encrypted file URLs. + +#### Defined in + +[@types/DDO/Service.ts:67](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L67) + +___ + +### id + +• **id**: `string` + +Unique ID + +#### Defined in + +[@types/DDO/Service.ts:55](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L55) + +___ + +### name + +• `Optional` **name**: `string` + +Service friendly name + +#### Defined in + +[@types/DDO/Service.ts:91](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L91) + +___ + +### serviceEndpoint + +• **serviceEndpoint**: `string` + +Provider URL (schema + host). + +#### Defined in + +[@types/DDO/Service.ts:79](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L79) + +___ + +### timeout + +• **timeout**: `number` + +Describing how long the service can be used after consumption is initiated. + +#### Defined in + +[@types/DDO/Service.ts:85](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L85) + +___ + +### type + +• **type**: `string` + +Type of service (access, compute, wss. + +#### Defined in + +[@types/DDO/Service.ts:61](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L61) diff --git a/docs/interfaces/ServiceComputeOptions.md b/docs/interfaces/ServiceComputeOptions.md new file mode 100644 index 00000000..41057dfa --- /dev/null +++ b/docs/interfaces/ServiceComputeOptions.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ServiceComputeOptions + +# Interface: ServiceComputeOptions + +## Table of contents + +### Properties + +- [allowNetworkAccess](ServiceComputeOptions.md#allownetworkaccess) +- [allowRawAlgorithm](ServiceComputeOptions.md#allowrawalgorithm) +- [publisherTrustedAlgorithmPublishers](ServiceComputeOptions.md#publishertrustedalgorithmpublishers) +- [publisherTrustedAlgorithms](ServiceComputeOptions.md#publishertrustedalgorithms) + +## Properties + +### allowNetworkAccess + +• **allowNetworkAccess**: `boolean` + +If true, the algorithm job will have network access. + +#### Defined in + +[@types/DDO/Service.ts:34](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L34) + +___ + +### allowRawAlgorithm + +• **allowRawAlgorithm**: `boolean` + +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. + +#### Defined in + +[@types/DDO/Service.ts:28](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L28) + +___ + +### publisherTrustedAlgorithmPublishers + +• **publisherTrustedAlgorithmPublishers**: `string`[] + +If empty, then any published algorithm is allowed. +Otherwise, only published algorithms by some publishers are allowed + +#### Defined in + +[@types/DDO/Service.ts:41](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L41) + +___ + +### publisherTrustedAlgorithms + +• **publisherTrustedAlgorithms**: [`PublisherTrustedAlgorithm`](PublisherTrustedAlgorithm.md)[] + +If empty, then any published algorithm is allowed. (see below) + +#### Defined in + +[@types/DDO/Service.ts:47](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Service.ts#L47) diff --git a/docs/interfaces/ServiceEndpoint.md b/docs/interfaces/ServiceEndpoint.md new file mode 100644 index 00000000..9228c25c --- /dev/null +++ b/docs/interfaces/ServiceEndpoint.md @@ -0,0 +1,41 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ServiceEndpoint + +# Interface: ServiceEndpoint + +## Table of contents + +### Properties + +- [method](ServiceEndpoint.md#method) +- [serviceName](ServiceEndpoint.md#servicename) +- [urlPath](ServiceEndpoint.md#urlpath) + +## Properties + +### method + +• **method**: `string` + +#### Defined in + +[@types/Provider.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L32) + +___ + +### serviceName + +• **serviceName**: `string` + +#### Defined in + +[@types/Provider.ts:31](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L31) + +___ + +### urlPath + +• **urlPath**: `string` + +#### Defined in + +[@types/Provider.ts:33](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Provider.ts#L33) diff --git a/docs/interfaces/Smartcontract-1.md b/docs/interfaces/Smartcontract-1.md new file mode 100644 index 00000000..f29a637d --- /dev/null +++ b/docs/interfaces/Smartcontract-1.md @@ -0,0 +1,58 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Smartcontract + +# Interface: Smartcontract + +## Table of contents + +### Properties + +- [abi](Smartcontract-1.md#abi) +- [address](Smartcontract-1.md#address) +- [chainId](Smartcontract-1.md#chainid) +- [type](Smartcontract-1.md#type) + +## Properties + +### abi + +• **abi**: [`AbiItem`](AbiItem.md) + +Function ABI (not the entire smartcontract abi) + +#### Defined in + +[@types/File.ts:100](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L100) + +___ + +### address + +• **address**: `string` + +Smartcontract address + +#### Defined in + +[@types/File.ts:88](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L88) + +___ + +### chainId + +• **chainId**: `number` + +ChainId + +#### Defined in + +[@types/File.ts:94](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L94) + +___ + +### type + +• **type**: ``"smartcontract"`` + +#### Defined in + +[@types/File.ts:82](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L82) diff --git a/docs/interfaces/Stats.md b/docs/interfaces/Stats.md new file mode 100644 index 00000000..92693835 --- /dev/null +++ b/docs/interfaces/Stats.md @@ -0,0 +1,47 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Stats + +# Interface: Stats + +## Table of contents + +### Properties + +- [allocated](Stats.md#allocated) +- [orders](Stats.md#orders) +- [price](Stats.md#price) + +## Properties + +### allocated + +• `Optional` **allocated**: `number` + +Total amount of veOCEAN allocated on this asset. + +#### Defined in + +[@types/Asset.ts:129](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L129) + +___ + +### orders + +• **orders**: `number` + +How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job. + +#### Defined in + +[@types/Asset.ts:117](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L117) + +___ + +### price + +• **price**: [`AssetPrice`](AssetPrice.md) + +Contains information about the price of this asset. + +#### Defined in + +[@types/Asset.ts:123](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Asset.ts#L123) diff --git a/docs/interfaces/Template.md b/docs/interfaces/Template.md new file mode 100644 index 00000000..e968dc57 --- /dev/null +++ b/docs/interfaces/Template.md @@ -0,0 +1,30 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / Template + +# Interface: Template + +## Table of contents + +### Properties + +- [isActive](Template.md#isactive) +- [templateAddress](Template.md#templateaddress) + +## Properties + +### isActive + +• **isActive**: `boolean` + +#### Defined in + +[@types/NFTFactory.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L5) + +___ + +### templateAddress + +• **templateAddress**: `string` + +#### Defined in + +[@types/NFTFactory.ts:4](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L4) diff --git a/docs/interfaces/TokenOrder.md b/docs/interfaces/TokenOrder.md new file mode 100644 index 00000000..a84967d1 --- /dev/null +++ b/docs/interfaces/TokenOrder.md @@ -0,0 +1,63 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / TokenOrder + +# Interface: TokenOrder + +## Table of contents + +### Properties + +- [\_consumeMarketFee](TokenOrder.md#_consumemarketfee) +- [\_providerFee](TokenOrder.md#_providerfee) +- [consumer](TokenOrder.md#consumer) +- [serviceIndex](TokenOrder.md#serviceindex) +- [tokenAddress](TokenOrder.md#tokenaddress) + +## Properties + +### \_consumeMarketFee + +• **\_consumeMarketFee**: [`ConsumeMarketFee`](ConsumeMarketFee.md) + +#### Defined in + +[@types/NFTFactory.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L13) + +___ + +### \_providerFee + +• **\_providerFee**: [`ProviderFees`](ProviderFees.md) + +#### Defined in + +[@types/NFTFactory.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L12) + +___ + +### consumer + +• **consumer**: `string` + +#### Defined in + +[@types/NFTFactory.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L10) + +___ + +### serviceIndex + +• **serviceIndex**: `number` + +#### Defined in + +[@types/NFTFactory.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L11) + +___ + +### tokenAddress + +• **tokenAddress**: `string` + +#### Defined in + +[@types/NFTFactory.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/NFTFactory.ts#L9) diff --git a/docs/interfaces/UrlFile.md b/docs/interfaces/UrlFile.md new file mode 100644 index 00000000..31069314 --- /dev/null +++ b/docs/interfaces/UrlFile.md @@ -0,0 +1,71 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / UrlFile + +# Interface: UrlFile + +## Table of contents + +### Properties + +- [headers](UrlFile.md#headers) +- [index](UrlFile.md#index) +- [method](UrlFile.md#method) +- [type](UrlFile.md#type) +- [url](UrlFile.md#url) + +## Properties + +### headers + +• `Optional` **headers**: `FileTypeHeaders` + +Headers key value pairs associated with the asset GET request + +#### Defined in + +[@types/File.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L32) + +___ + +### index + +• `Optional` **index**: `number` + +File index. + +#### Defined in + +[@types/File.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L14) + +___ + +### method + +• **method**: `string` + +HTTP method used + +#### Defined in + +[@types/File.ts:26](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L26) + +___ + +### type + +• **type**: ``"url"`` + +#### Defined in + +[@types/File.ts:8](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L8) + +___ + +### url + +• **url**: `string` + +File URL. + +#### Defined in + +[@types/File.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/File.ts#L20) diff --git a/docs/interfaces/UserCustomParameters.md b/docs/interfaces/UserCustomParameters.md new file mode 100644 index 00000000..e09c7470 --- /dev/null +++ b/docs/interfaces/UserCustomParameters.md @@ -0,0 +1,7 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / UserCustomParameters + +# Interface: UserCustomParameters + +## Indexable + +▪ [key: `string`]: `any` diff --git a/docs/interfaces/ValidateMetadata.md b/docs/interfaces/ValidateMetadata.md new file mode 100644 index 00000000..dacdb64a --- /dev/null +++ b/docs/interfaces/ValidateMetadata.md @@ -0,0 +1,52 @@ +[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ValidateMetadata + +# Interface: ValidateMetadata + +## Table of contents + +### Properties + +- [errors](ValidateMetadata.md#errors) +- [hash](ValidateMetadata.md#hash) +- [proof](ValidateMetadata.md#proof) +- [valid](ValidateMetadata.md#valid) + +## Properties + +### errors + +• `Optional` **errors**: `Object` + +#### Defined in + +[@types/DDO/Metadata.ts:148](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L148) + +___ + +### hash + +• `Optional` **hash**: `string` + +#### Defined in + +[@types/DDO/Metadata.ts:149](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L149) + +___ + +### proof + +• `Optional` **proof**: [`MetadataProof`](MetadataProof.md) + +#### Defined in + +[@types/DDO/Metadata.ts:150](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L150) + +___ + +### valid + +• **valid**: `Boolean` + +#### Defined in + +[@types/DDO/Metadata.ts:147](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/DDO/Metadata.ts#L147) diff --git a/docs/modules.md b/docs/modules.md new file mode 100644 index 00000000..46764e99 --- /dev/null +++ b/docs/modules.md @@ -0,0 +1,856 @@ +[@oceanprotocol/lib](README.md) / Exports + +# @oceanprotocol/lib + +## Table of contents + +### Enumerations + +- [LogLevel](enums/LogLevel.md) + +### Classes + +- [Aquarius](classes/Aquarius.md) +- [Config](classes/Config.md) +- [ConfigHelper](classes/ConfigHelper.md) +- [Datatoken](classes/Datatoken.md) +- [DfRewards](classes/DfRewards.md) +- [DfStrategyV1](classes/DfStrategyV1.md) +- [Dispenser](classes/Dispenser.md) +- [FixedRateExchange](classes/FixedRateExchange.md) +- [Logger](classes/Logger.md) +- [Nft](classes/Nft.md) +- [NftFactory](classes/NftFactory.md) +- [Provider](classes/Provider.md) +- [Router](classes/Router.md) +- [SmartContract](classes/SmartContract.md) +- [SmartContractWithAddress](classes/SmartContractWithAddress.md) +- [VeAllocate](classes/VeAllocate.md) +- [VeFeeDistributor](classes/VeFeeDistributor.md) +- [VeFeeEstimate](classes/VeFeeEstimate.md) +- [VeOcean](classes/VeOcean.md) + +### Interfaces + +- [AbiInput](interfaces/AbiInput.md) +- [AbiItem](interfaces/AbiItem.md) +- [AbiOutput](interfaces/AbiOutput.md) +- [Arweave](interfaces/Arweave.md) +- [Asset](interfaces/Asset.md) +- [AssetDatatoken](interfaces/AssetDatatoken.md) +- [AssetLastEvent](interfaces/AssetLastEvent.md) +- [AssetNft](interfaces/AssetNft.md) +- [AssetPrice](interfaces/AssetPrice.md) +- [ComputeAlgorithm](interfaces/ComputeAlgorithm.md) +- [ComputeAsset](interfaces/ComputeAsset.md) +- [ComputeEnvironment](interfaces/ComputeEnvironment.md) +- [ComputeJob](interfaces/ComputeJob.md) +- [ComputeOutput](interfaces/ComputeOutput.md) +- [ComputeResult](interfaces/ComputeResult.md) +- [ConsumeMarketFee](interfaces/ConsumeMarketFee.md) +- [Credential](interfaces/Credential.md) +- [Credentials](interfaces/Credentials.md) +- [DDO](interfaces/DDO.md) +- [DatatokenCreateParams](interfaces/DatatokenCreateParams.md) +- [DatatokenRoles](interfaces/DatatokenRoles.md) +- [DispenserCreationParams](interfaces/DispenserCreationParams.md) +- [DispenserParams](interfaces/DispenserParams.md) +- [DispenserToken](interfaces/DispenserToken.md) +- [DownloadResponse](interfaces/DownloadResponse.md) +- [Event](interfaces/Event.md) +- [FeesInfo](interfaces/FeesInfo.md) +- [FileInfo](interfaces/FileInfo.md) +- [Files](interfaces/Files.md) +- [FixedPriceExchange](interfaces/FixedPriceExchange.md) +- [FreCreationParams](interfaces/FreCreationParams.md) +- [FreOrderParams](interfaces/FreOrderParams.md) +- [GraphqlQuery](interfaces/GraphqlQuery.md) +- [Ipfs](interfaces/Ipfs.md) +- [Metadata](interfaces/Metadata.md) +- [MetadataAlgorithm](interfaces/MetadataAlgorithm.md) +- [MetadataAndTokenURI](interfaces/MetadataAndTokenURI.md) +- [MetadataProof](interfaces/MetadataProof.md) +- [NftCreateData](interfaces/NftCreateData.md) +- [NftRoles](interfaces/NftRoles.md) +- [Operation](interfaces/Operation.md) +- [OrderParams](interfaces/OrderParams.md) +- [PriceAndFees](interfaces/PriceAndFees.md) +- [ProviderComputeInitialize](interfaces/ProviderComputeInitialize.md) +- [ProviderComputeInitializeResults](interfaces/ProviderComputeInitializeResults.md) +- [ProviderFees](interfaces/ProviderFees.md) +- [ProviderInitialize](interfaces/ProviderInitialize.md) +- [PublisherTrustedAlgorithm](interfaces/PublisherTrustedAlgorithm.md) +- [PublishingMarketFee](interfaces/PublishingMarketFee.md) +- [Purgatory](interfaces/Purgatory.md) +- [SearchQuery](interfaces/SearchQuery.md) +- [Service](interfaces/Service.md) +- [ServiceComputeOptions](interfaces/ServiceComputeOptions.md) +- [ServiceEndpoint](interfaces/ServiceEndpoint.md) +- [Smartcontract](interfaces/Smartcontract-1.md) +- [Stats](interfaces/Stats.md) +- [Template](interfaces/Template.md) +- [TokenOrder](interfaces/TokenOrder.md) +- [UrlFile](interfaces/UrlFile.md) +- [UserCustomParameters](interfaces/UserCustomParameters.md) +- [ValidateMetadata](interfaces/ValidateMetadata.md) + +### Type Aliases + +- [AbiType](modules.md#abitype) +- [ComputeResultType](modules.md#computeresulttype) +- [ReceiptOrDecimal](modules.md#receiptordecimal) +- [ReceiptOrEstimate](modules.md#receiptorestimate) +- [StateMutabilityType](modules.md#statemutabilitytype) + +### Variables + +- [FEE\_HISTORY\_NOT\_SUPPORTED](modules.md#fee_history_not_supported) +- [GASLIMIT\_DEFAULT](modules.md#gaslimit_default) +- [LoggerInstance](modules.md#loggerinstance) +- [MAX\_UINT\_256](modules.md#max_uint_256) +- [ProviderInstance](modules.md#providerinstance) +- [ZERO\_ADDRESS](modules.md#zero_address) +- [configHelperNetworks](modules.md#confighelpernetworks) +- [minAbi](modules.md#minabi) + +### Functions + +- [allowance](modules.md#allowance) +- [allowanceWei](modules.md#allowancewei) +- [amountToUnits](modules.md#amounttounits) +- [approve](modules.md#approve) +- [approveWei](modules.md#approvewei) +- [balance](modules.md#balance) +- [decimals](modules.md#decimals) +- [downloadFile](modules.md#downloadfile) +- [downloadFileBrowser](modules.md#downloadfilebrowser) +- [generateDid](modules.md#generatedid) +- [generateDtName](modules.md#generatedtname) +- [getErrorMessage](modules.md#geterrormessage) +- [getEventFromTx](modules.md#geteventfromtx) +- [getFairGasPrice](modules.md#getfairgasprice) +- [getHash](modules.md#gethash) +- [getTokenDecimals](modules.md#gettokendecimals) +- [sendTx](modules.md#sendtx) +- [setContractDefaults](modules.md#setcontractdefaults) +- [signHash](modules.md#signhash) +- [sleep](modules.md#sleep) +- [transfer](modules.md#transfer) +- [unitsToAmount](modules.md#unitstoamount) + +## Type Aliases + +### AbiType + +Ƭ **AbiType**: ``"function"`` \| ``"constructor"`` \| ``"event"`` \| ``"fallback"`` + +#### Defined in + +[@types/Contracts.ts:1](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L1) + +___ + +### ComputeResultType + +Ƭ **ComputeResultType**: ``"algorithmLog"`` \| ``"output"`` \| ``"configrationLog"`` \| ``"publishLog"`` + +#### Defined in + +[@types/Compute.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L3) + +___ + +### ReceiptOrDecimal + +Ƭ **ReceiptOrDecimal**<`G`\>: `G` extends ``false`` ? `providers.TransactionResponse` : `number` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Defined in + +[@types/ReturnTypes.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/ReturnTypes.ts#L5) + +___ + +### ReceiptOrEstimate + +Ƭ **ReceiptOrEstimate**<`G`\>: `G` extends ``false`` ? `providers.TransactionResponse` : `BigNumber` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Defined in + +[@types/ReturnTypes.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/ReturnTypes.ts#L2) + +___ + +### StateMutabilityType + +Ƭ **StateMutabilityType**: ``"pure"`` \| ``"view"`` \| ``"nonpayable"`` \| ``"payable"`` + +#### Defined in + +[@types/Contracts.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Contracts.ts#L2) + +## Variables + +### FEE\_HISTORY\_NOT\_SUPPORTED + +• `Const` **FEE\_HISTORY\_NOT\_SUPPORTED**: ``"Returned error: Method eth_feeHistory not supported."`` + +#### Defined in + +[utils/Constants.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Constants.ts#L5) + +___ + +### GASLIMIT\_DEFAULT + +• `Const` **GASLIMIT\_DEFAULT**: ``1000000`` + +#### Defined in + +[utils/Constants.ts:2](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Constants.ts#L2) + +___ + +### LoggerInstance + +• `Const` **LoggerInstance**: [`Logger`](classes/Logger.md) + +#### Defined in + +[utils/Logger.ts:45](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Logger.ts#L45) + +___ + +### MAX\_UINT\_256 + +• `Const` **MAX\_UINT\_256**: ``"115792089237316195423570985008687907853269984665640564039457584007913129639934"`` + +#### Defined in + +[utils/Constants.ts:3](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Constants.ts#L3) + +___ + +### ProviderInstance + +• `Const` **ProviderInstance**: [`Provider`](classes/Provider.md) + +#### Defined in + +[services/Provider.ts:916](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/services/Provider.ts#L916) + +___ + +### ZERO\_ADDRESS + +• `Const` **ZERO\_ADDRESS**: ``"0x0000000000000000000000000000000000000000"`` + +#### Defined in + +[utils/Constants.ts:1](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/Constants.ts#L1) + +___ + +### configHelperNetworks + +• `Const` **configHelperNetworks**: [`Config`](classes/Config.md)[] + +#### Defined in + +[config/ConfigHelper.ts:25](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/config/ConfigHelper.ts#L25) + +___ + +### minAbi + +• `Const` **minAbi**: ({ `anonymous?`: `undefined` = false; `constant`: `boolean` = false; `inputs`: { `name`: `string` = '\_spender'; `type`: `string` = 'address' }[] ; `name`: `string` = 'approve'; `outputs`: { `name`: `string` = ''; `type`: `string` = 'bool' }[] ; `payable`: `boolean` = false; `stateMutability`: `string` = 'nonpayable'; `type`: `string` = 'function' } \| { `anonymous?`: `undefined` = false; `constant?`: `undefined` = false; `inputs?`: `undefined` ; `name?`: `undefined` = 'Approval'; `outputs?`: `undefined` ; `payable`: `boolean` = true; `stateMutability`: `string` = 'payable'; `type`: `string` = 'fallback' } \| { `anonymous`: `boolean` = false; `constant?`: `undefined` = false; `inputs`: { `indexed`: `boolean` = true; `name`: `string` = 'owner'; `type`: `string` = 'address' }[] ; `name`: `string` = 'Approval'; `outputs?`: `undefined` ; `payable?`: `undefined` = true; `stateMutability?`: `undefined` = 'payable'; `type`: `string` = 'event' })[] + +#### Defined in + +[utils/minAbi.ts:1](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/minAbi.ts#L1) + +## Functions + +### allowance + +▸ **allowance**(`signer`, `tokenAddress`, `account`, `spender`, `tokenDecimals?`): `Promise`<`string`\> + +Get Allowance for any Datatoken + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object | +| `tokenAddress` | `string` | The address of the token | +| `account` | `string` | The address of the caller | +| `spender` | `string` | The address of the spender | +| `tokenDecimals?` | `number` | optional number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[utils/TokenUtils.ts:143](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L143) + +___ + +### allowanceWei + +▸ **allowanceWei**(`signer`, `tokenAddress`, `account`, `spender`): `Promise`<`string`\> + +Get Allowance in wei for any erc20 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object | +| `tokenAddress` | `string` | The address of the token | +| `account` | `string` | The address of the caller | +| `spender` | `string` | The address of the spneder | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[utils/TokenUtils.ts:182](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L182) + +___ + +### amountToUnits + +▸ **amountToUnits**(`signer`, `token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of tokens to units + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object to use. | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of tokens to convert | +| `tokenDecimals?` | `number` | The number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in units + +#### Defined in + +[utils/ContractUtils.ts:82](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L82) + +___ + +### approve + +▸ **approve**<`G`\>(`signer`, `config`, `account`, `tokenAddress`, `spender`, `amount`, `force?`, `tokenDecimals?`, `estimateGas?`): `Promise`<[`ReceiptOrDecimal`](modules.md#receiptordecimal)<`G`\> \| `number`\> + +Approve spender to spent amount tokens + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `signer` | `Signer` | `undefined` | The signer object | +| `config` | [`Config`](classes/Config.md) | `undefined` | The config object | +| `account` | `string` | `undefined` | The address of the caller | +| `tokenAddress` | `string` | `undefined` | The address of the token | +| `spender` | `string` | `undefined` | The address of the spender | +| `amount` | `string` | `undefined` | amount of ERC20 Datatokens (always expressed as wei) | +| `force` | `boolean` | `false` | if true, will overwrite any previous allowence. Else, will check if allowence is enough and will not send a transaction if it's not needed | +| `tokenDecimals?` | `number` | `undefined` | optional number of decimals of the token | +| `estimateGas?` | `G` | `undefined` | if true, returns the estimate gas cost for calling the method | + +#### Returns + +`Promise`<[`ReceiptOrDecimal`](modules.md#receiptordecimal)<`G`\> \| `number`\> + +#### Defined in + +[utils/TokenUtils.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L19) + +___ + +### approveWei + +▸ **approveWei**<`G`\>(`signer`, `config`, `account`, `tokenAddress`, `spender`, `amount`, `force?`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](modules.md#receiptorestimate)<`G`\>\> + +Approve spender to spent amount tokens + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `signer` | `Signer` | `undefined` | The signer object | +| `config` | [`Config`](classes/Config.md) | `undefined` | The config object | +| `account` | `string` | `undefined` | The address of the caller | +| `tokenAddress` | `string` | `undefined` | The address of the token | +| `spender` | `string` | `undefined` | The address of the spender | +| `amount` | `string` | `undefined` | amount of ERC20 tokens (always expressed as wei) | +| `force` | `boolean` | `false` | if true, will overwrite any previous allowence. Else, will check if allowence is enough and will not send a transaction if it's not needed | +| `estimateGas?` | `G` | `undefined` | if true, returns the estimate gas cost for calling the method | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[utils/TokenUtils.ts:63](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L63) + +___ + +### balance + +▸ **balance**(`signer`, `tokenAddress`, `account`, `tokenDecimals?`): `Promise`<`string`\> + +Get balance for any Datatoken + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object | +| `tokenAddress` | `string` | The address of the token | +| `account` | `string` | The address of the caller | +| `tokenDecimals?` | `number` | optional number of decimals of the token | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[utils/TokenUtils.ts:163](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L163) + +___ + +### decimals + +▸ **decimals**(`signer`, `tokenAddress`): `Promise`<`number`\> + +Get decimals for any Datatoken + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object | +| `tokenAddress` | `string` | The address of the token | + +#### Returns + +`Promise`<`number`\> + +Number of decimals of the token + +#### Defined in + +[utils/TokenUtils.ts:198](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L198) + +___ + +### downloadFile + +▸ **downloadFile**(`url`, `index?`): `Promise`<[`DownloadResponse`](interfaces/DownloadResponse.md)\> + +Triggers a file download from the specified URL when called from a browser context. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `url` | `string` | The URL of the file to download | +| `index?` | `number` | The file index | + +#### Returns + +`Promise`<[`DownloadResponse`](interfaces/DownloadResponse.md)\> + +- A Promise that resolves when the file has been downloaded + +#### Defined in + +[utils/FetchHelper.ts:35](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/FetchHelper.ts#L35) + +___ + +### downloadFileBrowser + +▸ **downloadFileBrowser**(`url`): `Promise`<`void`\> + +Triggers a file download from the specified URL when called from a browser context. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `url` | `string` | The URL of the file to download | + +#### Returns + +`Promise`<`void`\> + +- A Promise that resolves when the file has been downloaded + +#### Defined in + +[utils/FetchHelper.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/FetchHelper.ts#L9) + +___ + +### generateDid + +▸ **generateDid**(`nftAddress`, `chainId`): `string` + +Generates a valid DID + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nftAddress` | `string` | The NFT address | +| `chainId` | `number` | The chain ID | + +#### Returns + +`string` + +- The DID + +#### Defined in + +[utils/DdoHelpers.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/DdoHelpers.ts#L10) + +___ + +### generateDtName + +▸ **generateDtName**(`wordList?`): `Object` + +This function generates a datatoken name and symbol from a given word list. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `wordList?` | `Object` | An object containing an array of nouns and adjectives. | +| `wordList.adjectives` | `string`[] | An array of adjectives. | +| `wordList.nouns` | `string`[] | An array of nouns. | + +#### Returns + +`Object` + +Returns an object containing the generated name and symbol. Produces e.g. "Endemic Jellyfish Token" & "ENDJEL-45" + +| Name | Type | +| :------ | :------ | +| `name` | `string` | +| `symbol` | `string` | + +#### Defined in + +[utils/DatatokenName.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/DatatokenName.ts#L10) + +___ + +### getErrorMessage + +▸ **getErrorMessage**(`error`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `Object` | + +#### Returns + +`string` + +#### Defined in + +[utils/ProviderErrors.ts:77](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ProviderErrors.ts#L77) + +___ + +### getEventFromTx + +▸ **getEventFromTx**(`txReceipt`, `eventName`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txReceipt` | `any` | +| `eventName` | `any` | + +#### Returns + +`any` + +#### Defined in + +[utils/ContractUtils.ts:96](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L96) + +___ + +### getFairGasPrice + +▸ **getFairGasPrice**(`signer`, `gasFeeMultiplier`): `Promise`<`string`\> + +Asynchronous function that returns a fair gas price based on the current gas price and a multiplier. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object to use for fetching the current gas price. | +| `gasFeeMultiplier` | `number` | The multiplier to apply to the current gas price. If not provided, the current gas price is returned as a string. | + +#### Returns + +`Promise`<`string`\> + +A Promise that resolves to a string representation of the fair gas price. + +#### Defined in + +[utils/ContractUtils.ts:30](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L30) + +___ + +### getHash + +▸ **getHash**(`data`): `string` + +Returns the SHA256 hash of the input data + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `any` | The input data | + +#### Returns + +`string` + +- The SHA256 hash of the input data + +#### Defined in + +[utils/DdoHelpers.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/DdoHelpers.ts#L21) + +___ + +### getTokenDecimals + +▸ **getTokenDecimals**(`signer`, `token`): `Promise`<`any`\> + +Asynchronous function that returns the number of decimal places for a given token. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object to use for fetching the token decimals. | +| `token` | `string` | The address of the token contract. | + +#### Returns + +`Promise`<`any`\> + +A Promise that resolves to the number of decimal places for the token. + +#### Defined in + +[utils/ContractUtils.ts:46](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L46) + +___ + +### sendTx + +▸ **sendTx**(`estGas`, `signer`, `gasFeeMultiplier`, `functionToSend`, `...args`): `Promise`<`providers.TransactionResponse`\> + +Send the transation on chain + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `estGas` | `BigNumber` | estimated gas for the transaction | +| `signer` | `Signer` | signer object | +| `gasFeeMultiplier` | `number` | number represinting the multiplier we apply to gas fees | +| `functionToSend` | `ContractFunction`<`any`\> | function that we need to send | +| `...args` | `any`[] | arguments of the function | + +#### Returns + +`Promise`<`providers.TransactionResponse`\> + +transaction receipt + +#### Defined in + +[utils/ContractUtils.ts:111](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L111) + +___ + +### setContractDefaults + +▸ **setContractDefaults**(`contract`, `config`): `Contract` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `contract` | `Contract` | +| `config` | [`Config`](classes/Config.md) | + +#### Returns + +`Contract` + +#### Defined in + +[utils/ContractUtils.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L10) + +___ + +### signHash + +▸ **signHash**(`signer`, `message`): `Promise`<{ `r`: `string` ; `s`: `string` ; `v`: `string` }\> + +Signs the hash of a message using the provided signer. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer to use for signing the hash. | +| `message` | `string` | The message to sign. | + +#### Returns + +`Promise`<{ `r`: `string` ; `s`: `string` ; `v`: `string` }\> + +- A Promise that resolves to the signature of the hash of the message. + +#### Defined in + +[utils/SignatureUtils.ts:9](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/SignatureUtils.ts#L9) + +___ + +### sleep + +▸ **sleep**(`ms`): `Promise`<`unknown`\> + +Simple blocking sleep function + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `ms` | `number` | Number of miliseconds to wait | + +#### Returns + +`Promise`<`unknown`\> + +#### Defined in + +[utils/General.ts:5](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/General.ts#L5) + +___ + +### transfer + +▸ **transfer**<`G`\>(`signer`, `config`, `tokenAddress`, `recipient`, `amount`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](modules.md#receiptorestimate)<`G`\>\> + +Moves amount tokens from the caller’s account to recipient. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `G` | extends `boolean` = ``false`` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object | +| `config` | [`Config`](classes/Config.md) | The config object | +| `tokenAddress` | `string` | The address of the token | +| `recipient` | `string` | The address of the tokens receiver | +| `amount` | `string` | amount of ERC20 Datatokens (not as wei) | +| `estimateGas?` | `G` | if true returns the gas estimate | + +#### Returns + +`Promise`<[`ReceiptOrEstimate`](modules.md#receiptorestimate)<`G`\>\> + +#### Defined in + +[utils/TokenUtils.ts:111](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/TokenUtils.ts#L111) + +___ + +### unitsToAmount + +▸ **unitsToAmount**(`signer`, `token`, `amount`, `tokenDecimals?`): `Promise`<`string`\> + +Converts an amount of units to tokens + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Signer` | The signer object to use. | +| `token` | `string` | The token to convert | +| `amount` | `string` | The amount of units to convert | +| `tokenDecimals?` | `number` | The number of decimals in the token | + +#### Returns + +`Promise`<`string`\> + +- The converted amount in tokens + +#### Defined in + +[utils/ContractUtils.ts:59](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/utils/ContractUtils.ts#L59) diff --git a/package-lock.json b/package-lock.json index b485a1fa..bca19607 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,8 @@ "source-map-support": "^0.5.19", "ts-node": "^10.9.1", "ts-node-register": "^1.0.0", - "typedoc": "0.23.19", + "typedoc": "^0.24.6", + "typedoc-plugin-markdown": "^3.15.2", "typescript": "^4.7.4" }, "peerDependencies": { @@ -4153,6 +4154,12 @@ "node": ">=8" } }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", + "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", + "dev": true + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -11440,9 +11447,9 @@ "dev": true }, "node_modules/marked": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.0.tgz", - "integrity": "sha512-+Z6KDjSPa6/723PQYyc1axYZpYYpDnECDaU6hkaf5gqBieBkMKYReL5hteF2QizhlMbgbo8umXl/clZ67+GlsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -15666,14 +15673,15 @@ } }, "node_modules/shiki": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", - "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.1.tgz", + "integrity": "sha512-+Jz4nBkCBe0mEDqo1eKRcCdjRtrCjozmcbTUjbPTX7OOJfEbTZzlUWlZtGe3Gb5oV1/jnojhG//YZc3rs9zSEw==", "dev": true, "dependencies": { - "jsonc-parser": "^3.0.0", - "vscode-oniguruma": "^1.6.1", - "vscode-textmate": "^6.0.0" + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" } }, "node_modules/side-channel": { @@ -16566,15 +16574,15 @@ } }, "node_modules/typedoc": { - "version": "0.23.19", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", - "integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", + "version": "0.24.6", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.6.tgz", + "integrity": "sha512-c3y3h45xJv3qYwKDAwU6Cl+26CjT0ZvblHzfHJ+SjQDM4p1mZxtgHky4lhmG0+nNarRht8kADfZlbspJWdZarQ==", "dev": true, "dependencies": { "lunr": "^2.3.9", - "marked": "^4.0.19", - "minimatch": "^5.1.0", - "shiki": "^0.11.1" + "marked": "^4.3.0", + "minimatch": "^9.0.0", + "shiki": "^0.14.1" }, "bin": { "typedoc": "bin/typedoc" @@ -16583,7 +16591,29 @@ "node": ">= 14.14" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.15.2.tgz", + "integrity": "sha512-OPXAL9hhdoVJzH/UaKAz6CBS/s8KlYyLWwnxF7ap0fQCuaMMWShA1JBq4n1SXbiGjx+7DOhOfTKQ5OzwryN3Vw==", + "dev": true, + "dependencies": { + "handlebars": "^4.7.7", + "typedoc-plugin-mdn-links": "^3.0.3" + }, + "peerDependencies": { + "typedoc": ">=0.24.0" + } + }, + "node_modules/typedoc-plugin-mdn-links": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/typedoc-plugin-mdn-links/-/typedoc-plugin-mdn-links-3.0.3.tgz", + "integrity": "sha512-NXhIpwQnsg7BcyMCHVqj3tUK+DL4g3Bt96JbFl4APzTGFkA+iM6GfZ/fn3TAqJ8O0CXG5R9BfWxolw1m1omNuQ==", + "dev": true, + "peerDependencies": { + "typedoc": ">= 0.23.14 || 0.24.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { @@ -16596,15 +16626,18 @@ } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/typescript": { @@ -16896,15 +16929,15 @@ } }, "node_modules/vscode-oniguruma": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", "dev": true }, "node_modules/vscode-textmate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", - "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true }, "node_modules/wcwidth": { @@ -20763,6 +20796,12 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, + "ansi-sequence-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", + "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -26372,9 +26411,9 @@ "dev": true }, "marked": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.0.tgz", - "integrity": "sha512-+Z6KDjSPa6/723PQYyc1axYZpYYpDnECDaU6hkaf5gqBieBkMKYReL5hteF2QizhlMbgbo8umXl/clZ67+GlsA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true }, "maxmin": { @@ -29500,14 +29539,15 @@ } }, "shiki": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.11.1.tgz", - "integrity": "sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.1.tgz", + "integrity": "sha512-+Jz4nBkCBe0mEDqo1eKRcCdjRtrCjozmcbTUjbPTX7OOJfEbTZzlUWlZtGe3Gb5oV1/jnojhG//YZc3rs9zSEw==", "dev": true, "requires": { - "jsonc-parser": "^3.0.0", - "vscode-oniguruma": "^1.6.1", - "vscode-textmate": "^6.0.0" + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" } }, "side-channel": { @@ -30200,15 +30240,15 @@ } }, "typedoc": { - "version": "0.23.19", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.23.19.tgz", - "integrity": "sha512-70jPL0GQnSJtgQqI7ifOWxpTXrB3sxc4SWPPRn3K0wdx3txI6ZIT/ZYMF39dNg2Gjmql45cO+cAKXJp0TpqOVA==", + "version": "0.24.6", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.6.tgz", + "integrity": "sha512-c3y3h45xJv3qYwKDAwU6Cl+26CjT0ZvblHzfHJ+SjQDM4p1mZxtgHky4lhmG0+nNarRht8kADfZlbspJWdZarQ==", "dev": true, "requires": { "lunr": "^2.3.9", - "marked": "^4.0.19", - "minimatch": "^5.1.0", - "shiki": "^0.11.1" + "marked": "^4.3.0", + "minimatch": "^9.0.0", + "shiki": "^0.14.1" }, "dependencies": { "brace-expansion": { @@ -30221,9 +30261,9 @@ } }, "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -30231,6 +30271,23 @@ } } }, + "typedoc-plugin-markdown": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.15.2.tgz", + "integrity": "sha512-OPXAL9hhdoVJzH/UaKAz6CBS/s8KlYyLWwnxF7ap0fQCuaMMWShA1JBq4n1SXbiGjx+7DOhOfTKQ5OzwryN3Vw==", + "dev": true, + "requires": { + "handlebars": "^4.7.7", + "typedoc-plugin-mdn-links": "^3.0.3" + } + }, + "typedoc-plugin-mdn-links": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/typedoc-plugin-mdn-links/-/typedoc-plugin-mdn-links-3.0.3.tgz", + "integrity": "sha512-NXhIpwQnsg7BcyMCHVqj3tUK+DL4g3Bt96JbFl4APzTGFkA+iM6GfZ/fn3TAqJ8O0CXG5R9BfWxolw1m1omNuQ==", + "dev": true, + "requires": {} + }, "typescript": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", @@ -30447,15 +30504,15 @@ } }, "vscode-oniguruma": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", - "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", "dev": true }, "vscode-textmate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-6.0.0.tgz", - "integrity": "sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true }, "wcwidth": { diff --git a/package.json b/package.json index 1180c98e..8ba37098 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", "type-check": "npm run build:metadata && tsc --noEmit", "doc:json": "node ./scripts/typedoc.js", + "docs": "typedoc --options typedoc.json --plugin typedoc-plugin-markdown", "run": "ts-node", "release": "release-it --non-interactive", "changelog": "auto-changelog -p", @@ -34,7 +35,8 @@ "test:integration:cover": "nyc --report-dir coverage/integration --no-clean npm run test:integration", "create:guide": "./scripts/createCodeExamples.sh test/integration/CodeExamples.test.ts", "create:guidec2d": "./scripts/createCodeExamples.sh test/integration/ComputeExamples.test.ts", - "commit:guides": "./scripts/commitChanges.sh" + "commit:guides": "./scripts/commitChanges.sh", + "commit:docs": "./scripts/updateDocs.sh" }, "repository": { "type": "git", @@ -90,7 +92,8 @@ "source-map-support": "^0.5.19", "ts-node": "^10.9.1", "ts-node-register": "^1.0.0", - "typedoc": "0.23.19", + "typedoc": "^0.24.6", + "typedoc-plugin-markdown": "^3.15.2", "typescript": "^4.7.4" }, "nyc": { diff --git a/scripts/updateDocs.sh b/scripts/updateDocs.sh new file mode 100755 index 00000000..11dd85cd --- /dev/null +++ b/scripts/updateDocs.sh @@ -0,0 +1,10 @@ +# Create updated documentation +npm run docs + +# Stage the file, commit and push +git status +git add ./docs +git commit -m "Updating documentation" +branch=${GITHUB_HEAD_REF#refs/heads/} +echo Pushing changes to branch: ${branch} +git push origin HEAD:${branch} --force \ No newline at end of file diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..890281ce --- /dev/null +++ b/typedoc.json @@ -0,0 +1,4 @@ +{ + "entryPoints": ["./src/index.ts"], + "out": "docs" +}